A Karnaugh map, or K-map, is a grid used to simplify a Boolean expression without doing as much algebra by hand. You place the output values from a truth table on the grid, group adjacent 11s, and then write one simpler term for each group.

The condition matters: K-maps are most practical for small functions, usually with two, three, or four variables. As the number of variables grows, the map becomes harder to read and other methods are usually better.

What A Karnaugh Map Is Showing

A K-map contains the same information as a truth table, but it arranges the cells in Gray-code order instead of ordinary binary order. That arrangement makes neighboring cells differ in exactly one variable.

That one-variable difference is the whole point. If two adjacent cells are both 11, the changing variable can drop out of the simplified term.

How Grouping Removes Variables

The visual rule comes from Boolean identities such as

XY+XY=XXY + X\overline{Y} = X

The two terms differ only in YY, so YY cancels and the shared part XX remains. A K-map lets you spot that cancellation pattern directly on the grid.

Karnaugh Map Example

Suppose

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

This means F=1F=1 for minterms 11, 33, 44, 55, and 77.

For a 33-variable K-map, use AA for the rows and BCBC for the columns in Gray-code order 0000, 0101, 1111, 1010:

A\BC000111100011011110\begin{array}{c|cccc} A \backslash BC & 00 & 01 & 11 & 10 \\ \hline 0 & 0 & 1 & 1 & 0 \\ 1 & 1 & 1 & 1 & 0 \end{array}

Start with the largest valid group. The four 11s in the middle two columns form one group. In those four cells, C=1C=1 stays fixed while AA and BB change, so that group simplifies to

CC

One 11 is still uncovered: minterm 44, which is (A,B,C)=(1,0,0)(A,B,C)=(1,0,0). Pair it with adjacent minterm 55, which is (1,0,1)(1,0,1).

In that pair, A=1A=1 and B=0B=0 stay fixed while CC changes, so the pair simplifies to

ABA\overline{B}

So the simplified expression is

F(A,B,C)=C+ABF(A,B,C) = C + A\overline{B}

That shorter expression is equivalent to the original list of minterms.

Rules For Valid K-Map Groups

Use groups whose sizes are powers of two: 11, 22, 44, 88, and so on.

Use the largest valid groups you can. Larger groups usually remove more variables.

Remember that the map wraps around. The left and right edges are adjacent, and the top and bottom edges are adjacent.

Diagonal cells are not adjacent.

Overlap is allowed when it helps create a larger or simpler grouping.

Common Karnaugh Map Mistakes

Using Ordinary Binary Order

If you label rows or columns 0000, 0101, 1010, 1111, the adjacency is wrong. K-maps must use Gray-code order so neighboring cells differ by only one bit.

Making Groups Of Three

A group of three cells is never valid. The size must be a power of two.

Missing Wrap-Around Adjacency

Some of the best simplifications use cells on opposite edges of the map. If you forget the wrap-around rule, your answer is often longer than it needs to be.

Forcing Every 11 Into Exactly One Group

That is not a rule. Reusing a cell can be the best way to create a larger group and a shorter final expression.

When A Karnaugh Map Is Used

K-maps are common in digital logic and introductory computer engineering because they turn Boolean simplification into a visual process. They are especially useful when you want a simpler sum-of-products expression before drawing or implementing a logic circuit.

They are also good for intuition. Even if software handles larger designs, learning K-maps makes it easier to see why certain Boolean terms combine and others do not.

Try A Similar Problem

Try simplifying F(A,B,C)=m(0,2,4,6,7)F(A,B,C)=\sum m(0,2,4,6,7) on your own. Draw the map, make the largest valid groups first, and then keep only the variables that stay constant in each group.

If you want to go one step further, try a version with don't-care values and use them only when they help you make a larger valid group.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →