Creating a new type for STD_LOGIC_VECTOR

Discussion in 'VHDL' started by Kwaj, May 4, 2004.

  1. Kwaj

    Kwaj Guest

    I would like to create a new type, bit32word, which would be a 16bit
    std_logic_vector. I tried the following,

    type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);

    which didn't seem to work. Any ideas??

    - Kwaj
     
    Kwaj, May 4, 2004
    #1
    1. Advertising

  2. Kwaj

    Steffen Netz Guest

    Hello Kwaj,

    that the typical case for an subtype:
    SUBTYPE bit32word IS std_logic_vector(31 DOWNTO 0);
    SIGNAL rega : bit32word := (OTHERS=>'0');

    You can even get an array of this by the array type:
    TYPE romarray IS ARRAY (integer RANGE <>) OF bit32word;
    SIGNAL rom_mem : romarray(255 downto 0);

    regards,

    Steffen

    Kwaj wrote:
    > I would like to create a new type, bit32word, which would be a 16bit
    > std_logic_vector. I tried the following,
    >
    > type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);
    >
    > which didn't seem to work. Any ideas??
    >
    > - Kwaj
    >
    >




    --
    -----------------------------------------------------------------------------
    | Fraunhofer Institut Photonische Microsysteme |
    | |
    | Fraunhofer Institute for Photonic Microsystems ( Germany ) |
    | |
    | Steffen Netz | phone : ( +49 ) (0)351/8823-212 |
    | Grenzstrasse 28 | fax : ( +49 ) (0)351/8823-266 |
    | 01109 Dresden | email : |
    -----------------------------------------------------------------------------
     
    Steffen Netz, May 4, 2004
    #2
    1. Advertising

  3. Kwaj

    Riyaz Guest

    Try using subtype instead of type

    "Kwaj" <> wrote in message
    news:c77b9b$qh2$...
    > I would like to create a new type, bit32word, which would be a 16bit
    > std_logic_vector. I tried the following,
    >
    > type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);
    >
    > which didn't seem to work. Any ideas??
    >
    > - Kwaj
    >
    >
     
    Riyaz, May 5, 2004
    #3
  4. Kwaj

    Lee Guest

    Hi,

    This is array type that has different syntax with scalar type.

    type bit32word is array (31 DOWNTO 0) of STD_LOGIC_VECTOR;

    Try it to see if it works.

    Regards,

    "Riyaz" <> wrote in message news:<c7ae4n$rhv$>...
    > Try using subtype instead of type
    >
    > "Kwaj" <> wrote in message
    > news:c77b9b$qh2$...
    > > I would like to create a new type, bit32word, which would be a 16bit
    > > std_logic_vector. I tried the following,
    > >
    > > type bit32word is STD_LOGIC_VECTOR(31 DOWNTO 0);
    > >
    > > which didn't seem to work. Any ideas??
    > >
    > > - Kwaj
    > >
    > >
     
    Lee, May 6, 2004
    #4
    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. Ben Nguyen
    Replies:
    6
    Views:
    18,891
  2. Replies:
    6
    Views:
    4,358
    Douglas Sykora
    Feb 11, 2005
  3. jing
    Replies:
    1
    Views:
    4,420
    Mike Treseler
    May 17, 2006
  4. Govinda
    Replies:
    0
    Views:
    573
    Govinda
    Aug 2, 2007
  5. Thomas Rouam
    Replies:
    6
    Views:
    1,150
Loading...

Share This Page