VHDL Data TypesScalar Types (Cont.)
- Require associated units
- Range must be specified
- Example of physical type declaration :
- Time is the only physical type predefined in VHDL standard
TYPE resistance IS RANGE 0 TO 10000000
Kohm = 1000 ohm; -- i.e. 1 K?
Mohm = 1000 kohm; -- i.e. 1 M?
The physical data type is used for values which have associated units. The designer first declares the name and range of the data type and then specifies the units of the type. Notice there is no semicolon separating the end of the TYPE statement and the UNITS statement. The line after the UNITS line states the base unit of of the type. The units after the base unit statement may be in terms of the base unit or another already defined unit.
Note that VHDL is not case sensitive so Kohm and kohm refer to the same unit.
The only predefined physical type in VHDL is time.