25.4.3.2 Logic Input Gates
Four logic input gates are used to route input sources from the data selection multiplexers into the four logic function inputs. The True and Negated forms of each input source signal are available for use by each logic gate. The input signal sources are enabled for use by each logic function input using the CLCxGLS register. There are up to eight signals that can be enabled for use by each logic function input. Any number of the eight signal sources may be enabled for each of the four logic function inputs. Each logic gate provides a logical OR of the input signals. The selected (True or Negated) signals are OR’d to form the gate output data. The logical NAND is obtained by changing the output polarity with the GxPOL bits. If the logical AND is required instead, select negated inputs and invert the output polarity according to DeMorgan’s theorem. If all inputs are negated and applied to a NOR, the result is identical to an AND operation. Written algebraically:
C = A AND B
is the same as:
C = NOT(NOT(A) OR NOT(B)).
Table 25-9 summarizes the basic functions that can be obtained by using the Gate Control bits. The table shows the use of all four input multiplexer sources, but the input gates can be configured to use less. If no inputs are selected (CLCxGLS = 0x00), the output will be zero or one, depending on the GxPOL bits.
CLCxGLS | GxPOL Bits | Function |
---|---|---|
0xAAAAAAAA | 0 | OR (D1, D2, D3, D4) |
0xAAAAAAAA | 1 | NOR (D1, D2, D3, D4) |
0x55555555 | 0 | NAND (D1, D2, D3, D4) |
0x55555555 | 1 | AND (D1, D2, D3, D4) |
0x22222222 | 1 | NOT (D1) |
0x00000000 | 0 | Logic ‘0 ’ |
0x00000000 | 1 | Logic ‘1 ’ |
If the output of a gate must be zero or one, the recommended method is to set all of the bits related to that gate in CLCxGLS to zero and use the Gate Polarity bit, GxPOL, to set the desired level.