Altera_Forum
Honored Contributor
11 years agoSyncronous counter generating rippled outputs
This thing is driving me crazy. I have been trying to make a synchronous 16 bit divide-by-N counter with schematic entry. I got the logical part working. Two different designs. Both seem to be compiling into the same code.
Here is the problem.... When I run the timing simulator, I am seeing Asynchronous output. I've seen cleaner output on plain ripple counters. On the first Dff, the output is 9ns after the clock. Because its synchronous, the clock is fed directly to all 16 Dff's. OK, that wouldn't be so bad if the outputs were even, but they are not. The delay between the clock and the output randomly ranges between 5 and 9ns. On these compiles, the difference wasn't enough of a setup and hold (I'm guessing) that the terminal count logic could pick up on it and output spurious counts, but that could change with the next compile. The other thing is that the count seems to be true in spite of the jagged output. My circuit: Its just a string of 16 D flip flops all fed by the same master clock. The D input on the flip flops are fed by the appropriate look-behind circuitry. Since there is nothing between the output of the FF and the pin, the outputs should all change at exactly the same time, but they don't. The terminal count output is generated when all of the FF's are 0. Then that is fed back to the load input. The load input loads the divisor and and the down counting continues back to 0 where the process recycles. Could clock fan out be an issue here?