Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16606 Discussions

Quartus Prime 16.1 Lite compilation issue

Altera_Forum
Honored Contributor II
1,391 Views

Hi All, 

 

I met a problem that my software cannot generate an 500ms counter, see my code and picture, can you help me? 

 

https://alteraforum.com/forum/attachment.php?attachmentid=13466&stc=1  

 

/********************Test01*********************** Project Name: Test01; Function: Just test my FPGA board Version: 0.1 Editor: Vincent Li Date: 2017-04-03 clk=50MHz *************************************************/ module test01( clk, nRST, LED ); input clk,nRST; output LED; parameter T500MS = 25'd24_999_999; reg rLED; reg Count; always@(posedge clk or negedge nRST) if(!nRST) Count <= 25'd0; else Count <= Count + 1'b1; always@(posedge clk or negedge nRST) if(!nRST) rLED <= 4'd1; else if(T500MS==25'd24_999_999) rLED <= {rLED,rLED}; assign LED = rLED; endmodule
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
514 Views

Here is the problem: 

 

else if(T500MS==25'd24_999_999) 

 

This is always true - I think you meant count?
0 Kudos
Altera_Forum
Honored Contributor II
514 Views

Hi Tricky, 

 

thank you for your reply, yes you are correct...I had corrected this morning and it works. 

 

Br
0 Kudos
Reply