VHDL Data TypesComposite Types (Cont.)
Example one-dimensional array using DOWNTO :
DOWNTO keyword must be used if leftmost index is greater than rightmost index
- e.g. ‘Big-Endian’ bit ordering
TYPE reg_type IS ARRAY(15 DOWNTO 0) OF BIT;
Y := X(4); -- Y gets value of element at index 4
Notes:
This example illustrates the use the DOWNTO designator in the range specification of the array. DOWNTO specifies a descending order in array indices so that in the example above, X(4) refers to the fifth element from the right in the array (with 0 being the index for the element furthest to the right in this case).