Interactive Demo โ€” Boolean Logic

Bitwise Operations Sandbox

Build two byte registers, A and B, then combine them with AND, OR, XOR, or NOT. This is the binary math underneath subnet masks, permission flags, and basic XOR-based encryption.

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.