|
TABLE CELLS |
Copyright © 1998 University of Manchester |
TABLE FORMATS
The full syntax of Truth Table files is defined in section 9.5 of LPM 2 0 1 specification. A summary is included here for reference only.
Logical Functions can be described by how they behave rather than how they are implemented. In LPM this manner of description is restricted to the two table-based modules LPM_TTABLE and LPM_FSM. The former describes a stateless behavior while the latter describes the behavior of systems with a memory of their behavior (i.e., with a state). The table-based digital functions LPM_TTABLE and LPM_FSM define their function by describing their outputs as a function of their inputs in the form of a table. A table in this format describes a function as a sum of products. The inputs to the product terms are the true and inverted inputs to the module. A typical product term of a table driven module with four inputs (Data3:0) is:
Tables in LPM are represented in the Berkeley PLA format with an input plane and an output plane. The table entry corresponding to the above equation is:
The first four characters represent the input terms. Notice that the notation depends upon positional information so that an entry is needed even if the input is not used in the product term. Each position in the input plane corresponds to an input variable: a 1 implies the corresponding input literal is used in the product term, a 0 implies the complemented input literal appears in the product term, and '-' implies the input literal does not appear in the product term. A sum of products term is expressed as two of more lines in the table. Each line in the table thus expresses a function for one or more of the outputs but the total function is expressed as the sum of all the lines in the table.
Boolean sums of terms can be described in various ways. One method is to describe the input conditions under which the outputs are 1 and imply that the outputs are 0 for all other sets of inputs (i.e., the ON-set can be provided). This may represent a more complex function than is needed because some of the outputs are not used under certain input conditions (i.e., they are "don't cares"). A more precise way of defining the Boolean function then, is to provide both the ON-set and the DC-set (Don't Care set). Then the OFF-set (the conditions under which the outputs must be low) is the complement of the union of the On- and DC-sets. LPM follows the Berkeley format in allowing the following different representations for truth tables:
The definition of the output section of a Boolean function expressed as a table depends upon which of the four descriptions is used. The output formats are:
F = LPM_TruthType. For each output, a 1 means that this product
term belongs to the ON-set, a 0 means that this product term has
no meaning for the value of this function (i.e., the output value
may be set by some other function). This type corresponds to an
actual PLA where only the ON-set is actually implemented.
FD = LPM_TruthType. For each output, a 1 means that this product
term belongs to the ON-set, a 0 means that this product term has
no meaning for the value of this function, and a '' implies
that this product term belongs in the DC-set.
| FR = LPM_TruthType. For each output, a 1 means that this product
term belongs to the ON-set, a 0 means that this product term belongs
to the OFF-set, and a '' means that this product term has
no meaning for the value of this function.
| FDR = LPM_TruthType. For each output, a 1 means that this
product term belongs to the ON-set, a 0 means that this product
term belongs to the OFF-set, a '' implies means that this
product term belongs to the DC-set, and a '~' implies that this
product term has no meaning for the value of this function.
| |
Truth Table
Ports:
Description | Comments | |||
Data input | Vector, LPM_WidthIn wide | |||
Result of Logic Function | Vector, LPM_WidthOut wide |
Properties:
Description | Comments | |||
Data input | Vector, LPM_WidthIn wide | |||
Result of Logic Function | Vector, LPM_WidthOut wide |
Properties:
Value | Comments | ||
LPM Value > 0 | Width of input vector | ||
LPM Value > 0 | Width of output vector | ||
String File Name | Name of file containing Truth Table file. | ||
F | FD | FR | FDR | Default is FD |
Example
The file TT1.txt contains:
.i | 6 | # No. of inputs | ||||||
.o | 2 | # No. of outputs | ||||||
0 | 0 | - | - | 1 | 0 | 0 | 1 | |
0 | 0 | - | 1 | 0 | 0 | 1 | 0 | |
0 | 1 | 1 | - | - | 0 | 1 | 1 |
This corresponds to:
Result0 = ~Data0 & Data1 & ~Data4 & ~Data5 | ~Data0 & Data3 & Data4 & ~Data5
Result1 = ~Data0 & ~Data1 & Data2 & ~Data4 & ~Data5 | ~Data0 & Data3 & Data4 & ~Data5
or
OUT0 = ~IN0 & IN1 & ~IN4 & ~IN5 | ~IN0 & IN3 & IN4 & ~IN5
OUT1 = ~IN0 & ~IN1 & IN2 & ~IN4 & ~IN5 | ~IN0 & IN3 & IN4 & ~IN5