# Truth Table Logic

The truth table in each LUT unit can generate a combinational logic output as a function of up to three inputs (LUTn-TRUTHSEL[2:0]). It is possible to realize any 3-input boolean logic function using one LUT.

Figure 1. Truth Table Output Value Selection of a LUT

The truth table inputs (LUTn-TRUTHSEL[2:0]) are configured by writing the Input Source Selection bit fields in the LUT Control registers:
• INSEL0 in CCL.LUTnCTRLB
• INSEL1 in CCL.LUTnCTRLB
• INSEL2 in CCL.LUTnCTRLC

Each combination of the input bits (LUTn-TRUTHSEL[2:0]) corresponds to one bit in the CCL.TRUTHn register, as shown in the table below:

Table 1. Truth Table of a LUT
LUTn-TRUTHSEL[2] LUTn-TRUTHSEL[1] LUTn-TRUTHSEL[0] OUT
0 0 0 TRUTHn[0]
0 0 1 TRUTHn[1]
0 1 0 TRUTHn[2]
0 1 1 TRUTHn[3]
1 0 0 TRUTHn[4]
1 0 1 TRUTHn[5]
1 1 0 TRUTHn[6]
1 1 1 TRUTHn[7]

Important: Consider the unused inputs turned off (tied low) when logic functions are created.

## LUT Output for CCL.TRUTHn = 0x42

If CCL.TRUTHn is configured to 0x42, the LUT output will be 1 when the inputs are 'b001 or 'b110 and 0 for any other combination of inputs.