Array initialisation - general questions

Discussion in 'VHDL' started by muppet, Feb 10, 2009.

  1. muppet

    muppet

    Joined:
    Feb 10, 2009
    Messages:
    2
    Hi,

    I was wondering if anyone could help as i'm new to VHDL.

    I would like to create an array of size (256 * 24)
    That is 256 row elements, with each element 24 bits wide.

    0. [<-24 bits ->]
    1. [<-24 bits ->]
    .....
    255. [<-24 bits ->]

    Is an array of this size possible?

    I'm assuming this syntax would create the array called 'x'???:

    TYPE array1 IS ARRAY (0 TO 255) OF STD_LOGIC_VECTOR (23 DOWNTO 0);
    SIGNAL x: array1;

    Now how would I go about assigning 24 bit values to individual elements?
    Is there a function I could use? Or would I have to declare each elements' value explicitly - like x(0) = "111111111111111111111111" ?

    Also, how could I assign a 24 bit element of the array to a vector?

    Would this do it?:

    signal y: std_logic_vector (23 DOWNTO 0);
    y <= x(0);

    Regards,

    AM
     
    muppet, Feb 10, 2009
    #1
    1. Advertising

  2. muppet

    muppet

    Joined:
    Feb 10, 2009
    Messages:
    2
    bump:flute:
     
    muppet, Feb 11, 2009
    #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. Danny

    Array initialisation

    Danny, Aug 4, 2003, in forum: C++
    Replies:
    16
    Views:
    748
    Web Developer
    Aug 6, 2003
  2. Koster

    Array initialisation

    Koster, Sep 6, 2003, in forum: C Programming
    Replies:
    4
    Views:
    506
    Joe Wright
    Sep 8, 2003
  3. Michael

    Define and array initialisation

    Michael, Jul 7, 2004, in forum: C Programming
    Replies:
    7
    Views:
    317
    Michael
    Jul 7, 2004
  4. Tim Clacy
    Replies:
    8
    Views:
    414
    Tim Clacy
    May 30, 2006
  5. Olaf P.

    Array of Array Initialisation

    Olaf P., Apr 24, 2007, in forum: C Programming
    Replies:
    2
    Views:
    329
    Duncan Muirhead
    Apr 24, 2007
Loading...

Share This Page