diff options
author | H. Peter Anvin <hpa@zytor.com> | 2005-01-31 18:30:33 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2005-01-31 18:30:33 +0000 |
commit | 2f437e650e00a920bcc9491eab40c676601d9c6c (patch) | |
tree | e54d38b1541d859bdaffc66c8b5d3392d9ee928e | |
parent | 22cde118ec4afd3f283a2b5bbf638f0403ed5694 (diff) | |
download | abc80-2f437e650e00a920bcc9491eab40c676601d9c6c.tar.gz abc80-2f437e650e00a920bcc9491eab40c676601d9c6c.tar.xz abc80-2f437e650e00a920bcc9491eab40c676601d9c6c.zip |
Debounce for 4 ms
-rwxr-xr-x | abc80.qpf | 2 | ||||
-rw-r--r-- | debounce.v | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -21,7 +21,7 @@ QUARTUS_VERSION = "4.1"
-DATE = "10:03:50 January 31, 2005"
+DATE = "10:04:30 January 31, 2005"
# Revisions
@@ -12,11 +12,11 @@ module debounce ( output strobe; // This is optimized for a 12.5 MHz clock and the - // assumption that glitches are limited to 20 us + // assumption that glitches are limited to 4 ms reg out; reg out1; - reg [7:0] ctr; + reg [15:0] ctr; assign strobe = out ^ out1; @@ -33,14 +33,14 @@ module debounce ( if ( in ) begin - if ( ctr == 8'hFF ) + if ( ctr == 16'hFFFF ) out <= 1'b1; else ctr <= ctr + 1; end else begin - if ( ctr == 8'h00 ) + if ( ctr == 16'h0000 ) out <= 1'b0; else ctr <= ctr - 1; |