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 program a matrix 5*5 in VHDL ?

Status
Not open for further replies.

Mejdi_tn

Junior Member level 3
Joined
Oct 20, 2007
Messages
28
Helped
7
Reputation
14
Reaction score
6
Trophy points
1,283
Activity points
1,473
Hi
how to programm a Matrix 5*5 in VHDL
exemple for Martix in C

double Mat33[NBROWS][NBCOLS]=
{
{ 6*sqrt(2), 3*sqrt(5), 6 , 3*sqrt(5), 6*sqrt(2) } , // row no 0
{ 3*sqrt(5), 3*sqrt(2), 3 , 3*sqrt(2), 3*sqrt(5) } , // row no 1
{ 6 , 3 , 1 , 3 , 6 } , // row no 2
{ 3*sqrt(5), 3*sqrt(2), 3 , 3*sqrt(2), 3*sqrt(5) } , // row no 3
{ 6*sqrt(2), 3*sqrt(5), 6 , 3*sqrt(5), 6*sqrt(2) } // row no 4
};
thing you
 

Old Nick

Advanced Member level 1
Joined
Sep 14, 2007
Messages
480
Helped
68
Reputation
136
Reaction score
18
Trophy points
1,298
Activity points
4,243
matrix vhdl

Why not just use a dual port ram block or similar (it doesn't really need to be dual port, but it depends how you want to access it!)?
 

Iouri

Advanced Member level 2
Joined
Aug 17, 2005
Messages
682
Helped
87
Reputation
174
Reaction score
8
Trophy points
1,298
Activity points
4,814
matrix multiplication vhdl

it is really depends what you are trying to do, you can use RAM modules or registers will take a lot's of logic resources
 

Joined
Sep 3, 2007
Messages
853
Helped
66
Reputation
132
Reaction score
16
Trophy points
1,298
Activity points
0
matrix multiplication in vhdl

Old Nick said:
Why not just use a dual port ram block or similar (it doesn't really need to be dual port, but it depends how you want to access it!)?

Hi all,

Could you please elaborate and explain how ?
Thanks Old Nick for the idea.
 

Old Nick

Advanced Member level 1
Joined
Sep 14, 2007
Messages
480
Helped
68
Reputation
136
Reaction score
18
Trophy points
1,298
Activity points
4,243
matrix in vhdl

what is the target, Xilinx - Altera?

I am assuming you understand haw RAM can be viewed as a matrix, elements in memory are the same as elements in an array.

Xilinx has a coregen module you can use for dual port, or if it's a small array you can just program it yourself to save space.
 

honnaraj.t

Member level 2
Joined
Aug 3, 2007
Messages
48
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,725
opengl vhdl

hi nick,
i am implementing opengl on FPGA.... in my project i need to do lots of matrix multiplication ........please send me some material to do matrix multiplication in VHDL........

plase reply to my mail add........... honnaraj.t@gmail.com

regards
honnaraj
 

atena

Full Member level 1
Joined
Feb 22, 2007
Messages
97
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,288
Activity points
1,896
vhdl code for matrix multiplier

honnaraj.t said:
hi nick,
i am implementing opengl on FPGA.... in my project i need to do lots of matrix multiplication ........please send me some material to do matrix multiplication in VHDL........

plase reply to my mail add........... honnaraj.t(at)gmail.com

regards
honnaraj

Dont try to synthesize and implement floating point with VHDL and FPGA without internal built floating-point processor. The technique of entering the matrix in VHDL is very simple but i dont think you can use those math function like sqrt here....
 

honnaraj.t

Member level 2
Joined
Aug 3, 2007
Messages
48
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,725
vhdl matrix operations

hi,
please can you elobrate your idea........ if you have any supporting material please help me................thnks in advance
 

sameem_shabbir

Advanced Member level 4
Joined
Jan 5, 2008
Messages
104
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
Pakistan
Activity points
1,946
vhdl coding for matrix multiplication

Matrix multiplication
I have seen its code available at Xilinx site.
Hope that is going to be helpful to you
 

smqasim

Newbie level 6
Joined
Jun 20, 2004
Messages
11
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
103
matriz vhdl

Use a systolic array for Matrix multiplication. Systolic array is best suited for matrix operations implemented in hardware. The systolic array consists of identical processing elements. Each processing element does a multiply accumulate operation and passes the data to the preceding element for further processing.

Added after 6 minutes:

Another technique is to use internal memory (BRAM) of FPGA for storing the input and output matrices. Design a controller that takes the input from the memory, does the multiply and accumulate operation and finally stores the result in memory.
 

rourabpaul

Member level 3
Joined
Aug 14, 2010
Messages
67
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
kolkata
Activity points
1,747
Re: Matrix in VHDL

i never use array in vhdl code,
i want to make a matrix multiplication using array,
in that case how can i decalare array in port,
pls help

---------- Post added at 08:16 ---------- Previous post was at 08:11 ----------

i never use array in vhdl code,
i want to make a matrix multiplication using array,
in that case how can i decalare array in port,
pls help

---------- Post added at 08:21 ---------- Previous post was at 08:16 ----------

i never use array in vhdl code,
i want to make a matrix multiplication using array,
in that case how can i decalare array in port,
pls help
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,065
Helped
2,077
Reputation
4,171
Reaction score
2,030
Trophy points
1,393
Activity points
39,119
Re: Matrix in VHDL

you need to declare the array type in a package, then you can use it on a port:

Code:
library ieee;
use ieee.numeric_std.all;

package type_pkg is
  type my_array_t is array(0 to 7) of unsigned(7 downto 0);
end package type_pkg;

use work.type_pkg.all;

entity matrix_mult is
port (
  .....
  input : my_array_t;
);

end entity matrix_mult;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top