Register Logic
click bits in A and B
Register A
Register B
Result
A
0
B
0
Result
0
Key Concepts
AND
Result bit is 1 only if both A and B are 1. Used to "mask" bits โ like isolating the network portion of an IP address.
OR
Result bit is 1 if either A or B is 1. Used to set specific bits on โ like turning on a permission flag.
XOR
Result bit is 1 only if A and B differ. Reversible with the same key โ the basis of simple stream cipher encryption.
NOT
Flips every bit in A. Combined with AND, it's how you clear specific bits without touching the rest of the byte.