I was tinkering with the blink starter example. My goal was “blink continuously when the button is idle; stay lit when the button is held”. What I got was “no light when the button is idle; blink when the button is held”. Where did I go wrong?
module fpga_top(
input wire WF_CLK,
input wire WF_BUTTON,
output reg WF_LED
);
reg [23:0] counter;
always @ (posedge WF_CLK) begin
WF_LED <= counter[22] | WF_BUTTON;
counter <= counter + 'b1;
end
endmodule