Advertisement
Guest User

denouncer

a guest
Mar 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module debouncer(
  2.     input CLOCK_50,
  3.     input button,
  4.     output reg out
  5.     );
  6.    
  7.     reg toCounter;
  8.    
  9.     reg [19:0] count;
  10.    
  11.     always @(posedge CLOCK_50)
  12.         count <= count + 1'b1;
  13.        
  14.     always @(posedge count[19])
  15.         out <= button;
  16.        
  17.    
  18. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement