Forum Discussion
19 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- This code is loop from 0 - 99. --- Quote End --- Can't be seen from the code. --- Quote Start --- The led will turn on from 30 - 39 --- Quote End --- Not true for the shown code. - Altera_Forum
Honored Contributor
----------Code Removed----------
- Altera_Forum
Honored Contributor
The block diagram is not attached
- Altera_Forum
Honored Contributor
----------Code Removed----------
- Altera_Forum
Honored Contributor
----------Code Removed----------
- Altera_Forum
Honored Contributor
Isn't it easyer to put the 2 BCD counters in one process? Or in one VHDL file.
your code seems right to me except u don't reset count_counter it will count to 255 in stead of 31. Or u can make signal count_counter: unsigned(4 downto 0); If count is 31 next will be 0 Why it remains high for 31 till 39? Don't know the code seems right. No time to test it on a testbench srry - Altera_Forum
Honored Contributor
----------Code Removed----------
- Altera_Forum
Honored Contributor
You are using the push button for clk ?
Is the led hanging on the most significant BCD (counts 10 , 20 , 30 , ...) or the least significant BCD (counts 1 , 2 , 3 , ... , 9) ? in this case (every 31 counts) u need to hang it on the least significnat BCD (in your image the lower one). In the other one LED will be left open. What happens is : The lower one counts every time u push the button. When it reaches 9 the uppen one goes one up. So the upper one counts every 10 times. If u place "if (count_counter=2) then ... " in the upper one, it will remain high for 10 times or from 20 to 29. - Altera_Forum
Honored Contributor
--------- Code Removed -------
- Altera_Forum
Honored Contributor
I don't understand your meanings.
U are already using the component BCD_counter 2 times. 1 time to count from 0 to 9 (0 , 1 , 2 , 3 , ...) 1 time to count from 0 to 90 (0 , 10 , 20 ,30 , ...) Does that works ? If so -> than look for LED = 31 to blink.