介绍:按下KEY键,使时间停止,再按使其继续。实现:一个脉冲来(KEY不按的时候为1,按下去为0),产生一个0,1变化的信号
1 module hold(press,level);
2 input press;
3 output level;
4
5 reg level;
6
7 always @( negedge press )
8 begin
9 if(press)
10 level = 1;
11 else level =!level;
12 end
13 endmodule
2 input press;
3 output level;
4
5 reg level;
6
7 always @( negedge press )
8 begin
9 if(press)
10 level = 1;
11 else level =!level;
12 end
13 endmodule