Notation
Textbooks write AND as multiplication (a·b or ab), OR as addition (a + b) and NOT as a bar or a prime (a′). This site uses the operators you would type in Verilog: & for AND, | for OR, ~ for NOT and ^ for XOR. The simulator accepts both styles, except that juxtaposition is not AND: write a * b, not ab.
The basic laws
| Law | AND form | OR form |
|---|---|---|
| Identity | a & 1 = a | a | 0 = a |
| Null (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 |
The second distributive law, a | b & c = (a | b) & (a | c), has no equivalent in ordinary arithmetic and is the one most often forgotten.
De Morgan's theorems
De Morgan's theorems move a NOT through an AND or an OR, swapping the operator as it goes. They are how a NAND becomes an OR of inverted inputs, and they are the most used tool for converting between gate types.
~(a & b) = ~a | ~b
~(a | b) = ~a & ~bConsensus
The consensus theorem removes a redundant term: in a & b | ~a & c | b & c, the last term b & c is covered by the other two and can be dropped.
a & b | ~a & c | b & c = a & b | ~a & cIn hardware the redundant term is sometimes kept on purpose: it can remove a brief glitch (a static hazard) when a changes while b and c are both 1.
Simplify, then check
When you simplify by hand, check the result against the original. Enter the original in the simulator, open the Equivalence tab and type your simplified version: it tests every input combination and shows a counterexample if they differ.
Simplify this one, then check it: a & b | a & ~b & c | ~a & b & c
A worked simplification
Take a & b | a & ~b & c | ~a & b & c. Factor a out of the first two terms: a & (b | ~b & c). The absorption-like identity b | ~b & c = b | c turns that into a & (b | c), which distributes to a & b | a & c. The expression is now a & b | a & c | ~a & b & c.
The last term still has three literals. Because a & b & c is already covered by a & b, you may OR it in again without changing anything (idempotence). Then ~a & b & c | a & b & c = b & c by the complement law. The final answer is a & b | a & c | b & c, the majority function. Check it in the simulator: the equivalence tab confirms it for all eight input combinations.
Duality
Every law has a dual: swap AND with OR and 0 with 1, and you get another true law. That is why the table above has two columns. If you remember a & (a | b) = a, duality gives you a | a & b = a for free. De Morgan's theorems are the bridge between the two columns.
When algebra is not enough
Algebraic simplification depends on spotting the right law in the right order, and it gives no proof that the result is the smallest. For up to four inputs a Karnaugh map makes the minimum easy to see; beyond that, tools use the Quine–McCluskey method or heuristics. The next lesson covers both.
Sources and further reading
Every law, table and example on this page is checked by the automated tests of the simulator’s logic engine.