Skip to main content

Boolean Algebra

Boolean algebra is the original theoretical area dealing with only true and false. It's this area of mathematics that introduced AND, OR, XOR, NOT etc. concepts for boolean inputs.

This is the basis of bit-wise and binary-arithmetic fields.

Boolean to Binary Encoding

This a very important mental model to have. Binary and boolean aren't same. It's just that the binary is used to represent boolean values.

boolean-algebra

Standard Boolean Operators​

OperatorSymbolDescriptionInput causing output = TrueInput causing output = False
NOT¬, ~Flips the valueInput = FalseInput = True
AND∧, ·True only if both are trueBoth TrueAny False
OR∨, +True if at least one is trueAny TrueBoth False
XORβŠ•, ⊻True if inputs are differentInputs differInputs same
NAND↑, ⊼Opposite of ANDAny FalseBoth True
NOR↓, ⊽Opposite of ORBoth FalseAny True
XNORβŠ™, ≑True if inputs are the sameInputs sameInputs differ

s