21-06-2013, 02:37 PM
VHDL DATA TYPES
VHDL DATA.pptx (Size: 200.46 KB / Downloads: 22)
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.
A type is a name that has associated with it a set of values and a set of operations.
The language also provides the facility to define new types by using type declarations and also to define a set of operations on these types by writing functions that return values of this new type.
All the possible types that can exist in the language can be categorized into the following four major categories:
1. Scalar types: Values belonging to these types appear in a sequential order.
2. Composite types: These are composed of elements of a single type (an array type) or elements of different types (a record type).
3. Access types: These provide access to objects of a given type (via pointers).
4. File types: These provides access to objects that contain a sequence of values of a given type.
SUBTYPES
A subtype is a type with a constraint.
The constraint specifies the subset of values for the type.
The type is called the base type of the subtype.
An object is said to belong to a subtype if it is of the base type and if it satisfies the constraint.
Subtype declarations are used to declare subtypes.
An object can be declared to either belong to a type or to a subtype.
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 and the expression '0' < 1' is valid.
There are four different kinds of scalar types:
1. enumeration,
2. integer,
3. physical,
4. floating point.
Integer types, floating point types, and physical types are classified as numeric types since the values associated with these types are numeric.
Further, enumeration and integer types are called discrete types since these types have discrete values associated with them.
Composite Types
A composite type represents a collection of values.
There are two composite types: an array type and a record type.
An array type represents a collection of values all belonging to a single type
A record type represents a collection of values that may belong to same or different types.
An element of a composite type could have a value belonging to either a scalar type, a composite type, or an access type.
For example, a composite type may be defined to represent an array of an array of records.