Logic Functions Examples

As already mentioned, the truth tables allow implementation of any combinational logic function of up to three inputs and one output. This section will provide two examples of standard functions that can be implemented.

  1. 1.Logic OR with Three Inputs

    The truth table for the OR function with three inputs is presented in the table below:

    IN2 IN1 IN0 IN0 OR IN1 OR IN2
    0 0 0 0
    0 0 1 1
    0 1 0 1
    0 1 1 1
    1 0 0 1
    1 0 1 1
    1 1 0 1
    1 1 1 1

    In order to implement this logic function with a Truth table, the bits from the CCL.TRUTHn register should have the same value as their correspondents from the table above. This translates to the following configuration:

    CCL.TRUTHn = 0xFE

  2. 2.Logic AND with Two Inputs

    The truth table for the AND function with two inputs is presented in the table below:

    X IN1 IN0 IN0 AND IN1
    0 0 0 0
    0 0 1 0
    0 1 0 0
    0 1 1 1

    Because there are only two inputs, the third input channel is tied low (IN2 = 0). In order to implement this logic function with a truth table, the bits from the CCL.TRUTHn register should have the same value as their correspondents from the table above. This translates to the following configuration:

    CCL.TRUTHn = 0x08