#四位串并转换器
module serial_pal( //四位串并转换程序
clk,en,rst,
in,out
);
input cin,clk,en,rst;
output[3:0] out;
reg[3:0] out;
always @ (posedge clk or negedge rst)
begin
if(!rst)
cout<=4'b0;
else if(en)
cout<={cout[2:0],cin};
else
cout<=cout;
end
endmodule