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.
17268 Discussions

Store complex decimal values as 2D array in a rom in verilog

Altera_Forum
Honored Contributor II
3,269 Views

I need to perform convolution between 2 matrices in verilog : a 7x7 matrix that holds complex double values and a 72x300 matrix that stores double values. 

 

How should I store such a matrix in rom? Also creating 72x300 matrix involves storing large number of coefficients. 

 

I am not able to understand how to initialize them and use them to perform convolution. 

 

Please help!
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
2,076 Views

 

--- Quote Start ---  

I need to perform convolution between 2 matrices in verilog : a 7x7 matrix that holds complex double values and a 72x300 matrix that stores double values. 

 

How should I store such a matrix in rom? Also creating 72x300 matrix involves storing large number of coefficients. 

 

I am not able to understand how to initialize them and use them to perform convolution. 

 

Please help! 

--- Quote End ---  

 

 

Is there no solution ? Please help..
0 Kudos
Altera_Forum
Honored Contributor II
2,076 Views

What exactly are you having problems with? Have you even attempted to write any code?

0 Kudos
Altera_Forum
Honored Contributor II
2,076 Views

My query is how to build a matrix in verilog? without which how can i perform convolution?

0 Kudos
Altera_Forum
Honored Contributor II
2,076 Views

If you have a verilog or VHDL file opened in Quartus you can try inserting a ROM template that will drop in code that implements a ROM. If I remember correctly it's under "edit" --> "template"

0 Kudos
Altera_Forum
Honored Contributor II
2,076 Views

For a 72x300 matrix you could use a rom with 128 by 512 addresses (64k). The Upper 7 bit is your first axis, the lower 9 addresses is your second axis in this case. 

Depending on the data width this will be a big RAM, at least for a FPGA onchip Memory. 

 

Assuming that your double value has 64bit you need 512kByte. 

 

The 7 by 7 matrix needs 64 adresses with 128bit each: 

 

module array ( input x_i, input y_i, output re_o, output im_o ); reg array; initial begin array = {64'h00000000deadbeef, 64'h00000000affedead}; array = {64'h0000000000000000, 64'h0000000011111111}; array = {64'h0000000011111111, 64'h0000000022221111}; end assign re_o = array; assign im_o = array; endmodule  

 

Though i don't know your exact requirements i would recommend to use the Altera altsyncram with a initialization .mif File. And a big enough FPGA.
0 Kudos
Reply