imarz1
New Contributor
7 years agoI have simple code question
Hi:
I am very beginner. I wrote very simple code for DE10-Nano board to turn on one LED, but it is not working. Maybe someone could help:
module LED (
CLK_50,
LED1
);
input CLK_50;
output reg LED1;
integer counter=0;
always @*
begin
//LED1 <= 0;
counter <= counter + 1;
if(counter == 200000)
begin
LED1 <= 1;
//counter <= 0;
end
if(counter == 400000)
begin
LED1 <= 0;
counter <= 0;
end
end
endmodule
*******************************
After programming, LED1 never ever turn ON. I tried many different values in Counter, and still nothing.
My understanding is that when Counter is between 200000 - 400000, then LED1 will turn ON.
Thanks in advance.