Dear friends I want to write a program in ISE(vhdl) which has a matrix input(n-by-n). the program receives the matrix and does some operations on it. I don't know how to define this input in Entity Part? Can any one help me?
: Edited by User
You define your own type in a package, like
type uMatrixSType is array (3 downto 0) of unsigned(11 downto 0); 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
entity MATRIXIN is port ( ... MatrixxDI : in uMatrixType; ... ); end MATRIXIN;
: Edited by User
One should add in how one makes the package available for the code meaing how to include it to use
Verilogi wrote: > One should add in how one makes the package available for the code > meaing how to include it to use Sorry, this IMHO looks like basic knowledge one should acquire at or shortly after the first contact with VHDL. Anyway, it has been written down by many others, find your favourite among the hits: https://www.google.com/#q=vhdl+how+to+use+a+package
after defining an input like this, how can we use it's elements. for exmaple can we write MatrixxDI(1,2)????????? what is the correct format?
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:
output0 <= FeldA(cnthi)(cntlo); output1 <= FeldB(cnthi, cntlo);
Now: try yourself. Its not that difficult...
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
Try synthesizing it, you'll see... I've several of similar constructs in use, but I'm currently working with Quartus. However, I'd be surprised if it didn't work with ISE, too.