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 s, 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 , the changing variable can drop out of the simplified term.
How Grouping Removes Variables
The visual rule comes from Boolean identities such as
The two terms differ only in , so cancels and the shared part remains. A K-map lets you spot that cancellation pattern directly on the grid.
Karnaugh Map Example
Suppose
This means for minterms , , , , and .
For a -variable K-map, use for the rows and for the columns in Gray-code order , , , :
Start with the largest valid group. The four s in the middle two columns form one group. In those four cells, stays fixed while and change, so that group simplifies to
One is still uncovered: minterm , which is . Pair it with adjacent minterm , which is .
In that pair, and stay fixed while changes, so the pair simplifies to
So the simplified expression is
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: , , , , 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 , , , , 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 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 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 →