I am trying to make an led on the DE0 FPGA turn on every 8 button presses. I have written the code for a counter, but the led is turning on every other button press, not every 8.
Here is what I have:
module tima(output led, input reset, input clock);
reg [7:0]count;
initial count = 0;
always @ (posedge clock, posedge reset) begin
if(reset)
count <= 0;
else
count <= count + 1'd1;
end
assign led = count;
endmodule