Boolean algebra laws and Karnaugh map rules
De Morgan's law says (X·Y)′ = X′ + Y′ and (X + Y)′ = X′·Y′: flip every AND and OR and complement every letter. To simplify, use laws such as X + X·Y = X, or group the 1s of a Karnaugh map in rectangles of 1, 2, 4 or 8 cells and keep only the letters that stay the same in each group.
The formulas
| Formula | What it gives | Symbols |
|---|---|---|
(X·Y)′ = X′ + Y′, (X + Y)′ = X′·Y′, X″ = X | De Morgan's law | X, Y = any letters or expressions; ′ = complement (NOT). Push the complement inside: AND becomes OR, OR becomes AND, every part is complemented, and a double complement cancels (X″ = X) |
000, 001, 010, 011 → A′ | A group of 1s in a Karnaugh map as a product term | Cells are written as bits in the order A, B, C. A group of 1, 2, 4 or 8 cells (a rectangle, may wrap round the edges, Gray-code order) keeps only the letters that stay the same across it: here A = 0 in all four cells, so the term is A′. Add (OR) the group terms |
X + X·Y = X, X·(X + Y) = X | The absorption law | X, Y = any letters or expressions; the extra term containing X is absorbed |
X + 0 = X, X·1 = X, X + 1 = 1, X·0 = 0 | The identity and null laws | X = any letter or expression; + is OR, · is AND. Adding 0 or multiplying by 1 changes nothing |
X + X = X, X·X = X, X + X′ = 1, X·X′ = 0 | The idempotent and complement laws | X′ = the complement of X (1 becomes 0 and 0 becomes 1); a letter with its own complement gives 1 for OR and 0 for AND |
X + X′·Y = X + Y, X·(X′ + Y) = X·Y | Absorbing a complemented letter | X, Y = any letters or expressions; X′ drops out because it is 1 only when X is 0 |
X·Y + X·Y′ = X, X·Y + X′·Y = Y, (X + Y)·(X + Y′) = X | Combining two terms that differ in one letter | X, Y = any letters or expressions. Take out the shared part: X·(Y + Y′) = X·1 = X. This is why two neighbouring cells in a Karnaugh map merge |
000, 010 → A + C | A group of 0s in a Karnaugh map as a sum term | Cells as bits in the order A, B, C. A and C stay 0 across the group, and each kept letter is complemented, so the group of 0s gives the sum A + C. Multiply (AND) the sums to get the product of sums |
n_AND + n_OR = n | The gate count of a sum of products | n_AND = terms with 2 or more letters (one AND gate each), n_OR = 1 when there are 2 or more terms (else 0), n = gates in all; complemented inputs are free |
Worked example
This example is made by the same code as the practice questions. Open the working to see every step.
Group the 1s in this Karnaugh map. Which is the minimal sum of products?
Answer: A′ + B. Cover every 1 with as few groups as possible, each as large as possible (1, 2, 4 or 8 cells in a rectangle, wrapping round the edges): A′ (4 cells); B (4 cells). So the minimal sum of products is A′ + B.
Show the working
- The 1s are in cells 000, 001, 010, 011, 110, 111 (bits in the order A, B, C).
- Group them in rectangles of 1, 2, 4 or 8 cells, as large and as few as possible, wrapping round the edges. Each group keeps only the letters that stay the same across its cells: 000, 001, 010, 011 → A′; 010, 011, 110, 111 → B.
- Add (OR) the group terms together. Answer: A′ + B.
Common mistakes
These are the wrong answers the practice questions offer, and the slip that leads to each.
- Pushing a complement over a bracket without flipping AND and OR gives the wrong expression.
- Reading the map in plain binary order (00, 01, 10, 11) instead of Gray code groups cells that are not neighbours.
- Treating a don't-care X as 0 instead of letting it join a group gives a longer answer.
- Reading a sum of products as a product of sums (or the reverse), or leaving every letter complemented, gives the wrong form.
Questions
What is the formula for De Morgan's law?
(X·Y)′ = X′ + Y′, (X + Y)′ = X′·Y′, X″ = X. Symbols: X, Y = any letters or expressions; ′ = complement (NOT). Push the complement inside: AND becomes OR, OR becomes AND, every part is complemented, and a double complement cancels (X″ = X).
What is the formula for a group of 1s in a Karnaugh map as a product term?
000, 001, 010, 011 → A′. Symbols: Cells are written as bits in the order A, B, C. A group of 1, 2, 4 or 8 cells (a rectangle, may wrap round the edges, Gray-code order) keeps only the letters that stay the same across it: here A = 0 in all four cells, so the term is A′. Add (OR) the group terms.
What is the formula for the absorption law?
X + X·Y = X, X·(X + Y) = X. Symbols: X, Y = any letters or expressions; the extra term containing X is absorbed.