All checks were successful
ci/woodpecker/push/test-workflow Pipeline was successful
Hopefully theses are right ...
24 lines
432 B
Systemverilog
24 lines
432 B
Systemverilog
//NOTE: you should drive this with a slow clock to actually debounce input
|
|
module debouncer(input logic clk, input reset, input source, output wire out);
|
|
|
|
logic pressed;
|
|
assign out = pressed;
|
|
|
|
always_ff @(posedge clk) begin
|
|
if (reset)
|
|
pressed <= 0;
|
|
else if (!pressed && source)
|
|
pressed <= 1;
|
|
else if (pressed && !source)
|
|
pressed <= 0;
|
|
end
|
|
|
|
|
|
//always_ff (@posedge clk) begin
|
|
//
|
|
//end
|
|
|
|
|
|
|
|
endmodule
|