Module 1: Foundations of Digital Logic · 1.4 Karnaugh Maps & Logic Minimization

The Four-Variable Karnaugh Map

Four-variable Karnaugh maps minimize logic functions containing up to sixteen minterms. This article describes the $4 \times 4$ grid layout, the corner adjacency group, systematic minimization procedures, Product-of-Sums (POS) derivation from zero cells, and multiple minimal covers.

Four-Variable Map Layout

The 4-variable map assigns variables $AB$ to rows and variables $CD$ to columns. Both axes use Gray code coordinates ($00, 01, 11, 10$):

4-variable layout
Figure 1: Minterm cell locations in a four-variable Karnaugh map

Notice that row $AB = 11$ occupies row 3, and row $AB = 10$ occupies row 4. Similarly, column $CD = 11$ occupies column 3, and column $CD = 10$ occupies column 4.

Minterm $A$ $B$ $C$ $D$ Minterm $A$ $B$ $C$ $D$
0 0 0 0 0 8 1 0 0 0
1 0 0 0 1 9 1 0 0 1
2 0 0 1 0 10 1 0 1 0
3 0 0 1 1 11 1 0 1 1
4 0 1 0 0 12 1 1 0 0
5 0 1 0 1 13 1 1 0 1
6 0 1 1 0 14 1 1 1 0
7 0 1 1 1 15 1 1 1 1

In a 4-variable map, group dimensions scale up to 16 cells:

Group Size ($2^k$) Variables Eliminated ($k$) Resulting Literals per Term
1 0 4
2 1 3
4 2 2
8 3 1
16 4 0 (Function equals constant 1)

The Four-Corner Adjacency Group

The four extreme corner cells ($m_0, m_2, m_8, m_{10}$) share horizontal and vertical wrap-around boundaries:

  • Cell $m_0$ ($0000$) is adjacent to $m_2$ ($0010$) across columns.
  • Cell $m_0$ ($0000$) is adjacent to $m_8$ ($1000$) across rows.
  • Cell $m_2$ ($0010$) is adjacent to $m_{10}$ ($1010$) across rows.
  • Cell $m_8$ ($1000$) is adjacent to $m_{10}$ ($1010$) across columns.
Cell Index $A$ $B$ $C$ $D$
0 0 0 0 0
2 0 0 1 0
8 1 0 0 0
10 1 0 1 0

In these four cells, variables $A$ and $C$ vary. Variables $B = 0$ and $D = 0$ remain constant. Therefore, the four-corner group evaluates to product term $B’D’$.

Corner group
Figure 2: Four-corner group in F = Σm(0,2,8,10) evaluating to B'D'

Systematic Minimization Procedure

To minimize a 4-variable function:

  1. Plot logic 1 in every cell corresponding to an active minterm in the function. Set remaining cells to 0.
  2. Identify all prime implicants, searching from largest to smallest group sizes (16, 8, 4, 2, and 1). Include wrap-around boundary groups and the four-corner group.
  3. Formulate a prime implicant table listing minterms as columns and prime implicants as rows.
  4. Identify minterms that contain only one checkmark. The corresponding row is an essential prime implicant. Add every essential prime implicant to the final solution.
  5. Eliminate all minterms covered by the essential prime implicants.
  6. If uncovered minterms remain, select the minimum set of non-essential prime implicants required to cover them.
  7. Combine the selected terms using logical OR.

Worked Examples

Example 1: Eight-Cell Group ($F = \sum m(0, 1, 2, 3, 4, 5, 6, 7)$)

Worked example 1
Figure 3: Two full rows forming an eight-cell group that evaluates to A'

Rows $AB = 00$ and $AB = 01$ are filled with 1s. This forms a single group of eight cells. Variable $A = 0$ remains constant, while variables $B$, $C$, and $D$ cycle through all states and drop out.

Minimal SOP expression:

$$F = A’$$

Example 2: Eight-Cell Column Group ($F = \sum m(1, 3, 5, 7, 9, 11, 13, 15)$)

Worked example 2
Figure 4: Two central columns forming an eight-cell group that evaluates to D

Columns $CD = 01$ and $CD = 11$ are filled with 1s. This forms a single group of eight cells. Variable $D = 1$ remains constant across both columns.

Minimal SOP expression:

$$F = D$$

Deriving Product of Sums (POS) from Zero Cells

To obtain the minimal Product of Sums (POS) expression directly from a Karnaugh map, group the logic 0 cells instead of the 1 cells:

  1. Apply standard grouping rules to the zero cells to form rectangular groups of $2^k$ cells.
  2. For each group of zeros, formulate a sum term:
    • A variable constant at logic 1 appears as a complemented literal ($A’$).
    • A variable constant at logic 0 appears as an uncomplemented literal ($A$).
  3. AND all sum terms together.

Grouping the zeros
Figure 5: Grouping logic 0 cells to extract a minimal Product-of-Sums expression

For function $F = \sum m(0, 2, 8, 10)$, grouping the zero cells yields:

  • Rows 2 and 3 form a group of eight zeros ($B = 1$ constant), producing sum term $(B’)$.
  • Columns 2 and 4 across rows 1 and 4 form a group of four zeros ($D = 1$ constant), producing sum term $(D’)$.

Result:

$$F = (B’)(D’) = B’D’$$

When the off-set (zeros) forms fewer, larger groups than the on-set (ones), the POS implementation requires fewer gates than the SOP implementation.

Multiple Minimal Covers

Certain logic functions contain multiple distinct minimal covers that have identical gate and literal counts.

Consider function $F = \sum m(0, 1, 3, 5, 6, 7, 8, 9, 11, 13, 14, 15)$:

Multiple minimal covers
Figure 6: A four-variable map exhibiting multiple minimal prime implicant covers

The map contains two essential prime implicants: $B’C’$ (covers minterm 8) and $BC$ (covers minterms 6 and 14).

After selecting these essential terms, four minterms remain uncovered: 3, 5, 11, and 13. Designers can cover these four minterms using either:

  • ${ B’D, BD }$
  • ${ C’D, CD }$

Both selections produce a minimal four-term expression with eight total literals:

$$F_1 = B’C’ + BC + B’D + BD$$ $$F_2 = B’C’ + BC + C’D + CD$$

Both implementations are functionally identical and optimal.

Practice Exercises

Exercise 1: Minimize $F(A,B,C,D) = \sum m(0, 1, 4, 5, 10, 11, 14, 15)$.

View Solution

Problem 1
Figure 7: Two groups of four cells covering the top-left and bottom-right blocks

  1. Group 1 (Top-left $2 \times 2$ block covering minterms 0, 1, 4, and 5): Rows $AB = 00, 01$ share $A = 0$. Columns $CD = 00, 01$ share $C = 0$. Yields term $A’C’$.
  2. Group 2 (Bottom-right $2 \times 2$ block covering minterms 10, 11, 14, and 15): Rows $AB = 11, 10$ share $A = 1$. Columns $CD = 11, 10$ share $C = 1$. Yields term $AC$.

Both prime implicants are essential. Minimal SOP equation:

$$F = A’C’ + AC = \overline{A \oplus C}$$

This circuit implements the XNOR function between $A$ and $C$.

Exercise 2: Minimize $F(A,B,C,D) = \sum m(3, 7, 11, 12, 13, 14, 15)$.

View Solution

Problem 2
Figure 8: Intersection of a full row group and a full column group

  1. Group 1 (Full row $AB = 11$ covering minterms 12, 13, 14, and 15): Yields term $AB$.
  2. Group 2 (Full column $CD = 11$ covering minterms 3, 7, 11, and 15): Yields term $CD$.

Minterms 12, 13, and 14 are covered only by Group 1. Minterms 3, 7, and 11 are covered only by Group 2. Both groups are essential prime implicants.

Minimal SOP equation:

$$F = AB + CD$$

← Two- and Three-Variable Karnaugh Maps Don't-Care Conditions →