
Four-Variable K-Map
A grid that turns a truth table into the simplest possible logic expression.
Description
A 4×4 grid arrangement of a 4-variable truth table that exposes adjacencies visually. Grouping adjacent 1s yields a minimal sum-of-products faster and more reliably than algebra. Place 1s/×s, then cover them with the fewest largest power-of-two rectangles.
- Cells are arranged so neighbors differ in exactly one variable (Gray code).
- Group adjacent 1s in powers of two (1, 2, 4, 8, 16) — bigger groups = simpler terms.
- A variable that changes inside a group drops out of that product term.
- Cells marked × can be treated as 0 or 1 — whichever yields larger groups.
- Use them to simplify further, never to cover a required minterm twice needlessly.
- What: A 4×4 grid arrangement of a 4-variable truth table that exposes adjacencies visually.
- Why: Grouping adjacent 1s yields a minimal sum-of-products faster and more reliably than algebra.
- How: Place 1s/×s, then cover them with the fewest largest power-of-two rectangles.
- Where: Hand design of small combinational blocks and exam/interview minimization problems.
- When: Up to ~4–5 variables; beyond that, switch to Quine–McCluskey or a tool.
At a glance
What
A 4×4 grid arrangement of a 4-variable truth table that exposes adjacencies visually.
Why
Grouping adjacent 1s yields a minimal sum-of-products faster and more reliably than algebra.
How
Place 1s/×s, then cover them with the fewest largest power-of-two rectangles.
Where
Hand design of small combinational blocks and exam/interview minimization problems.
When
Up to ~4–5 variables; beyond that, switch to Quine–McCluskey or a tool.
Think of it like…
Like grouping photos that are almost the same so you can caption a whole batch with one line — each doubling of the batch drops one more detail you no longer need to mention.
How grouping works
- Cells are arranged so neighbors differ in exactly one variable (Gray code).
- Group adjacent 1s in powers of two (1, 2, 4, 8, 16) — bigger groups = simpler terms.
- A variable that changes inside a group drops out of that product term.
Don't-cares
- Cells marked × can be treated as 0 or 1 — whichever yields larger groups.
- Use them to simplify further, never to cover a required minterm twice needlessly.
Group size → literals eliminated
| Cells grouped | Variables removed | Literals in term (of 4) |
|---|---|---|
| 1 | 0 | 4 |
| 2 | 1 | 3 |
| 4 | 2 | 2 |
| 8 | 3 | 1 |
| 16 | 4 | 0 (term = 1) |
Each doubling of a group removes one more variable.
K-map (auto-minimized)
▶ live simulatorClick a cell to cycle 0 → 1 → don't-care (×). Minimized SOP updates live.
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | ||||
| 01 | ||||
| 11 | ||||
| 10 |
3 prime implicants · verified by Quine–McCluskey
The 5 Whys
- 1
Why use a K-map? To minimize logic without error-prone algebra.
- 2
Why minimize? Fewer product terms mean fewer gates.
- 3
Why is the map reliable? Gray coding makes logical adjacency physical adjacency.
- 4
Why group powers of two? Only those groupings let a full variable cancel.
- 5
Root cause: visual adjacency turns Boolean combining (AB + AB′ = A) into spotting rectangles.
Cheat sheet
Working principle
- Place 1s/×s, then cover them with the fewest largest power-of-two rectangles.
- A 4×4 grid arrangement of a 4-variable truth table that exposes adjacencies visually.
Formulas & Boolean expressions
- Group adjacent 1s in powers of two (1, 2, 4, 8, 16) — bigger groups = simpler terms.
Key facts
- Cells are arranged so neighbors differ in exactly one variable (Gray code).
- Cells marked × can be treated as 0 or 1 — whichever yields larger groups.
Why it exists
- Root cause: visual adjacency turns Boolean combining (AB + AB′ = A) into spotting rectangles.