VHDL Programming

(C. Jardin) #1

120 Chapter Five


ZL HX

Z

L

H

X

Z

L

H

X

L

L

X

X

H

X

H

X

X

X

X

X

Figure 5-1
Four State Truth
Table.


Let’s examine a resolution function for the type fourvalthat was used
in the conversion function examples. The type declaration for fourvalis
shown here:

TYPE fourval IS (X, L, H, Z);

Four distinct values are declared that represent all of the possible
values that the signal can obtain. The value Lrepresents a logical 0, the
value Hrepresents a logical 1, the value Zrepresents a high-impedance
or open-collector condition, and, finally, the value Xrepresents an unknown
condition in which the value can represent an Lor an H, but we’re not sure
which. This condition can occur when two drivers are driving a signal, one
driver driving with an H, and the other driving with an L.
Listed by order of strength, with the weakest at the top, the values are
as follows:

Z—Weakest,H,L, or Xcan override

H,L—Medium strength, only Xcan override

X—Strong, no override

Using this information, a truth table for two inputs can be developed,
as shown in Figure 5-1.
This truth table is for two input values. It can be expanded to more
inputs by successively applying it to two values at a time. This can be done
because the table is commutative and associative. An Land a Z, or a Zand
an L, gives the same results. An (L,Z) with Hgives the same results as an
(H,Z) with an L. These principles are very important, because the order of
driver values within the input argument to the resolution function is non-
deterministic from the designer’s point of view. Any dependence on order
can cause nondeterministic results from the resolution function.
Free download pdf