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.
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.
A horizontally reflected version was not implemented.
© 2023 meatfighter.com |