0% found this document useful (0 votes)
27 views

Identifiers Data Objects and Data Types

Uploaded by

patilojas16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Identifiers Data Objects and Data Types

Uploaded by

patilojas16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Content

• 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

• An object of constant class can hold a single value of a given type.


• This value is assigned to the object before simulation starts and the
value cannot be changed during the course of the simulation.
• Examples of constant declarations are
constant RISE_TIME: TIME := 10ns;
constant BUS_WIDTH: INTEGER := 8:
Variable Declarations
Variable Declarations Examples of variable declarations are

• variable CTRL_STATUS: BIT_VECTOR(10 downto 0);


• variable SUM: INTEGER range 0 to 100 ;
• variable FOUND DONE: BOOLEAN;

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 :

file file-names:file type-name[[open mode]is string-


expression];
• The string expression is interpreted by the host environment
as the physical name of a file.
Data Types
• Every data object in VHDL can hold a value that belongs to a
set of values.
• This set of values is specified by using a type declaration.
• There are some types of data type is given below

1. Scalar types : Values belonging to these types appear in


sequential order.
2. Composite types : These are composed of elements of a single
type (an array) or elements of different types (a record type)
3. Access types : These provide access to objects of a given type
(via pointer)
4. File types : These provide access to objects that contain a
sequence of values of a given type.
1. Scalar Types
• The values belonging to this type are ordered, that is,
relational operators can be used on these values.
• For example, BIT is a scalar type. There are four
different kinds of scalar types.
1. Enumeration
2. Integer
3. Physical
4. Floating point
Enumeration Types
• An Enumeration type declaration defines a type that has a set of user-
defined values consisting of identifiers and character literals.
• Examples are
Type MVL is ('U','0','1','Z);
type MICRO_OP is (LOAD, STORE, ADD, SUB, MUL, DIV);
subtype ARITH_OP is MICRO_OP range ADD to DIV;
Integer Types
• An integer type defines a type whose set of values fall within a
specified integer range.
• Examples of integer type declarations are
type INDEX is range 0 to 15;
type WORD_LENGHT is range 31 downto 0;

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

• A file is declared using a file declaration. The syntax of a file


declaration is:

file file-name: file-type-name is mode string-expression ;

You might also like