Lesson 6 +40 XP

Karnaugh Maps: 2, 3 and 4 Variable Simplification

Karnaugh Maps: 2, 3 and 4 Variable Simplification

Algebraic simplification works, but it depends on spotting the right theorem and gives no guarantee that the result is minimal. The Karnaugh map (K-map, Maurice Karnaugh, 1953) is a picture of the truth table arranged so that the combining rule xy + xy' = x can be applied by eye: neighbouring 1s are circled together and each circle becomes one simplified product term.

1. The Idea: Adjacent Minterms

Two minterms are adjacent if they differ in exactly one variable. Adjacent minterms combine and that variable disappears:

m5 + m7 = xy'z + xyz = xz(y' + y) = xz

A K-map places the 2n minterms in a grid so that cells that touch are adjacent. To make this work the rows and columns are labelled in Gray code order (00, 01, 11, 10), not in binary order. That is why columns 3 and 2 look "swapped".

K-map layouts with minterm numbers for 2, 3 and 4 variablesK-map layouts with minterm numbers for 2, 3 and 4 variables

The map wraps around: the left edge is adjacent to the right edge, and the top edge to the bottom edge (think of the map rolled into a cylinder, or a torus for 4 variables). So in a 4-variable map, m0, m2, m8 and m10 (the four corners) are all mutually adjacent.

2. Rules for Grouping

  1. Circle only 1s (for SOP). Every 1 must be in at least one group.
  2. A group must be a rectangle containing 2k cells: 1, 2, 4, 8 or 16. No groups of 3, 5 or 6.
  3. Make every group as large as possible. A group of 2k cells eliminates k variables.
  4. Use as few groups as possible.
  5. Groups may overlap, and may wrap around the edges and corners.
  6. Do not add a group whose 1s are all already covered by other groups (it is redundant).

Reading a group: a variable that is constant across the group stays (uncomplemented if it is 1, complemented if it is 0). A variable that changes inside the group is eliminated.

Group size in a 4-variable mapLiterals in the term
1 cell4
2 cells (pair)3
4 cells (quad)2
8 cells (octet)1
16 cellsthe constant 1

3. Implicants, Prime Implicants and Essential Prime Implicants

  • An implicant is any valid group of 1s (any product term that implies F).
  • A prime implicant (PI) is a group that cannot be made larger: it is not contained in any bigger group.
  • An essential prime implicant (EPI) is a prime implicant that covers at least one 1 that no other prime implicant covers. Every EPI must appear in the minimal expression.

Systematic procedure (this is what to show in exams):

  1. Mark all prime implicants.
  2. Pick all essential prime implicants (look for 1s that only one PI can cover).
  3. If 1s remain, cover them with the fewest, largest remaining PIs.
  4. Write the sum of the chosen terms.

4. Two- and Three-Variable Maps

SolvedExample 1 · Two variables

Simplify F(A, B) = ∑ m(1, 2, 3).

  1. The 1s are in cells 01, 10 and 11.
  2. Group cells 10 and 11 (the row A = 1): term A.
  3. Group cells 01 and 11 (the column B = 1): term B.
AnswerF = A + B
SolvedExample 2 · Three variables

Simplify F(x, y, z) = ∑ m(0, 2, 4, 5, 6).

  1. Cells 0, 2, 4, 6 (columns yz = 00 and yz = 10, both rows) form a quad that wraps from the left edge to the right edge. Inside it x and y change; z = 0 always. Term: z'.
  2. Cell 5 is left. Pair it with cell 4 (row x = 1, columns 00 and 01): x = 1, y = 0, z changes. Term: xy'.
AnswerF = z' + xy'

Three-variable map for F = Σm(0, 2, 4, 5, 6)Three-variable map for F = Σm(0, 2, 4, 5, 6)

SolvedExample 3 · Two more three-variable functions

Simplify (a) F = ∑ m(2, 3, 4, 5) (b) F = ∑ m(3, 4, 6, 7).

  1. (a) Pair (2, 3) in row x = 0: x'y. Pair (4, 5) in row x = 1: xy'. So F = x'y + xy', which is x oplus y.
  2. (b) Pair (3, 7) in column yz = 11: yz. Pair (4, 6) wraps around row x = 1: xz'. So F = yz + xz'.
Answer(a) x'y + xy' (b) yz + xz'

5. Four-Variable Maps

SolvedExample 4 · An octet and two quads

Simplify F(w, x, y, z) = ∑ m(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14).

  1. The two left columns (yz = 00, 01) are all 1s: an octet where only y = 0 is constant. Term: y'.
  2. Cells 0, 2, 4, 6 (rows wx = 00, 01; columns 00 and 10, wrapping): a quad with w = 0, z = 0. Term: w'z'.
  3. Cells 4, 6, 12, 14 (rows wx = 01, 11; columns 00 and 10): a quad with x = 1, z = 0. Term: xz'.
  4. Every 1 is covered.
AnswerF = y' + w'z' + xz' (3 terms, 5 literals, from 11 minterms)

Four-variable map for F = Σm(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)Four-variable map for F = Σm(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14)

SolvedExample 5 · The four corners

Simplify F(A, B, C, D) = ∑ m(0, 2, 5, 7, 8, 10, 13, 15).

  1. Cells 0, 2, 8, 10 are the four corners, which are adjacent through the wrap-around. In them B = 0 and D = 0. Term: B'D'.
  2. Cells 5, 7, 13, 15 form a quad in the middle (rows 01, 11; columns 01, 11): B = 1, D = 1. Term: BD.
AnswerF = B'D' + BD, which is the XNOR (B oplus D)'
SolvedExample 6 · From an expression instead of minterms

Simplify F = A'B'C' + B'CD' + A'BCD' + AB'C'.

  1. Mark each term on the map. A'B'C' covers m0, m1; B'CD' covers m2, m10; A'BCD' is m6; AB'C' covers m8, m9. So F = ∑ m(0, 1, 2, 6, 8, 9, 10).
  2. Corners 0, 2, 8, 10: B'D'.
  3. Cells 0, 1, 8, 9 (rows 00 and 10, columns 00 and 01): B'C'.
  4. Cell 6 is left; pair it with cell 2 (row 00 and row 01 in column 10): A'CD'.
AnswerF = B'D' + B'C' + A'CD'

6. Essential Prime Implicants in Action

SolvedExample 7 · Choosing among prime implicants

Simplify F(A, B, C, D) = ∑ m(0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15) and identify the EPIs.

  1. Prime implicants: B'D' (0, 2, 8, 10), BD (5, 7, 13, 15), CD (3, 7, 11, 15), B'C (2, 3, 10, 11), AD (9, 11, 13, 15), AB' (8, 9, 10, 11).
  2. Essential: m0 is covered only by B'D', and m5 only by BD. So B'D' and BD are EPIs.
  3. Still uncovered: m3 and m9. m3 can be covered by CD or B'C; m9 by AD or AB'.
  4. Any one choice from each pair gives a minimal answer with 4 terms and 8 literals.
AnswerF = BD + B'D' + CD + AD (three other equally minimal answers exist, such as BD + B'D' + B'C + AB')

Prime implicants and essential prime implicants of Σm(0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15)Prime implicants and essential prime implicants of Σm(0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15)

A map with no essential prime implicant

For F(A, B, C) = ∑ m(0, 2, 3, 4, 5, 7) every 1 is covered by two prime implicants, so there is no EPI. The six PIs form a ring: A'C', A'B, BC, AC, AB', B'C'. Choosing alternately gives two different minimal answers:

F = A'C' + BC + AB' qquad or qquad F = B'C' + A'B + AC

Such a map is called cyclic. Pick any PI and the rest follow. This also shows that the minimal expression is not always unique.

⚠️ Warning

Common K-map mistakes

  • Labelling columns 00, 01, 10, 11 (binary order). Adjacent columns then differ in two bits and groups are wrong.
  • Forgetting that edges and corners wrap around.
  • Making a group of 3 or 6 cells.
  • Choosing a big group first and then needing extra groups. Always take the essential prime implicants first.

Key points to remember

  • Gray-code order (00, 01, 11, 10) makes touching cells differ in one variable; edges wrap.
  • Groups are rectangles of 2k cells; a group of 2k removes k variables.
  • PI = a group that cannot grow; EPI = a PI that alone covers some 1. EPIs are always in the answer.
  • The minimal SOP is not always unique (cyclic maps).
🎯 END-TERM EXAM PREP

📝 IPU End-Term Exam Corner (5-10 Marks)

  • Q1. Simplify F(w, x, y, z) = ∑ m(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14) using a K-map and draw the logic circuit. (5 Marks)
  • Write: the map with Gray-coded labels, the octet and two quads, the answer y' + w'z' + xz', and the AND-OR diagram.
  • Q2. Define prime implicant and essential prime implicant. Find all PIs and EPIs of F = ∑ m(0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15). (10 Marks)
  • Q3. Simplify F = A'B'C' + B'CD' + A'BCD' + AB'C'. (5 Marks)
  • Q4. Why are K-map rows and columns labelled in Gray code? What is meant by wrap-around adjacency? (2.5 Marks)
  • Q5. Show that F(A, B, C) = ∑ m(0, 2, 3, 4, 5, 7) has two different minimal SOP forms. (5 Marks)