SLIDE 1
EE 721: Types and Functions in VHDL
September 9, 2009
1 Overview
VHDL views the system being described as a network of signals and drivers. The signals carry values and the drivers use existing signal values to compute new values for signals. All this requires the notion of the type of a particular signal value, and the notion of functions and operators for computations on
- values. VHDL offers a user complete flexibility in defining types and functions
which operate on these types. In particular, VHDL is a strongly typed language: it forces the user to ensure that a function is called on values corresponding to the types it expects.
2 Types
In VHDL, a type is an ordered and finite set of values. Depending on the form
- f the value set, a type is considered as either a scalar type (dimension of the
value is 1) or a composite type (dimension can be greater than 1). The only assumption made by VHDL in the definition of types is that the integers exist, and that characters exist. Given these assumptions, the user has complete flexibility in the definition of types. In the rest of this note, we will describe the most important kinds of types that can be defined in VHDL1.
2.1 Enumerated Types
An enumerated type is an ordered set of symbolic values, defined in the following manner. type MyColor is (v,i,b,g,y,o,r); This type definition says that the set of possible values for an object with type MyColor is the ordered list (v, i, b, g, y, o, r). Each element in this ordered list has a position-number and an index. The position values and indices of the set are as follows
1Some types such as access types (pointers) and physical types (to specify delays) etc. will
not be described here.