View Single Post
  #11 (permalink)  
Old 03-01-2006, 05:58 AM
Ulf Samuelsson
Posts: n/a
Default Re: How do I make dual-port RAM from single port RAM?

"Frank @ CN" <[email protected]> skrev i meddelandet
news:[email protected]
> Hi, there:
> In my application, a RAM needs to be written/read from two sets of
> data/address ports
> simultaneously. However, in the ASIC library I can only instantiate some
> single port RAM
> and RAM which can be written in one port and read from the other port.
> How shall I solve this problem?
> Thank you.

You can instantiate FOUR rams and implement a valid bit for each location in
a register.
PortA can write to RAM0,RAM1 and read from RAM0 and RAM2
PortB can write to RAM2,RAM3 and read from RAM1 and RAM3

When PortA writes to address position 17, both RAM0[17] and RAM1[17] are
updated and the
VALID_BIT[17] is set to 0 indicating that RAM0,1 are valid instead of

When PortB reads address position 17, both RAM1 and RAM3 are read.
A multiplexer on the output is controlled by the selected VALID_BIT,
and since VALID_BIT[17] is zero, it will select the output of RAM1 over

Obviously this is going to use some gates,so it is not practical for large
Running the RAM at 2 x frequency is going to cost a lot less.

Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may bot be shared by my employer Atmel Nordic AB

Reply With Quote