Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matrix Vector

Status
Not open for further replies.

petetepeke

Technical User
Joined
Sep 4, 2004
Messages
1
Location
ES
Hi.
I want to assign the first row of a matrix to a vector of the same type.How can i do it?
....
TYPE matrix is array (integer range<>,integer range<>) of integer
TYPE vector is array (integer range<>) of integer;
....
a: matrix(0 TO 10,0 TO 10);
b: vector(0 TO 10);
....
--I've considered this instruction but compile error
vector <= a(0,0 TO 10);

How can i do that???I need that to make GENERATE instruction to multiply these....THANKS
 
You could just use generate to that to. simply a for-generate loop would do that. (I hope I have understood what your problem is.)
 
well first of all

vector <=a(0,0 TO 10)

won't work, as vector is a type, not a signal in your design. Try

b <= a(0,0 TO 10)

yeah, and you are probably wanting a for-generate loops.. something like

for i in 0 to 10 generate
b(i) <= a(0,i);
end generate;

That should work. I personally feel more comfortable using bit vectors then integers. The way you are declaring your integers you could be taking up a LOT of space on your chip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top