I am using push button of DE2 board as asynchronous reset, but it fails to work. This is my module for a n-bit register:
module regne (D, Clock, Resetn, Q);
parameter n;
input [n-1:0] D;
input Clock, Resetn;
output reg [n-1:0] Q;
always @ (posedge Clock or negedge Resetn)
begin
if (Resetn == 0)
Q[n-1:0] <= 'b0;
else
Q[n-1:0] <= D[n-1:0];
end
endmodule
However, the reset fails to work. It does not do anything when I press the push button. I think it is caused by bouncing of push button. So how can I implement debouncing in Verilog?