SDVD/design/debouncer.sv
Waylon Cude 831e588986
All checks were successful
ci/woodpecker/push/test-workflow Pipeline was successful
Add vivado project
Hopefully this is enough of the project files for this to work ...
2025-05-16 17:16:08 -07:00

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