Altera_Forum
Honored Contributor
17 years agoFIFO size
I want to generate a FIFO that is not 2^n in size. So, I can't use the MegaWizard. What are my options? Using Cyclone III.
Build two FIFOs, one that is asynchronous and131,072, and once you've crossed clock domains, a smaller one that tops off the depth you need. A little more latency through, but pretty easy.
(Asynchronous FIFOs use gray coding to compare pointers, which are only off by one digit, even at the rollover point. If you arbitrarily had the counters rollover at some point that is not a power of 2, then you would have a transition where many bits are changing, potentially causing errors. So there's some technical reason why it doesn't allow that. Synchronous FIFOs could allow for any size technically, just the megawizard wasn't designed to do that.)