reg [7:0] shift_cnt;
reg [7:0] temp ;
reg single_bit;
always@( negedge clk_100MHz, negedge rstn )
begin
if( !rstn )
begin
shift_cnt <= 8'd8;
temp <= 8'h55;
single_bit <= 1'b0 ;
end
else if( |shift_cnt )
begin
shift_cnt <= shift_cnt - 1;
single_bit <= temp[shift_cnt - 1];
end
else
single_bit <= 1'b0 ;
end
always@( posedge clk_100MHz, negedge rstn )
begin
if( !rstn )
begin
shift <= 8'd0;
end
else
begin
shift <= {shift[6:0], single_bit} ;
end
end
时序与代码是一致的,波形没问题
不太理解你为什么认为在这个光标处shift 应该为 1
按你的代码,shift 为1是在时钟上升沿single_bit 为 1 的时候产生。
如果你认为波形有问题,就应该去分析single_bit