Natural Arrays inside Records

Joined
Nov 30, 2009
Messages
1
Reaction score
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:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top