Microsoft AGB-00001 Spécifications Page 21

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 144
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 20
Language Structure
VHDL Reference Manual 2-13
The encoding of integers in a binary format means that all ranges are
rounded up to the nearest power of two. This means that if shorter had
been declared as:
subtype shorter is short range 0 to 16;
then the result would have been the same after synthesis. Objects
declared type of type integer without a range constraint will be
synthesized into 32 wires.
The are two predefined subtypes of integer. Subtype natural is
defined as non-negative integer, while subtype positive is defined as
a non-negative and non-zero integer.
Other Types
The types bit, Boolean, character, std_ulogic and std_logic are
enumerated types. Enumerated types are discussed in the following
subsection. The type bit_vector is an array, as is the type
std_logic_vector.
Bit , std_logic and std_ulogic types are synthesized to one wire.
Character types are synthesized to seven wires.
Boolean types are synthesized to one wire.
Array and record types are composites, and are treated as
collections of their elements. Subtypes of composite types are
treated as collections of the elements of the subtype only.
Enumerated Types
An enumerated type in VHDL is a special kind of data type that has a
symbolic value. A good example of where an enumerated type signal
would be used is in a state machine, in which symbolic values are used
to represent unique states of the machine:
type machine_state is (Init, Ready, Xmit1, Xmit2, Xmit3, Xmit4);
signal present_state, next_state: machine_state;
Many of the common data types used in VHDL, such as bit, Boolean,
character, and std_ulogic, are actually enumerated types defined in a
library such as std or ieee. Bit, Boolean, and character are all
enumerated types that are predefined in std.vhd.
When synthesized, enumerated types result in a binary encoding,
unless the enum_encoding attribute has been used to specify
alternate values for each element of the type. In the absence of the
enum_encoding attribute, elements in the enumerated type are
assigned numeric values from left to right, with the value of the
leftmost element being zero.
By default, the number of wires generated to encode an enumerated
type will be the smallest possible n, where the number of elements is
2
n
. (It will, for example, require three wires to represent an
enumerated type with more than four but less than nine different
values.)
Vue de la page 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 143 144

Commentaires sur ces manuels

Pas de commentaire