module p_to_s(clk,rst_n,din,dout);
input clk;
input rst_n;
input[7:0]din;
output dout;
reg[3:0]counter;
reg[7:0]buff;
reg dout;
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
counter<=4'd0;
else if(counter==8'd8)
counter<=4'd0;
else
counter<=counter+1;
always@(posedge clk or negedge rst_n)
begin
if(rst_n==1'b0)
buff<=8'd0;
else
begin
if(counter==4'd0)
buff<=din;
else
buff<=(buff<<1);
end
end
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
dout<=1'b0;
else
dout<=buff[7];
input clk;
input rst_n;
input[7:0]din;
output dout;
reg[3:0]counter;
reg[7:0]buff;
reg dout;
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
counter<=4'd0;
else if(counter==8'd8)
counter<=4'd0;
else
counter<=counter+1;
always@(posedge clk or negedge rst_n)
begin
if(rst_n==1'b0)
buff<=8'd0;
else
begin
if(counter==4'd0)
buff<=din;
else
buff<=(buff<<1);
end
end
always@(posedge clk or negedge rst_n)
if(rst_n==1'b0)
dout<=1'b0;
else
dout<=buff[7];
endmodule