Always block executes every time
I've been having problem just figuring out this simple code. module diode (switch, led); output led; input switch; reg led; always @* begin led = 1'b0; end endmodule The logic behind it is as follow = press the button, the LED turns on? The problem I am facing is this always block. The way it's supposed to work is that whenever there's a change in switch (the button that I press), the LED should turn on? But the LED turns on automatically all the time entering this always block even if I don't press anything. The only way to 'solve' this is if I put an if/else statement in always block so that
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.