Natural Arrays inside Records

Discussion in 'VHDL' started by mach7, Nov 30, 2009.

  1. mach7

    mach7

    Joined:
    Nov 30, 2009
    Messages:
    1
    Likes Received:
    0
    I'm new to VHDL, so I might not get all the terminology correct, but I want to create a record that contains unconstrained arrays. In particular, I want to do something like

    Code (Text):

    type complex is record (natural range <A>)
        re, im : signed (<A>);
    end record;
     
    but of course this is invalid syntax. What I'm trying to avoid is having to create multiple types, e.g.

    Code (Text):

    type complex8 is record
        re, im : signed (7 downto 0);
    end record;

    type complex16 is record
        re, im : signed (15 downto 0);
    end record;
     
    Instead, I want to be able to say

    Code (Text):

    signal x1, x2 : complex(7 downto 0);
    signal x3, x4 : complex(15 downto 0);
     
    Any ideas?

    Thanks,
    -J
     
    mach7, Nov 30, 2009
    #1
    1. Advertisements

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. Luke Airig
    Replies:
    0
    Views:
    1,005
    Luke Airig
    Dec 31, 2003
  2. a1_nocrap_exh@hotmail.com

    Assigning elements in Arrays of records

    a1_nocrap_exh@hotmail.com, Sep 11, 2006, in forum: VHDL
    Replies:
    4
    Views:
    857
  3. wallge
    Replies:
    7
    Views:
    693
  4. Philipp
    Replies:
    21
    Views:
    1,534
    Philipp
    Jan 20, 2009
  5. mostafa.elhoushi

    Matrix of Records of Arrays

    mostafa.elhoushi, Feb 12, 2011, in forum: VHDL
    Replies:
    1
    Views:
    1,149
    mostafa.elhoushi
    Feb 12, 2011
  6. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    671
    Ray at
    May 10, 2004
  7. masg0013@gmail.com
    Replies:
    3
    Views:
    932
    Anthony Jones
    Nov 2, 2006
  8. Christopher Campbell

    Tuples/Records/Quicky Objects + Read Only Arrays?

    Christopher Campbell, Jan 1, 2006, in forum: Ruby
    Replies:
    6
    Views:
    258
    Christopher Campbell
    Jan 1, 2006
Loading...