Forum Discussion
Altera_Forum
Honored Contributor
15 years agoWithout the schematic top entity, the intention of the design actually can't be understood.
In my understanding, you have two, loosely related objectives: - Design a two-digit BCD counter - make it switch a led on count 31 You have tried to solve it by separate counters, and curiously placed an additional binary counter into a BCD digit counter. That's really arbitrary, but not impossible of course. I don't want to support this crude coding style however and would suggest to connect the compare to the BCD counter output, so you have only one counter. The BCD counter upper digit is wired incorrectly. You are operating it as a ripple carry counter, if so, the upper digit must be clocked on the falling edge. But a ripple carry counter is bad coding style anyway. To make it a synchronous counter, you have to add carry in- and outputs. You can consult the LPM_COUNTER MegaFunction as a reference.