Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > array problems

Reply
Thread Tools

array problems

 
 
Matt North
Guest
Posts: n/a
 
      09-09-2004
Hi,

I have an array:

variable ram: array_t;

where:

type array_t is array (0 to 127, 0 to 127) of std_logic;

i now need to load an address of ram:

ram(to_integer(addr)) := data;

How do i get 'data' to be of a type that matches 'array_t',
std_logic_vector(0 to 127) or unsigned(0 to 127) does not work.

i cant change array_t to:

type array_t is array (0 to 127) of std_logic_vector(0 to 127);

because i need to index the array in the following form:

result(y,x):=ram(x,y);

Thanks,
Matt


 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      09-09-2004
"Matt North" wrote

> I have an array:
> variable ram: array_t;
> where:
> type array_t is array (0 to 127, 0 to 127) of std_logic;


That's a 128 by 128 block of bits.
Draw it on graph paper and mark
the data words and assign each a "ram" address.
There is more than one way to do this.

> because i need to index the array in the following form:
> result(y,x):=ram(x,y);


That's an assignment of a single bit.
Maybe that's not what you really want.

-- Mike Treseler
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
const and array of array (of array ...) Mara Guida C Programming 3 09-03-2009 07:54 AM
length of an array in a struct in an array of structs in a struct in an array of structs Tuan Bui Perl Misc 14 07-29-2005 02:39 PM
Length of Array of Array of Array Tom Perl Misc 3 12-20-2004 05:23 PM
How to combine 2 int Array into ONE int Array ? S300 Java 4 08-19-2003 07:04 PM
hashed array in array need the keys... and length Daniel Perl 1 08-14-2003 06:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57