Matrix input

#4111100
Rate this post
useful
not useful
You define your own type in a package, like
1
type uMatrixSType is array (3 downto 0) of unsigned(11 downto 0);
2
type uMatrixType  is array (3 downto 0) uMatrixSType;

This example would give a 4x4 Matrix of 12-bit unsigned values. 
Afterwards just us the type in your entity definition, like
1
entity MATRIXIN is
2
  port (
3
    ...
4
    MatrixxDI : in uMatrixType;
5
    ...
6
  );
7
end MATRIXIN;
Moderator (Company: Titel) #4111557
Rate this post
useful
not useful
Bahare Moradi wrote:
> after defining an input like this, how can we use it's elements.
> for exmaple can we write  MatrixxDI(1,2)?????????
Why not simply trying this yourself?

> what is the correct format?
Try that with Google translator. Its German:
http://www.lothar-miller.de/s9y/archives/39-Mehrdimensionale-Arrays.html
There can be seen two different ways to define a matrix.
The access to the matrix is also different an its shown in this two 
lines:
1
  output0 <= FeldA(cnthi)(cntlo);
2
  output1 <= FeldB(cnthi, cntlo);
Now: try yourself. Its not that difficult...
OP #4111816
Rate this post
useful
not useful
Thanks....
it works....
I used this :
A(1)(2)<="01010101";


_____________________________
I simulated a program containing 2D matrix in ISE.
But is it executable on board?
Can I use 2D matrix in my program which I want to transfer to my chip on 
the board?
I have heard that it is not possible and it is just for simulation

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now