The Truth Table Statement is used to specify combinational logic
or state machine behavior. In an AHDL truth table, each entry in
the table contains a combination of input values that will produce
specified output values. These output values can be used as
feedback to specify state transitions and outputs of state
machines.
Note: Truth tables must follow the rules described in Truth Table Statement Rules.
The following example shows a Truth Table Statement:
TABLE
a0, f[4..1].q => f[4..1].d, control;
0, B"0000" => B"0001", 1;
0, B"0100" => B"0010", 0;
1, B"0XXX" => B"0100", 0;
X, B"1111" => B"0101", 1;
END TABLE;
The Truth Table Statement has the following characteristics:
- The truth table heading consists of the keyword
TABLE, followed by a comma-separated list of table
inputs, an arrow symbol (=>), and a comma-separated
list of table outputs. The heading ends with a semicolon
(;).
- Truth table inputs are Boolean expressions; truth table outputs
are variables. In the example shown above, the input signals are
a0 and f[4..1].q; the output signals are
f[4..1].d and control.
- The body of the table consists of one or more entries, each
spanning one or more lines and ending with a semicolon.
- An entry consists of a comma-separated list of inputs and a
comma-separated list of numerical outputs. The inputs and outputs
are separated by =>.
- Each signal has a one-to-one correspondence with the values in
each entry. Thus, the first entry in the example shown above
signifies that when a0 has the value 0
and f[4..1].q has the value B"0000",
f[4..1].d has the value B"0001", and
control has the value 1.
- Input and output values can be numbers, predefined constants
VCC or GND, symbolic constants (that is,
symbolic names used as constants), or groups of numbers or
constants. Input values can also be X (don't
care).
- Input and output values correspond to the inputs and outputs of
the table heading.
- The keywords END TABLE, followed by a semicolon
(;), end the truth table.