I am new user try to run my simple test on Altera Max V eval kit. I wrote a simple code want to verify a simple function:
![]()
in file counter.v
When I push the reset button, the LED goes off, that proved clock trigger signal is correct, however, after I release the PB1, all LEDs still on and didn't change status(It suppose to light up and turn off while counter increasing).
Platform: Windows 7,64bit, Quartus Prime Lite Edition 16.0. MAX V Eval Board
Could anyone take a look what might be wrong with my program?
Thank you!
in file counter.v
Code:
module counter( CLOCK_10KHZ, counter_out, RESET);
input CLOCK_10KHZ;
input RESET;
output [15:0] counter_out;
reg [15:0] counter_out;
always @(posedge CLOCK_10KHZ) begin
if (!RESET) begin //Reset button is not pushed
counter_out <= #1 ~(counter_out + 1); //increment counter, neg light up the LED, and pos turn off
end
else begin
counter_out <= #1 ~16'b0;
end
end
endmodule
When I push the reset button, the LED goes off, that proved clock trigger signal is correct, however, after I release the PB1, all LEDs still on and didn't change status(It suppose to light up and turn off while counter increasing).
Platform: Windows 7,64bit, Quartus Prime Lite Edition 16.0. MAX V Eval Board
Could anyone take a look what might be wrong with my program?
Thank you!