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:

Result = ~Data0 & Data1 & Data3

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:

1-10 1

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:

  1. By providing the ON-set, the OFF-set is implied as the complement of the ON-set and the DC-set is empty. (LPM_TruthType property = F)
  2. By providing the ON-set and DC-set, the OFF-set is implied as the complement of the union of the ON-set and the DC-set. If any product term belongs to both the ON-set and the DC-set, then it is considered a Don't Care and may be removed from the ON-set during the fitting process. (LPM_TruthType = FD)
  3. By providing the ON-set and OFF-set the DC-set is implied as the complement of the union of the ON-set and OFF-set. It is an error for any product term to belong to both the ON-set and OFF-set. (LPM_TruthType = FR)
  4. By providing the ON-set, the DC-set and the OFF-set the truth table is fully specified. (LPM_TruthType = FDR)

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.

  1. regardless of the type, a '~' implies the product term has no meaning for the value of the function.
  2. If at all possible, the fitter should be given the DC-set (either implicitly or explicitly) in order to improve the results of the fitting.

4.5.2 LPM_TTABLE

Truth Table

Ports:
Port Name
Type
Usage
DescriptionComments
Data
I
Required
Data input Vector, LPM_WidthIn wide
Result
O
Required
Result of Logic Function Vector, LPM_WidthOut wide

Properties:
Port Name
Type
Usage
DescriptionComments
Data
I
Required
Data input Vector, LPM_WidthIn wide
Result
O
Required
Result of Logic Function Vector, LPM_WidthOut wide

Properties:
Property
Usage
ValueComments
LPM_WidthIn
Required
LPM Value > 0Width of input vector
LPM_WidthOut
Required
LPM Value > 0Width of output vector
LPM_File
Required
String File NameName of file containing Truth Table file.
LPM_TruthType
Optional
F | FD | FR | FDRDefault is FD

Function
Result = f(Data)
Where f is the function defined in the Truth Table file.

Example

This diagram is for illustrative purposes only and is not intended to specify any implementation details.

The file TT1.txt contains:
.i 6 # No. of inputs
.o2 # No. of outputs
00- -10 01
00- 100 10
011 --0 11

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