7.2 Logic operators

7.2.1 Definition

The logic operators AND , OR , NAND , NOR , XOR, XNOR and NOT are defined for the predefined data types bit and boolean . They can also be used for one-dimensional array-types ( Array ) whose elements are of the type bit or boolean . If the operators AND , OR , NAND , NOR , XOR and XNOR are to be used in this last case the following has to be taken into consideration:

  1. Both arrays have to have the same length.
  2. The operation is carried out with the corresponding elements of both arrays.
  3. The result is a array which has the same field depth as the left operand.

Basically the same is valid for the operator NOT , however, the operation is carried out with every individual

element of the array. All binary logic operators have the lowest priority. The unary operator NOT has top priority.

7.2.2 Truth table

A    B    A AND B

F    F        F
T    F        F
F    T        F
T    T        T

A    B    A OR B

F    F        F
T    F        T
F    T        T
T    T        T

A    B    A XOR B

F    F        F
T    F        T
F    T        T
T    T        F

 

A    B    A NAND B

F    F       T
T    F        T
F    T        T
T    T        F

A    B    A NOR B

F    F        T
T    F        F
F    T        F
T    T        F

A    B    A XNOR B

F    F        T
T    F        F
F    T        F
T    T        T

A         NOT A

F            T
T          F

T stands for true (type boolean ), '1' (type bit ).

F stands for false (type boolean ), '0' (type bit ).