How to simplify a Boolean expression with a Karnaugh map

A Karnaugh map (K-map) is a visual method for minimizing Boolean expressions into a minimal sum-of-products or product-of-sums form. It applies primarily to functions of two to four variables where a truth table can be directly mapped onto a 2D grid organized by Gray code.

The setup

Construct a grid with 2n2^n cells for nn variables. Label the axes using Gray code sequence (00, 01, 11, 10) so that adjacent cells differ by exactly one bit. Place a 1 in the cells corresponding to the minterms of the Boolean expression, and a 0 in the remaining cells.

The steps

  1. Identify all 1s on the map. 2. Group adjacent 1s in rectangles of size 2k2^k (1, 2, 4, 8, etc.). Groups can wrap around the edges of the map. 3. Find the essential prime implicants by locating 1s that can only belong to a single group. 4. Cover any remaining 1s with the largest possible groups. 5. Write the logical product (AND) for each group by keeping the variables that remain constant and eliminating those that change. 6. Sum (OR) the resulting product terms.

Checking the result

Verify that every 1 on the map is covered by at least one group. Check that no group is completely contained within other groups (redundancy). Ensure that no larger power-of-two group could have been formed in place of a smaller one.

Common errors

Grouping diagonally is invalid; cells are only adjacent horizontally or vertically. Forgetting that the map wraps around from top to bottom and left to right often leads to suboptimal groupings. Forming groups that are not powers of two (like 3 or 6 cells) will yield incorrect terms.

Worked example

Simplify the Boolean function F(A,B,C)=Σm(1,3,4,6)F(A,B,C) = \Sigma m(1, 3, 4, 6) using a Karnaugh map.

The minterms are 001 (1), 011 (3), 100 (4), and 110 (6). Set up a 2-by-4 K-map with A on the vertical axis (0, 1) and BC on the horizontal axis (00, 01, 11, 10). Plot 1s in cells 001, 011, 100, and 110. Group the 1s at 001 and 011 (a 1x2 group); in this group, A=0 and C=1 are constant, while B changes, yielding the term ACA'C. Group the 1s at 100 and 110 (a 1x2 group wrapping around or horizontally adjacent depending on layout); in this group, A=1 and C=0 are constant, yielding the term ACAC'. The final simplified expression is F=AC+ACF = A'C + AC'.

FAQ

Run your own problem

References: Digital Design by M. Morris Mano · Fundamentals of Logic Design by Charles H. Roth Jr.

See also