01 / 22
1 0 1 1

Karnaugh Maps
Introduction

Learn how to simplify Boolean expressions visually using Karnaugh maps: the elegant grid-based method that replaces tedious algebraic manipulation.

Discrete Math

What Is a Boolean Expression?

A Boolean expression is a mathematical statement that evaluates to either true (1) or false (0). It combines variables using three fundamental operations:

AND ( \(\cdot\) )
Output is 1 only when both inputs are 1: \(A \cdot B\)
OR ( + )
Output is 1 when at least one input is 1: \(A + B\)
NOT ( \(\overline{\phantom{A}}\) )
Flips the value: \(\overline{A}\) turns 1 into 0 and vice versa

The Simplification Problem

Boolean expressions can be simplified using algebraic laws (De Morgan's, distribution, absorption). But with three or more variables, algebraic simplification becomes error-prone and tedious. You may not even know when you have reached the simplest form.

Long & Complex Simplified
\(F = AB + AC + ABC + A\overline{B}C\)
\(F = A\)
K-maps make this visual and systematic

What Is a Karnaugh Map?

A Karnaugh map is a grid of cells where each cell represents one row of a truth table. The rows and columns are labeled with variable values arranged in Gray code order, so that adjacent cells differ by exactly one variable.

2-Variable K-map B 0 1 A 0 1 m0 m1 m2 m3 3-Variable K-map BC 00 01 11 10 A 0 1 m0 m1 m3 m2 m4 m5 m7 m6 ★ Columns use Gray code: 00, 01, 11, 10 Adjacent cells differ by exactly one bit This includes wraparound: first and last columns are adjacent!

Why Gray Code Order?

The key insight behind K-maps is that adjacent cells differ by exactly one variable. This means grouping adjacent 1s in the map corresponds to eliminating that variable from the expression.

Gray Code
00 → 01 → 11 → 10. Each step flips only one bit. This is not normal binary counting!
Adjacency Rule
If two adjacent cells both contain 1, the variable that differs between them can be eliminated.

Truth Table → K-Map

Every truth table has a direct mapping to a Karnaugh map. Each row of the truth table corresponds to exactly one cell in the K-map grid.

Truth Table A B F 0 0 0 0 1 1 1 0 0 1 1 1 K-Map B 0 1 A 0 1 0 1 0 1 Grouped column: B=1 always
\(F = B\)

The Core Rule: Grouping

The fundamental operation in a K-map is grouping adjacent 1s. Each group eliminates variables, producing a simpler product term.

1
Groups must be rectangular and contain \(2^n\) cells: 1, 2, 4, 8, or 16.
2
All cells in a group must contain 1. No zeros allowed inside any group.
3
Groups can wrap around edges of the map: left-right and top-bottom.
4
Make groups as large as possible. Larger groups eliminate more variables.
5
Every 1 must be in at least one group. Groups may overlap.

Group Size → Simplification

Each doubling of group size eliminates one variable from the product term. In an \(n\)-variable K-map:

Group Size Variables Eliminated Variables Remaining Term Complexity
1 cell 0 \(n\) Full minterm
2 cells 1 \(n - 1\) Simpler
4 cells 2 \(n - 2\) Much simpler
8 cells 3 \(n - 3\) Very simple
\(2^n\) cells \(n\) 0 \(F = 1\)

K-Map vs Boolean Algebra

Feature K-Map Boolean Algebra
Method Visual pattern recognition Symbolic manipulation
Guarantee Always finds minimal SOP May miss simplifications
Speed (2-4 vars) Fast Moderate
Scalability Best for \(\leq 4\) variables Any number of variables
Error-prone? Low (visual check) Higher (algebraic steps)

How to Use a K-Map

1
Draw the grid. Label rows and columns with Gray code values for each variable group.
2
Fill in the cells. Place a 1 in each cell where the output is true, 0 otherwise.
3
Form groups. Circle adjacent 1s in rectangular groups of \(2^n\) cells. Prioritize the largest possible groups.
4
Read each group. For each group, identify which variables stay constant: these form one product term.
5
OR the terms. Combine all product terms with OR (+) to get the final Sum of Products (SOP) expression.

Example 1: 2-Variable K-Map

Simplify: \(F(A,B) = \sum m(1, 2, 3)\)

B 0 1 A 0 1 0 1 1 1 Group 1: B=1 → B Group 2: A=1 → A
\(F = A + B\)
Two overlapping groups of 2 → two single-variable terms

Example 2: 3-Variable K-Map

Simplify: \(F(A,B,C) = \sum m(0, 2, 4, 6)\)

BC 00 01 11 10 A 0 1 1 0 0 1 1 0 0 1 Both groups share C=0 (columns 00 and 10) A changes, B changes → both eliminated
\(F = \overline{C}\)

Example 3: Multiple Groups

Simplify: \(F(A,B,C) = \sum m(1, 3, 5, 7)\)

BC 00 01 11 10 A 0 1 0 1 1 0 0 1 1 0 One group of 4: A changes, B changes, C=1 always
\(F = C\)

The 4-Variable K-Map

With four variables \(A, B, C, D\), the K-map becomes a 4×4 grid. Both rows AND columns use Gray code ordering. Wraparound applies in all directions.

CD 00 01 11 10 AB 00 01 11 10 m0 m1 m3 m2 m4 m5 m7 m6 m12 m13 m15 m14 m8 m9 m11 m10 ★ Top row is adjacent to bottom row; left column to right column

Example 4: 4-Variable K-Map

Simplify: \(F(A,B,C,D) = \sum m(0, 2, 8, 10)\)

CD 00 01 11 10 AB 00 01 11 10 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 4 corners wrap around → group of 4: B=0, D=0
\(F = \overline{B} \cdot \overline{D}\)

Common Mistakes to Avoid

✕ Non-Power-of-2 Groups
Groups of 3, 5, or 6 are never valid. Only sizes 1, 2, 4, 8, and 16 are allowed.
✕ Binary Order
Using 00, 01, 10, 11 instead of Gray code (00, 01, 11, 10) destroys the adjacency property.
✕ Forgetting Wraparound
The first and last columns (and rows) are adjacent. Missing corner groups leads to non-minimal results.
✕ Undersized Groups
Always use the largest possible group. Two groups of 2 where a group of 4 exists wastes simplification potential.

K-Map Summary

Variables Grid Size Total Cells Max Group
2 \(2 \times 2\) 4 4
3 \(2 \times 4\) 8 8
4 \(4 \times 4\) 16 16

Question 1 of 5

In a Karnaugh map, which numbering system is used to label the rows and columns?

Question 2 of 5

Which of the following is a valid group size in a Karnaugh map?

Question 3 of 5

In a 3-variable K-map, a group of 4 adjacent cells eliminates how many variables?

Question 4 of 5

On a 4-variable K-map, the four corner cells (m0, m2, m8, m10) form a valid group because:

Question 5 of 5

Using a 2-variable K-map for \(F(A,B) = \sum m(1,3)\), what is the simplified expression?