2.1 Truth Table
By using the lookup table in the LUT, it is possible to generate any logical
expression with up to three inputs. The inputs can be individually:
- Masked
- Connected to I/Os
- Driven by peripherals:
- Analog comparator output (AC)
- Timer/Counters waveform outputs (TC)
- USART
- SPI
- Driven by internal events from the Event System
- Driven by other CCL sub-modules
Understanding how to use the truth table to generate the logical expression needed is the key to make the CCL work as intended.
Each TRUTH[x] line in the table will create one 3-input gate, and by choosing more than one TRUTH in the table it is possible to create complex logical expressions. Each combination of the input bits (IN[2:0]) corresponds to one bit in the TRUTHn register.
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] |
IN[] | TRUTH | AND | NAND | OR | NOR | XOR | XNOR | NOT |
---|---|---|---|---|---|---|---|---|
000 | TRUTH[0] | 0 | 1 | 0 | 1 | 0 | 1 | 1 |
001 | TRUTH[1] | 0 | 1 | 1 | 0 | 1 | 0 | x |
010 | TRUTH[2] | 0 | 1 | 1 | 0 | 1 | 0 | x |
011 | TRUTH[3] | 0 | 1 | 1 | 0 | 0 | 1 | x |
100 | TRUTH[4] | 0 | 1 | 1 | 0 | 1 | 0 | x |
101 | TRUTH[5] | 0 | 1 | 1 | 0 | 0 | 1 | x |
110 | TRUTH[6] | 0 | 1 | 1 | 0 | 0 | 1 | x |
111 | TRUTH[7] | 1 | 0 | 1 | 0 | 1 | 0 | 0 |
0x80 | 0x7F | 0xFE | 0x01 | 0x96 | 0x69 | 0x01 |
Each TRUTH[x] chosen will be OR-ed together creating the final logical expression.