-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebounce.v
More file actions
30 lines (26 loc) · 884 Bytes
/
debounce.v
File metadata and controls
30 lines (26 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// Module:debounce
//
// Author: george
//
// Description:
//
//
// --------------------------------------------------------------------
// Code Revision History :
// --------------------------------------------------------------------
// Version: |Mod. Date: |Changes Made:
// V1.0 |2021/01/11 |Initial ver
// --------------------------------------------------------------------
//////////////////////////////sample code : debounce
module debounce (pb, clk, pb_debounce);
input pb, clk;
output pb_debounce;
reg [3:0] DFF;
always @(posedge clk) begin
DFF[3:1] <= DFF[2:0];
DFF[0] <= pb;
end
assign pb_debounce = ((DFF == 4'b1111)? 1'b1 : 1'b0);
endmodule