Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17267 Discussions

How to implement two-dimensional array using HDL?

Altera_Forum
Honored Contributor II
2,129 Views

I need to creat many tables in FPGA, and these tables are used to store two-dimensional array data. 

 

For example, when I get (x,y) value and then find the coordinate according this (x,y) value. 

 

These table also can be updated, so they must be strore in "RAM" (not in "ROM"). 

 

But I found some comments about the two-dimensional array, which said that two-dimensional array is just used on simulation, for two-dimensional array couldn't be synthesized to circuit. If so, how to implement my application in my FPGA? Does ALTERA have some functions (or mega core) like this?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,371 Views

A 2-D array (N,M) can be simply mapped to a 1-D array (N*M). If N and M are both powers of two, just concatenate the address vectors. In so far, no special functions are needed.

0 Kudos
Altera_Forum
Honored Contributor II
1,371 Views

 

--- Quote Start ---  

A 2-D array (N,M) can be simply mapped to a 1-D array (N*M). If N and M are both powers of two, just concatenate the address vectors. In so far, no special functions are needed. 

--- Quote End ---  

 

 

Dear FvM: 

 

Good idea! 

 

But i have another question. For my application, the N=M=9, the QII can only implement memory which depth is below 65536. It seems that i shouldn't merge samll memorys to a big one, for i must find my result according N&M's value.:cry:
0 Kudos
Altera_Forum
Honored Contributor II
1,371 Views

why cant you round N and M up to 16? then you can use sensible addressing and concatenate N and M?

0 Kudos
Reply