440 Appendix B: VHDL Reference Tables
Table B-2
Attribute Explanation Examples
T’BASE Returns the base type of NATURAL’BASE returns
datatype it is attached to INTEGER
T’LEFT Returns left value specified in INTEGER’LEFT is -2147483647
type declaration BIT’LEFT is ‘ 0 ’
T’RIGHT Returns right value specified INTEGER’RIGHT is 2147483647
in type declaration BIT’RIGHT is ‘ 1 ’
T’HIGH Returns largest value specified TYPE bit8 is 255 downto 0
in declaration bit8’HIGH is 255
T’LOW Returns smallest value TYPE bit8 is 255 downto 0
specified in declaration bit8’LOW is 0
T’POS(X) Returns position number of TYPE color IS (red, green,
argument in type (first blue, orange);
position is 0) color’POS(green) is 1
T’VAL(X) Returns value in type at TYPE color IS (red, green,
specified position number blue, orange);
color’VAL(2) is blue
T’SUCC(X) Returns the successor to the TYPE color IS (red,
value passed in green, blue, orange);
color’SUCC(green) is
blue
T’PRED(X) Returns the predecessor to TYPE color IS (red, green,
the value passed in blue, orange);
color’PRED(blue) is green
T’LEFTOF(X) Returns the value to the left TYPE color IS (red, green,
of the value passed in blue, orange);
color’LEFTOF(green) is
red
T’RIGHTOF(X) Returns the value to the right TYPE color IS (red, green,
of the value passed in blue, orange);
color’RIGHTOF(blue) is
orange
Table B-3 lists all predefined attributes that return information about
array datatypes. The Nparameter for all attributes specifies to which par-
ticular range the attribute is being applied. This only makes sense for
multidimensional arrays. For single-dimensional arrays, the parameter
can be ignored. For more detailed information, see Chapter 6,“Predefined
Attributes.”