The exclusive or (XOR) operator (^)

The XOR operator is a Boolean operator, its principle is that when the inputs are equal the result is zero, and when the inputs are non-equal the result is one. (when more than two inputs are involved the inputs must be separated to two at time)

Following the truth table:

0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0

The negate exclusive or (NXOR) operator (~ ( - ^ - ))

This operator is the opposite of XOR, it negates the result of the XOR operator.

Following the truth table:

~ (0 ^ 0) = 1
~ (0 ^ 1) = 0
~ (1 ^ 0) = 0
~ (1 ^ 1) = 1

Those operators can be easily implemented by a few transistors.