Natural Arrays inside Records

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

  1. mach7

    mach7

    Joined:
    Nov 30, 2009
    Messages:
    1
    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:
    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:
    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:
    signal x1, x2 : complex(7 downto 0);
    signal x3, x4 : complex(15 downto 0);
    
    Any ideas?

    Thanks,
    -J
    mach7, Nov 30, 2009
    #1
    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. Luke Airig
    Replies:
    0
    Views:
    788
    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:
    686
  3. Philipp
    Replies:
    21
    Views:
    1,127
    Philipp
    Jan 20, 2009
  4. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    461
    Ray at
    May 10, 2004
  5. masg0013@gmail.com
    Replies:
    3
    Views:
    657
    Anthony Jones
    Nov 2, 2006
Loading...

Share This Page