Karnaugh map exercises with answers: 4 variables
Ten functions over A, B, C and D as minterm lists, to be grouped on the four-by-four Karnaugh map. Draw the map with AB on the rows and CD on the columns in Gray-code order, circle the groups, and compare with the engine's map and derived expression under each problem.
In the engine's layout the rows are AB = 00, 01, 11, 10 and the columns CD = 00, 01, 11, 10, so the first row is m0, m1, m3, m2 and the last row is m8, m9, m11, m10. Both edges wrap: the top and bottom rows are neighbours, and so are the left and right columns, which makes the four corners m0, m2, m8, m10 one group. Groups of two, four, eight and sixteen cells drop one, two, three and four variables.
The set includes the four corners, a full row, a full column, a block of eight, a wraparound pair of rows, the classic two-group function from the worked examples, a single cell, and a ten-cell function that needs a group of eight and a group of four sharing cells. Each solution names the cells of each group, says which variables change inside it, and gives the sum of products.
1. Group the Karnaugh map of Σm(A, B, C, D; 0, 2, 8, 10) and write the result. Σm(A, B, C, D; 0, 2, 8, 10)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 10 | TRUE | FALSE | TRUE | FALSE | TRUE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 2, 8, 10) Classification: contingent
- cells m0, m2, m8, m10
NOT B AND NOT D
m0, m2, m8, m10 are the four corners, adjacent by wraparound on both edges: A and C change, B and D are FALSE throughout. Result NOT B AND NOT D.
2. Group the Karnaugh map of Σm(A, B, C, D; 0, 1, 2, 3) and write the result. Σm(A, B, C, D; 0, 1, 2, 3)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | FALSE | TRUE | TRUE | TRUE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | FALSE |
| 9 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 1, 2, 3) Classification: contingent
- cells m0, m1, m2, m3
NOT A AND NOT B
The whole first row, AB = 00, with C and D taking all four combinations: NOT A AND NOT B.
3. Group the Karnaugh map of Σm(A, B, C, D; 5, 7, 13, 15) and write the result. Σm(A, B, C, D; 5, 7, 13, 15)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | TRUE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | TRUE |
| 8 | TRUE | FALSE | FALSE | FALSE | FALSE |
| 9 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | TRUE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 5, 7, 13, 15) Classification: contingent
- cells m5, m7, m13, m15
B AND D
The central block of four, rows AB = 01 and 11 by columns CD = 01 and 11: A and C change, B = TRUE, D = TRUE throughout. Result B AND D.
4. Group the Karnaugh map of Σm(A, B, C, D; 0, 4, 8, 12) and write the result. Σm(A, B, C, D; 0, 4, 8, 12)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | TRUE |
| 5 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | TRUE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 4, 8, 12) Classification: contingent
- cells m0, m4, m8, m12
NOT C AND NOT D
The whole first column, CD = 00: A and B change, result NOT C AND NOT D.
5. Group the Karnaugh map of Σm(A, B, C, D; 0, 1, 2, 4, 5, 6, 8, 9, 12, 13) and write the result. Σm(A, B, C, D; 0, 1, 2, 4, 5, 6, 8, 9, 12, 13)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | TRUE |
| 5 | FALSE | TRUE | FALSE | TRUE | TRUE |
| 6 | FALSE | TRUE | TRUE | FALSE | TRUE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | TRUE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | TRUE |
| 13 | TRUE | TRUE | FALSE | TRUE | TRUE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 1, 2, 4, 5, 6, 8, 9, 12, 13) Classification: contingent
- cells m0, m2, m4, m6
NOT A AND NOT D - cells m0, m1, m4, m5, m8, m9, m12, m13
NOT C
Two groups: the block of eight in columns CD = 00 and 01 gives NOT C, and the four cells m0, m2, m4, m6 (rows AB = 00 and 01, columns CD = 00 and 10, wrapping) give NOT A AND NOT D. They share m0 and m4. Result NOT C OR (NOT A AND NOT D).
6. Group the Karnaugh map of Σm(A, B, C, D; 0, 1, 4, 5, 8, 9, 12, 13) and write the result. Σm(A, B, C, D; 0, 1, 4, 5, 8, 9, 12, 13)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | TRUE |
| 5 | FALSE | TRUE | FALSE | TRUE | TRUE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | TRUE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | TRUE |
| 13 | TRUE | TRUE | FALSE | TRUE | TRUE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 1, 4, 5, 8, 9, 12, 13) Classification: contingent
- cells m0, m1, m4, m5, m8, m9, m12, m13
NOT C
The left half of the map, columns CD = 00 and 01, is a block of eight: A, B and D change, only C is fixed at FALSE. Result NOT C.
7. Group the Karnaugh map of Σm(A, B, C, D; 0, 2, 5, 7, 8, 10, 13, 15) and write the result. Σm(A, B, C, D; 0, 2, 5, 7, 8, 10, 13, 15)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | TRUE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | TRUE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 10 | TRUE | FALSE | TRUE | FALSE | TRUE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | TRUE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | TRUE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 2, 5, 7, 8, 10, 13, 15) Classification: contingent
- cells m0, m2, m8, m10
NOT B AND NOT D - cells m5, m7, m13, m15
B AND D
Two groups of four: the corners m0, m2, m8, m10 give NOT B AND NOT D, and the centre m5, m7, m13, m15 gives B AND D. Result (NOT B AND NOT D) OR (B AND D), which is B <-> D; A and C are irrelevant.
8. Group the Karnaugh map of Σm(A, B, C, D; 1, 3, 9, 11) and write the result. Σm(A, B, C, D; 1, 3, 9, 11)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | FALSE | TRUE | TRUE | TRUE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | FALSE |
| 9 | TRUE | FALSE | FALSE | TRUE | TRUE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | TRUE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 1, 3, 9, 11) Classification: contingent
- cells m1, m3, m9, m11
NOT B AND D
Rows AB = 00 and 10 are neighbours by wraparound, and columns CD = 01 and 11 are adjacent: a block of four with A and C changing, B = FALSE, D = TRUE throughout. Result NOT B AND D.
9. Group the Karnaugh map of Σm(A, B, C, D; 6) and write the result. Σm(A, B, C, D; 6)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 6 | FALSE | TRUE | TRUE | FALSE | TRUE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | FALSE |
| 9 | TRUE | FALSE | FALSE | TRUE | FALSE |
| 10 | TRUE | FALSE | TRUE | FALSE | FALSE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 6) Classification: contingent
- cells m6
NOT A AND B AND C AND NOT D
A single cell, m6, with no 1 beside it: nothing drops and the result is the full minterm NOT A AND B AND C AND NOT D.
10. Group the Karnaugh map of Σm(A, B, C, D; 0, 1, 2, 3, 8, 9, 10, 11) and write the result. Σm(A, B, C, D; 0, 1, 2, 3, 8, 9, 10, 11)
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | FALSE | TRUE | TRUE | TRUE |
| 4 | FALSE | TRUE | FALSE | FALSE | FALSE |
| 5 | FALSE | TRUE | FALSE | TRUE | FALSE |
| 6 | FALSE | TRUE | TRUE | FALSE | FALSE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | TRUE |
| 10 | TRUE | FALSE | TRUE | FALSE | TRUE |
| 11 | TRUE | FALSE | TRUE | TRUE | TRUE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
Σm(A, B, C, D; 0, 1, 2, 3, 8, 9, 10, 11) Classification: contingent
- cells m0, m1, m2, m3, m8, m9, m10, m11
NOT B
The first and last rows, AB = 00 and AB = 10, are neighbours by wraparound and together form a block of eight: A, C and D change and only B is fixed. Result NOT B.
Questions
How do I spot wraparound groups quickly?
Look at the values rather than the drawing: a set of 2, 4 or 8 cells is a group exactly when some variables are fixed across all of them and the others take every combination. The four corners all have B = FALSE, D = FALSE while A and C take all four combinations, which is why they group; the first and last rows share B = FALSE, which is why together they form a block of eight.
Related
Laws
Glossary
- Karnaugh map (K-map): meaning and examples
- Prime implicant: meaning and examples
- Don’t-care condition: meaning and examples
See also
- Lesson 11: Karnaugh maps (advanced, 15 min)
- Four-variable K-map: Σm(0, 2, 5, 7, 8, 10, 13, 15) simplified
- Essential prime implicant: meaning and examples
- Karnaugh map vs Quine–McCluskey
- Karnaugh map solver: 2 to 4 variables, groups, SOP and POS, don’t-cares from assumptions
Practice
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.