偶刚开始学习Verilog-HDL, 在七段数码管上显示数字
其中一部分持续:
input key; //按键输入
reg num; //寄存器
always @(posedge key)
if(num==9)
num<=0;
else
num<=num+1
但是由于按键抖动问题, 按一下按键数字总数变几次!(比如说按一下num回从0跳到3 4)
我听说用延时可以消除按键抖动问题, 但是不知道怎么样实现!(单片机加个延时程序就可以, 在这里实在不知道怎么做,) 在网上找了很久都找不到怎么解决。
请大侠帮忙,最好能写出程序, 谢谢!!
你可以使用状态机来实现,
比如一个状态是判断是否有按键,下一个状态就是延时,下一个状态是是否松开。。。。
延时使用对clk计数来实现。
求教高手问题:Warning: Using design file count_module.v, which is not specified as a design file for the current project, but contains definitions for 1 design units and 1 entities in project
Info: Found entity 1: count_module
Warning: Reduced register "mux21_module:inst7|temper_scan_2[3]" with stuck data_in port to stuck value GND
这里出的警告要怎么去!
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |