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

Two- and Three-Variable Karnaugh Maps

This article demonstrates Boolean logic minimization using two-variable and three-variable Karnaugh maps. It defines standard grouping rules, prime implicants, and essential prime implicants.

Two-Variable Karnaugh Map

A two-variable function $F(A,B)$ contains four minterms. The map forms a $2 \times 2$ grid with row coordinate $A$ and column coordinate $B$:

2-variable layout
Figure 1: Two-variable Karnaugh map layout showing minterm assignments m0 through m3

Example: Minimize $F(A,B) = \sum m(1, 2, 3)$

Plot the logic 1s into the map:

F = Σm(1,2,3)
Figure 2: Karnaugh map for F = Σm(1,2,3) showing two overlapping groups of two cells

  1. Group 1 (Right column covering minterms 1 and 3): Coordinate $B = 1$ remains constant, while $A$ transitions between 0 and 1. Yields term $B$.
  2. Group 2 (Bottom row covering minterms 2 and 3): Coordinate $A = 1$ remains constant, while $B$ transitions between 0 and 1. Yields term $A$.
  3. Cell $m_3$ is shared between both groups to maximize group dimensions.

Minimal Sum of Products (SOP) expression:

$$F = A + B$$

Algebraic verification:

$$A’B + AB’ + AB = A’B + A(B’ + B) = A’B + A = A + B$$

Three-Variable Karnaugh Map

A three-variable function $F(A,B,C)$ contains eight minterms arranged in a $2 \times 4$ grid. Row coordinate $A$ occupies the vertical axis. Column coordinates $BC$ occupy the horizontal axis in Gray code order ($00, 01, 11, 10$):

3-variable layout
Figure 3: Three-variable Karnaugh map layout showing Gray code column coordinates and minterm positions

Notice that column coordinate $BC = 11$ occupies the third column, and coordinate $BC = 10$ occupies the fourth column. This sequence preserves single-variable adjacency between all adjacent columns, including the wrap-around boundary between column 4 and column 1.

Grouping Rules

To ensure valid algebraic reduction, groups must satisfy these rules:

  1. Groups must contain only cells with value 1.
  2. Groups must form rectangular or square geometric blocks. Non-rectangular shapes (such as L-shapes or diagonal patterns) are invalid.
  3. Group sizes must equal powers of two: 1, 2, 4, or 8 cells. Groups of 3 or 6 cells are invalid.
  4. Cells can belong to multiple groups to maximize group dimensions.
  5. Groups can wrap across horizontal and vertical grid boundaries.
  6. Always form the largest possible groups of $2^k$ cells to minimize literal counts.

Prime Implicants and Essential Prime Implicants

  • Prime Implicant (PI): A rectangular group of $2^k$ logic 1 cells that cannot combine into a larger valid group.
  • Essential Prime Implicant (EPI): A prime implicant that contains at least one logic 1 cell that is not covered by any other prime implicant. Essential prime implicants must appear in the final minimal expression.

Minimization Procedure:

  1. Identify all prime implicants on the grid.
  2. Select all essential prime implicants.
  3. If uncovered logic 1 cells remain, select the minimum number of remaining prime implicants required to cover them.

Worked Examples

Example 1: Full Row Group ($F = \sum m(0, 1, 2, 3)$)

Worked example 1
Figure 4: A single group of four cells covering the top row of a three-variable map

The entire top row contains logic 1s. This forms a single group of four cells ($2^2$ cells).

In this group:

  • Row variable $A$ remains constant at 0.
  • Column variables $B$ and $C$ cycle through all four binary states and drop out.

The group evaluates to $A’$. This is the sole essential prime implicant:

$$F = A’$$

Example 2: Adjacent Columns ($F = \sum m(1, 3, 5, 7)$)

Worked example 2
Figure 5: A single group of four cells covering columns BC = 01 and BC = 11

Logic 1s occupy columns $BC = 01$ and $BC = 11$ across both rows. This forms a single group of four cells.

Evaluate constant variables:

  • Variable $A$ transitions from 0 to 1.
  • Column variable $B$ transitions from 0 (in column 01) to 1 (in column 11).
  • Column variable $C$ remains constant at 1 in both columns.

The group evaluates to $C$:

$$F = C$$

Example 3: Boundary Wrap-Around Group ($F = \sum m(0, 2, 4, 5, 6, 7)$)

Worked example 3
Figure 6: A full row group and a boundary wrap-around column group

  1. Group 1 (Bottom row covering minterms 4, 5, 6, and 7): Contains four cells where $A = 1$ remains constant. Yields term $A$.
  2. Group 2 (Outer columns $BC = 00$ and $BC = 10$ covering minterms 0, 2, 4, and 6): Columns 1 and 4 are geometrically adjacent across the boundary. Variable $C = 0$ remains constant in both columns. Yields term $C’$.
Prime Implicant Minterm Cells Term Expression Classification
P1 4, 5, 6, 7 $A$ Essential (covers $m_5$)
P2 0, 2, 4, 6 $C'$ Essential (covers $m_0$)

Both prime implicants are essential and cover all six minterms:

$$F = A + C’$$

Practice Exercises

Exercise 1: Minimize $F(A,B,C) = \sum m(0, 3, 4, 7)$ using a Karnaugh map.

View Solution

Problem 1
Figure 7: K-map for F = Σm(0,3,4,7) showing two isolated groups of two cells

Logic 1 cells occupy columns $BC = 00$ ($m_0, m_4$) and $BC = 11$ ($m_3, m_7$). Columns 00 and 11 differ by two variables and are not adjacent.

  1. Group 1 (cells 0 and 4 in column 00): Variable $BC = 00$ remains constant. Yields $B’C’$.
  2. Group 2 (cells 3 and 7 in column 11): Variable $BC = 11$ remains constant. Yields $BC$.

Minimal SOP expression:

$$F = B’C’ + BC = \overline{B \oplus C}$$

This implements the XNOR operation between $B$ and $C$.

Exercise 2: Minimize $F(A,B,C) = \sum m(2, 3, 6, 7)$ using a Karnaugh map.

View Solution

Problem 2
Figure 8: K-map for F = Σm(2,3,6,7) showing a group of four cells

Logic 1 cells occupy columns $BC = 11$ and $BC = 10$ across both rows (four cells total).

In these two columns, variable $B = 1$ remains constant, while variables $A$ and $C$ vary.

Minimal SOP expression:

$$F = B$$

← Principles of Karnaugh Maps The Four-Variable Karnaugh Map →