Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to store a matrix in a ROM in VHDL?

Status
Not open for further replies.

lgdly

Newbie level 3
Joined
Feb 16, 2017
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
41
Hello, I am using an asynchronous-read ROM, to store a matrix.

It has to be parametrizable, so the columns and rows have to be defined by generics.

I was wondering how I can store something of a different type in each address. I have only previously stored a binary number at each address in the ROM.

However now, I would like to store an actual matrix at each address.

The matrix will have H Rows by M Columns.

Thanks
 

What FPGA allows asynchronous read access to a memory, I can't think of any part that allows that. Xilinx, Altera, Microsemi, Lattice memories all have synchronous memory, i.e. the memory has a clock input.

If you want to store a 16x8 matrix you organize the memory index by making say bits 2 downto 0 of the address the column (8 columns) and the row would be 6 downto 3 for 16 rows. If you have something non-binary then you'll have to deal with modulo addressing.
e.g. for a 4x3 matrix
mem(0) = M(0,0)
mem(1) = M(0,1)
mem(2) = M(0,2) <<<< mod 3
mem(3) = M(1,0)
...
mem(10) = M(4,2)
mem(11) = M(4,3)
It might be easier to avoid that and just store it with a 4x4 arrangement throwing away the mem(#,3) locations.
 

What FPGA allows asynchronous read access to a memory, I can't think of any part that allows that. Xilinx, Altera, Microsemi, Lattice memories all have synchronous memory, i.e. the memory has a clock input.

It's not going to be synthezised, only simulated.

And thank you for your suggestion that's how I will implement it.
 

It's not going to be synthezised, only simulated.

And thank you for your suggestion that's how I will implement it.

If it's not going to be synthesised, why bother with a ram at all? just use a 2D array.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top