P
Pears772
Guest
Dear Dr VHDL
I am a newbie struggling with an exercise to write a parameterised model
of a PCB containg memory ICs.
The answer (yes I peeked at the book but I wish I hadn't) contains this code
fragment -
subtype word is std_logic_vector(wordsize-1 downto 0) ;
type mem is array(0 to 2**addresssize-1) of word ;
variable memory: mem := (others=>word'(others=>'U')) ;
Why does the above define a type from a subtype ?
Is this cos VHDL doesn't allow subtypes of subtypes ?
And more important -
What does line 3 mean by (others=>word'(others=>'U')) ?.
I understand stuff like (others=> 'U') but what sort
of ?attribute of word is word'(others=>'U'))
thanx John.
I am a newbie struggling with an exercise to write a parameterised model
of a PCB containg memory ICs.
The answer (yes I peeked at the book but I wish I hadn't) contains this code
fragment -
subtype word is std_logic_vector(wordsize-1 downto 0) ;
type mem is array(0 to 2**addresssize-1) of word ;
variable memory: mem := (others=>word'(others=>'U')) ;
Why does the above define a type from a subtype ?
Is this cos VHDL doesn't allow subtypes of subtypes ?
And more important -
What does line 3 mean by (others=>word'(others=>'U')) ?.
I understand stuff like (others=> 'U') but what sort
of ?attribute of word is word'(others=>'U'))
thanx John.