Exercises — Karnaugh map simplification (2,3,4 variables)
Before we start, a shared vocabulary reminder so no symbol appears un-earned:
The two K-map layouts we use throughout (memorise the cell → minterm mapping):
Level 1 — Recognition
Exercise 1.1
Below is a 3-variable map. Write down the minterm indices that are 1.
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
Recall Solution 1.1
Read each cell's index from the figure above.
- Row : column
00→ (=1), column10→ (=1). - Row : column
00→ (=1), column10→ (=1).
Answer: .
Exercise 1.2
State whether each proposed group is legal. Answer legal/illegal and give the one-word reason. (a) 3 cells in a horizontal row. (b) The 4 corner cells of a 4-variable map. (c) An L-shape of 4 cells. (d) A single lonely 1.
Recall Solution 1.2
- (a) Illegal — size 3 is not a power of two.
- (b) Legal — wrap-around joins the four corners into a group (top/bottom and left/right edges touch).
- (c) Illegal — must be a rectangle, no L-shapes.
- (d) Legal — size is a valid group (it just eliminates 0 variables).
Level 2 — Application
Exercise 2.1
Minimise on a 2-variable map (rows , columns ).
Recall Solution 2.1
Layout: index .
| 0 | 1 | |
|---|---|---|
| 0 | 0 | 1 |
| 1 | 0 | 1 |
() and () fill column : a group of . literal. Across the group varies (drop), constant. Answer: .
Exercise 2.2
Minimise (the map from Exercise 1.1).
Recall Solution 2.1... 2.2
All four 1s sit in columns 00 and 10 (the columns), forming a block of 4.
literal. varies, varies, constant.
Answer: .
Sanity: minterms are exactly the even indices — even means the last bit . ✓
Exercise 2.3
Minimise .
Recall Solution 2.3
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 |
The 1s occupy columns 00 and 01 () across both rows: a group of 4.
constant; and vary. .
Answer: .
Level 3 — Analysis
Exercise 3.1
Minimise . (Hint: think about the edges.)
Recall Solution 3.1
Place them using the 4-var map (, rows , cols ):
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 1 | 0 | 0 | 0 |
| 01 | 1 | 0 | 0 | 0 |
| 11 | 1 | 0 | 0 | 0 |
| 10 | 1 | 0 | 0 | 0 |
All four 1s fill column CD=00: a vertical group of 4. Rows run through all values (both and vary), while stay fixed.
literals.
Answer: .
Exercise 3.2
Minimise — the four corners.
Recall Solution 3.2
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 1 | 0 | 0 | 1 |
| 01 | 0 | 0 | 0 | 0 |
| 11 | 0 | 0 | 0 | 0 |
| 10 | 1 | 0 | 0 | 1 |
The four 1s are the map's corners. By wrap-around, top row bottom row and left column right column, so the corners form one group of 4 (see the red loop in the figure). Inside it: varies (rows 00 vs 10), varies (cols 00 vs 10). Constant: , . . Answer: .
Exercise 3.3
Minimise .
Recall Solution 3.3
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 0 | 0 | 0 | 0 |
| 01 | 0 | 1 | 1 | 0 |
| 11 | 0 | 1 | 1 | 0 |
| 10 | 0 | 0 | 0 | 0 |
The 1s form a block in rows 01,11 and columns 01,11.
Rows: in both (constant), varies. Columns: in both (constant), varies.
Constant: , . .
Answer: .
Level 4 — Synthesis
Exercise 4.1
Build the map for and find the minimal SOP. (This is the parent note's Example 3 — reproduce it and justify every choice.)
Recall Solution 4.1
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | d | 1 | 1 | d |
| 01 | 0 | d | 1 | 0 |
| 11 | 0 | 0 | 1 | 0 |
| 10 | 0 | 0 | 1 | 0 |
Group A — column CD=11 (cells ): all real 1s, size 4. Rows vary, constant → term . Group B — row AB=00 (cells ): treat the two don't-cares as 1 to make a size-4 group. constant, vary → term . Every real 1 () is now covered. The don't-care at was not needed, so we leave it 0 (no extra term). Answer: .
Exercise 4.2
Design a majority function: when at least two of are 1. Write its minterms, map it, minimise.
Recall Solution 4.2
"At least two 1s" out of 3 inputs → minterms with two or three 1s: . So .
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 1 |
Three pairs (each size 2, overlapping on ):
- (column
11): , varies → . - (row , cols
01,11): , varies → . - (row , cols
11,10): , varies → .
No size-4 group exists (the 1s don't form a rectangle of 4). Overlap on is legal and lets each pair be full. Answer: — the classic majority/"carry-out" expression.
Level 5 — Mastery
Exercise 5.1
Minimise . Choose the fewest, largest groups and defend that the cover is minimal.
Recall Solution 5.1
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 1 | 1 | 1 | 1 |
| 01 | 1 | 1 | 0 | 0 |
| 11 | 1 | 1 | 0 | 0 |
| 10 | 1 | 1 | 1 | 1 |
Group A — columns CD=00,01 (all four rows, size 8): constant, everything else varies. → term .
Group B — rows AB=00,10 (top+bottom edges wrap, all four columns, size 8): constant. → term .
Every 1 is covered by A or B; the two remaining 0-heavy cells ( region) stay 0.
Answer: .
Minimality: only two 1-cells that lie in row 01/11 and columns 11/10 are 0, and every 1 falls into one of two maximal size-8 groups — you cannot do better than two 1-literal terms.
Exercise 5.2
A 4-variable function is 1 exactly when the input, read as a number , is odd. Give the minimal SOP and the gate count.
Recall Solution 5.2
"Odd" ⇔ last bit . Odd indices: .
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 0 | 1 | 1 | 0 |
| 01 | 0 | 1 | 1 | 0 |
| 11 | 0 | 1 | 1 | 0 |
| 10 | 0 | 1 | 1 | 0 |
Columns 01 and 11 () across all four rows form a size-8 group. all vary; constant.
Answer: .
Gate count: zero gates — the output is just the wire . That is the cheapest circuit possible, and it's why "odd detector = lowest bit" is a hardware one-liner.
Exercise 5.3
. Find the minimal SOP and identify which single group is essential (covers a 1 no other group can).
Recall Solution 5.3
| 00 | 01 | 11 | 10 | |
|---|---|---|---|---|
| 00 | 0 | 1 | 1 | 0 |
| 01 | 0 | 1 | 1 | 0 |
| 11 | 0 | 0 | 0 | 0 |
| 10 | 0 | 1 | 0 | 0 |
Group A — rows 00,01, columns 01,11 (), size 4: constant → term .
Group B — cover (). Its only same-one-bit neighbour that is a 1 is (), so pair them: column 01, rows 00,10 → → term .
can be covered only by Group B, so Group B is essential.
Answer: .
Cross-check with Quine-McCluskey Method would list the same two prime implicants, with flagged essential for .
Active Recall
Recall What survives in the product term for a group?
Only the variables that are constant across the whole group; every variable that takes both 0 and 1 is dropped (combining theorem).
Recall A size-8 group in a 4-variable map → how many literals?
literal.
Recall When may you leave a don't-care as 0?
Whenever it is not needed to enlarge a group you already require — never add a term just to cover it.
Recall What makes a group "essential"?
It covers at least one 1 that no other legal group can cover.
Connections
- Parent: K-map simplification — the theory these drills exercise.
- Boolean Algebra Laws — powers every reduction.
- Sum of Products and Product of Sums — all answers are minimal SOP.
- Truth Tables — the raw form each comes from.
- Logic Gate Minimisation — fewer literals ⇒ fewer gates (Exercises 5.2, 5.3).
- Quine-McCluskey Method — cross-check for essential implicants.
- Don't-care Conditions — the flexibility used in Exercises 4.1.