The bitwise OR function operates on a 2-byte array. It sets the first byte to the bitwise OR 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 OR gate that combines each bit of A, Ai, with each bit of B, Bi.
In the Tetris version below, the line of yellow O-tetrominoes in the top-left are the OR gates. 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 |