Altera_Forum
Honored Contributor
16 years agoInteger used as parameter
Hi. I am using the cyclone II to on the 10 LED and 4 7segment for digital clock application.
The problem i faced are: 1. How to on the 10 LEDs(represent 0.1s)? 0.1s on 1 LED, 0,2s on 2 LEDs and continue. The verilog code i used is: for (i =1; i<11; i=i+1) LED[i-1:0] <=LED[i-1:0] ; if (i==11) i=0; (error: i is not constant and 5000 loops) Is there solution to solve this instead of using case statement(long coding)? 2. I have 2 clocks (1Hz for second and 10Hz for .1second). So, i use 2 always block. 1st always block(10Hz clock) calculate the .1s and update the second segment if .1s reach 10. if (a == 10) second_segment <= second_segment +1; 2nd always block second segment wil update the minit segment. if (second_segment>9) second segment ..... error: multiconstand driver Is there any way to solve this instead of combine 2 always block in one(use 10Hz clock) The problem is difficult to distribute the job equally if combined. Thanks a lot