Programmable Lookup Table

Each LUT has a truth table determining its output value based on the input values. All combinations of the three inputs IN[0], IN[1] and IN[2] are indicated in the below table, where each combination corresponds to one of the bits in Truth Table bit group in the LUT Control x register (LUTCTRLx.TRUTH). TRUTH must therefore be set according to the desired output for each combination of inputs. For instance if it is desired to generate a high output only when all three inputs are low or all three inputs are high, TRUTH[0] and TRUTH[7] must be written to one (LUTCTRLx.TRUTH written to 0x81). If only the first two inputs are of interest, and IN[2] is masked, the IN[2] column and the TRUTH[4:7] rows can be neglected since IN[2] in this case always will be zero.

Table 1. Truth Table of LUT
IN[2] IN[1] IN[0] OUT
0 0 0 TRUTH[0]
0 0 1 TRUTH[1]
0 1 0 TRUTH[2]
0 1 1 TRUTH[3]
1 0 0 TRUTH[4]
1 0 1 TRUTH[5]
1 1 0 TRUTH[6]
1 1 1 TRUTH[7]

Using the above table, one can select specific combinations of inputs, or create standard logic gates. Examples for creating the most common three input logic gates are shown in the following table.

Table 2. Implementation of Logic Gates with Three Inputs
  AND NAND OR NOR XOR XNOR
TRUTH[7:0] 0x80 0x7F 0xFE 0x01 0x16 0xE9