assign key_out = key_reg;
always@( posedge clk )
if( key_in == 1'b0 )
count_low <= count_low + 1;
else
count_low <= 23'h 00_0000;
always@( posedge clk )
if( key_in == 1'b1 )
count_high <= count_high +1;
else
count_high <= 23'h 00_0000;
// deJitter key out
always@( posedge clk )
begin
if( count_high == 23'h 25_0000 )
key_reg <= 1'b1;
else
if( count_low == 23'h 25_0000 )
key_reg <= 1'b0;
else
key_reg <= key_reg;
end
大家看一下这个案件消除抖动的原理,我有点不明白
麻烦高手给讲解一下 |