Karnaugh maps: practice problems with answers
A Karnaugh map arranges the truth table so that neighbouring cells differ in exactly one variable. Groups of ones then give you the minimal formula directly.
Rules
- Group sizes: 1, 2, 4, 8 or 16 cells, always rectangular
- Rows and columns run in Gray code: 00, 01, 11, 10
- The edges are neighbours too
- Groups as large as possible, as few as possible
- A term keeps only the variables that stay constant in the group
Your turn
Three problems on this topic. Any equivalent formula counts.
- 1 · Karnaugh map
- 2
- 3
Find the minimal DNF from the Karnaugh map.
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 1 | 0 | 0 | 0 |
| 01 | 1 | 1 | 1 | 0 |
| 11 | 0 | 0 | 1 | 0 |
| 10 | 0 | 0 | 0 | 0 |
Minimal DNF (at most 9 literals)
Number of blocks (product terms)
Type formulas like A'B + C, ¬A ∧ B or !A & B. Any equivalent way of writing it counts. The symbol buttons insert a character.
Worked example
Find the minimal DNF from the Karnaugh map.
| A \ BC | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 |
Worked solution
- 1Form the largest blocks of 1, 2, 4 or 8 adjacent cells (also across the edge). Prime implicants: B · A ∧ C
- 2Smallest selection covering every 1: B · A ∧ C (2 blocks, 3 literals)
- 3Result: F = B ∨ (A ∧ C)
Typical mistake: Rows and columns run in Gray code (00, 01, 11, 10): the edges are neighbours too.
Find the minimal DNF from the Karnaugh map.
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 1 | 1 | 1 | 0 |
| 01 | 0 | 1 | 0 | 0 |
| 11 | 0 | 1 | 0 | 1 |
| 10 | 1 | 1 | 1 | 0 |
Worked solution
- 1Form the largest blocks of 1, 2, 4 or 8 adjacent cells (also across the edge). Prime implicants: ¬B ∧ ¬C · ¬B ∧ D · ¬C ∧ D · A ∧ B ∧ C ∧ ¬D
- 2Smallest selection covering every 1: ¬B ∧ ¬C · ¬B ∧ D · ¬C ∧ D · A ∧ B ∧ C ∧ ¬D (4 blocks, 10 literals)
- 3Result: F = (¬B ∧ ¬C) ∨ (¬B ∧ D) ∨ (¬C ∧ D) ∨ (A ∧ B ∧ C ∧ ¬D)
Typical mistake: Rows and columns run in Gray code (00, 01, 11, 10): the edges are neighbours too.
Common questions
May groups overlap?
Yes. A one can be in several groups if that makes the group larger.
Is there always just one minimal solution?
No, sometimes several are equally good. The trainer accepts any of them.
