XOR   XORNPLCopen motion icon

Operator - Performs an exclusive OR of all inputs.

Inputs

IN1 : BOOL First Boolean input
IN2 : BOOL Second Boolean input

Outputs

Q : BOOL   Exclusive OR of all inputs

Truth table

IN1 IN2 Q

0

0

0

0

1

1

1

0

1

1

1

0

Remarks

The block is called "=1" in FBDClosed"Function block diagram" A function block diagram describes a function between input variables and output variables. A function is described as a set of elementary blocks and FFLD languages. In ILClosed"Instruction list" This is a low-level language and resembles assembly language, the XOR instruction performs an exclusive OR between the current result and the operand. The current result must be Boolean. The XORN instruction performs an exclusive between the current result and the Boolean negation of the operand.

ST Language

Q := IN1 XOR IN2;
Q := IN1 XOR IN2 XOR IN3;

FBD Language

XorFbd.gif (1618 octets)

FFLD Language

(* First input is the rung. The rung is the output *)
XorLd.gif (1392 octets)

IL Language

Op1: FFLD   IN1
     XOR  IN2
     ST   Q   (* Q is equal to: IN1 XOR IN2 *)
Op2: FFLD   IN1
     XORN IN2
     ST   Q   (* Q is equal to: IN1 XOR (NOT IN2) *)

See also

AND   OR   NOT