🡄 Previous

Next 🡆

Contents > Functions

Bitwise XOR

The bitwise XOR function operates on a 2-byte array. It sets the first byte to the bitwise XOR of both bytes:

f( [ A, B ] ) = [ Q, B ]

Q = A ⊕ B and B passes through, unchanged.

As revealed in the following schematic, each bit of Q, Qi, is the output of an XOR gate that combines each bit of A, Ai, with each bit of B, Bi.

Bitwise XOR Schematic

In the Tetris version below, the XOR gates are arranged in a line in the top-left. The explanation for the parallelogram is the same as the one described for bitwise AND.

Bitwise XOR

A horizontally reflected version was not implemented.

🡄 Previous

Next 🡆