热度 15
2014-5-3 20:39
801 次阅读|
2 个评论
以下是代码片段: reg key_press_r; reg key_press_rr; wire countdown_value_set; reg key_countdown_r; reg key_countdown_rr; wire key_countdown_start; always @(posedge clk,negedge rst_n) begin if(!rst_n) begin key_press_r = 1'b0; key_press_rr = 1'b0; key_countdown_r = 1'b0; key_countdown_rr = 1'b0; end else begin key_press_r = key_press; key_press_rr = key_press_r; key_countdown_r = key_countdown; key_countdown_rr = key_countdown_r; end end 代码测试.