array problems

Discussion in 'VHDL' started by Matt North, Sep 9, 2004.

  1. Matt North

    Matt North Guest

    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
    Matt North, Sep 9, 2004
    #1
    1. Advertising

  2. "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
    Mike Treseler, Sep 9, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Susan Baker
    Replies:
    2
    Views:
    796
    kelvSYC
    Jun 26, 2005
  2. Shelly

    Problems, problems for newbie

    Shelly, Sep 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,119
    Shelly
    Sep 3, 2007
  3. Mara Guida

    const and array of array (of array ...)

    Mara Guida, Sep 2, 2009, in forum: C Programming
    Replies:
    3
    Views:
    463
    David RF
    Sep 3, 2009
  4. Tom
    Replies:
    3
    Views:
    187
    salsablr
    Dec 20, 2004
  5. Tuan  Bui
    Replies:
    14
    Views:
    451
    it_says_BALLS_on_your forehead
    Jul 29, 2005
Loading...

Share This Page