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

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.