Forum Discussion
Altera_Forum
Honored Contributor
17 years agomodule clk1s (
input CLOCK_50,
input reset,
output reg LED
);
localparam COUNTDOWN = 49999999;
reg count;
always @ (posedge CLOCK_50 or posedge reset)
if(reset) begin
count <= COUNTDOWN;
LED <= 1'b0;
end else begin
count <= count + {26{1'b1}}; // same as minus 1
if(!count) begin
count <= COUNTDOWN;
LED <= ~LED;
end
end
endmodule