Boolean algebra is the mathematics of values that are only true (1) or false (0). It lets us simplify expressions, so that a logic circuit needs fewer gates, and is cheaper, faster and uses less power.
Notation
Operation
Symbol
Meaning
NOT
A
Inverts A
AND
A⋅B (or AB)
1 only if both are 1
OR
A+B
1 if either is 1
XOR
A⊕B
1 if exactly one is 1
Order of precedence: NOT first, then AND, then OR. So A+B⋅C means A+(B⋅C).
Boolean identities
These rules are always true, and can be checked with a truth table.
Name
AND form
OR form
Identity
A⋅1=A
A+0=A
Annulment
A⋅0=0
A+1=1
Idempotent
A⋅A=A
A+A=A
Complement
A⋅A=0
A+A=1
Double negation
A=A
Commutative
A⋅B=B⋅A
A+B=B+A
Associative
A⋅(B⋅C)=(A⋅B)⋅C
A+(B+C)=(A+B)+C
Distributive
A⋅(B+C)=A⋅B+A⋅C
A+B⋅C=(A+B)⋅(A+C)
Absorption
A⋅(A+B)=A
A+A⋅B=A
De Morgan's laws
De Morgan's laws show how to swap AND and OR when a NOT is applied to a whole expression.
A⋅B=A+BA+B=A⋅B
To apply them: break the bar over the expression and change the operator (AND to OR, or OR to AND), putting a bar on each term.
Check the first law with a truth table:
A
B
A⋅B
A⋅B
A
B
A+B
0
0
0
1
1
1
1
0
1
0
1
1
0
1
1
0
0
1
0
1
1
1
1
1
0
0
0
0
The columns for A⋅B and A+B are identical, so the law holds.
In words: NAND is the same as an OR of the inverted inputs, and NOR is the same as an AND of the inverted inputs.
Simplifying expressions
Use the identities one step at a time, and state which rule you use at each step.
Example 1
Simplify Q=A⋅B+A⋅B.
Q=A⋅(B+B)(distributive, taking out A)Q=A⋅1(complement: B+B=1)Q=A(identity)
Two AND gates, an OR gate and a NOT gate reduce to just a wire.
Task: simplify Q=A+B+A⋅B, then check with a truth table.
Use De Morgan's law on the first term: A+B=A⋅B.
Q=A⋅B+A⋅B
This can't be reduced further with the simple identities. Its truth table shows what it does:
A
B
A⋅B
A⋅B
Q
0
0
1
0
1
0
1
0
0
0
1
0
0
0
0
1
1
0
1
1
Q is 1 when A and B are equal. That is the XNOR function (the opposite of XOR), so Q=A⊕B.
Exam tip: write each step on a new line and name the identity or law you used. If you're unsure of a simplification, check it with a truth table. A common slip is to forget to put a bar on both terms when you apply De Morgan's laws.
Check yourself
Simplify A+A⋅B
By absorption (or taking out A: A⋅(1+B)=A⋅1), the answer is A.
Apply De Morgan's law to A+B
A⋅B=A⋅B.
What is A⋅B equal to?
A+B (De Morgan's law).
Why is simplifying a Boolean expression useful?
A simpler expression needs fewer logic gates, so the circuit is cheaper, faster and uses less power.