array problems

M

Matt North

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
 
M

Mike Treseler

"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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top