Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20745 Discussions

FIFO or 2-Port RAM

Altera_Forum
Honored Contributor II
2,221 Views

First I wanted to use a 2-Port RAM to synchronize two clock domains 96MHz <--> 24MHz until I found the FIFO megafunction. The FIFO has the advantage for me that I don't have to control the address bus, means less switching noise and I don't need a gray counter. 

Is this true that both megafunctions support simultaneous read and write access to memory cells? 

My question is now: Whats the disadvantage to use the FIFO or 2-Port RAM and whats the benefit? 

Thanks!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,220 Views

An advantage of a dual-clock FIFO megafunction is that it provides the logic necessary to handle write and read clocks that are asynchronous to each other. The FIFO is simpler to use, and the work of handling the domain crossing safely has already been done for you. 

 

An advantage of a simple 2-port RAM with your own logic is that you might be able to create a more efficient implementation than the FIFO megafunction. 

 

Either megafunction will let you write one address at the same time that another address is being read.
0 Kudos
Altera_Forum
Honored Contributor II
1,220 Views

The FIFO can only be used for streams to compense various read and write speeds. Depending on your app, you may want to read several pieces of information more than once (while it had been written only once) or want a read out data order different from the order, the data appears.

0 Kudos
Reply