Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

FIFO or 2-Port RAM

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!

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.