Altera_Forum
Honored Contributor
16 years agoverilog test code issue
file://localhost/C:/Documents%20and%20Settings/aabelian/Desktop/altera_sim.JPG Hi to all,
This is my first post. sorry if any thing I am doing wrong. I am new to verilog but I am long time C user. I tried my first code today. Using simulator I see delay on output side and clk pulse doesn't work. I am having hard time to understand what am I doing wrong. any help will appreciate. thanks Andre module led_test(sw1,led1,clk); input sw1; output led1; output clk; reg led1,led2,clk; // initial begin led1 <= 0; end always@(sw1 ) begin # 500 clk = ~clk; end always@(sw1 ) begin if(sw1 == 1) led1 <= 1; else led1 <= 0; end endmodule