Identifiers Data Objects and Data Types
Identifiers Data Objects and Data Types
• Identifiers
• Data Objects
• Data Types
Identifiers
• There are two types of identifiers
1. Basic Identifiers :-
It composed of a sequence of one or more characters.
Upper case letter (A…Z), Lower case letter (a…z), a digit (0…9)
Ex. DRIVE_BUS SelectSignal RAM_Address
2. Extended Identifiers :-
It is a sequence of characters written between two
backslashes.
Ex. \TEST\
\-25\
Data Objects
• A data object holds a value of a specified type. It is created by
means of an object declaration.
Ex. variable COUNT: INTEGER;
1. Constant
2. Variable
3. Signal
4. File
Constant Declarations
Signal Declarations
• Example of signal declarations
• signal CLOCK: BIT;
• signal DATA_BUS: BIT_VECTOR(0 to 7);
• signal GATE_DELAY: TIME := 10 ns;
File Declaration
• A file is declare using a file declaration. The syntax of a file
declaration is :
Physical Types
• A physical type contains values that represent measurement of some
physical quantity, like time, length, voltage or current etc.
• For example
type CURRENT is range 0 to 1 E9
units nA; -- (base unit) nano-ampere
uA = 1000 nA; -- micro-ampere
Floating Point Types
• A floating point type has a set of values in a given range of real
numbers.
• Examples of floating point type
type TTL_VOLTAGE is range -5.5 to -1.4;
type TTL_VOLTAGE is range -5.5 to -1.4;
2. Composite types
• A composite type represents a collection of values.
• There are two composite types: Array type and a Record type.
1. Array type :-
An object of an array type consist of elements that have the same
type.
type ADDRESS_WORD is array (0 to 63) of BIT;
type DATA_WORD is array (7 downto 0) of MVL;
type ROM is array (0 to 125) of DATA_WORD;
Record Types
• An object of a record type is composed of elements of same or
different types. An example of a record type declaration is
• type PIN_TYPE is range 0 to 10;
type MODULE is
record
SIZE: INTEGER range 20 to 200;
CRITICAL_DLY: TIME;
NO_INPUTS:PIN TYPE;
NO_OUTPUT:PIN TYPE;
end record
3. Access Types
• Values belonging to an access type are pointers to a dynamically
allocated object of some other type. They are similar to pointers
in pascal and C languages.
• Examples of access type declarations are
--MODULE is a record type declared in the previous sub-section.
type PTR is access MODULE;
type FIFO is array (03, 0 to 7) of BIT;
type FIFO_PTR is access FIFO
4. File Types
• Objects of file types represent files in the host environment.
They provide a mechanism by which a VHDL design
communicates with the host environment.
• The syntax of a file type declaration is
type file-type-name is file of type-name