A 4-variable Boolean function has 16 possible input combinations, so its K-Map contains 16 cells arranged as a 4×4 grid.
The method is the same as with smaller maps, but the extra cells create more adjacency, overlap, and wrap-around possibilities. That makes accurate placement especially important.
What Does a 4-Variable K-Map Look Like?
A 4-variable K-Map normally uses four variables:
A, B, C, D
A common arrangement uses:
- AB for the rows
- CD for the columns
Both axes follow Gray code order:
00, 01, 11, 10
That creates a 4×4 grid containing all 16 possible input combinations.
Gray code matters because adjacent labels differ by only one bit.
4-Variable K-Map Cell Numbering
Minterm numbers come from the binary ABCD input value, but their visual locations are rearranged by the Gray-code axes.
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | m0 | m1 | m3 | m2 |
| 01 | m4 | m5 | m7 | m6 |
| 11 | m12 | m13 | m15 | m14 |
| 10 | m8 | m9 | m11 | m10 |
A common mistake is writing:
m0, m1, m2, m3
straight across the first row.
That is wrong for a standard K-Map because the column order is:
00, 01, 11, 10
not ordinary binary:
00, 01, 10, 11
How to Fill a 4-Variable K-Map
Filling the map is a direct translation process.
- Start from the truth table or minterm/maxterm list.
- Find the corresponding cell for each combination.
- Put 1, 0, or X into the correct cell.
- Preserve the original required output.
- Begin grouping only after the map is filled correctly.
If you are starting from a truth table, see how to convert a truth table to a Karnaugh Map.
Valid Group Sizes
For a 4-variable K-Map, valid group sizes are:
1, 2, 4, 8, 16
- A group of 2 is a pair.
- A group of 4 is a quad.
- A group of 8 is an octet.
A full 16-cell group can occur when the entire map is eligible for the chosen grouping. For SOP, an all-1/usable-X map can simplify to 1; for POS, an all-0/usable-X map can simplify to 0.
Groups must remain valid power-of-two rectangular regions under K-Map adjacency.
- Overlap is allowed.
- Wrap-around is allowed.
- Diagonal-only adjacency is not.
For the full geometric rules, see the Karnaugh Map grouping rules guide.
Why the Four Corners Are Adjacent
The four corner cells are m0, m2, m8, m10. The four-corner group often looks unusual because the cells are visually separated, yet together they form one valid quad. Across all four cells B = 0 and D = 0, while A and C take every combination, so the group simplifies to:
B'D'
The logic comes from edge wrapping.
The leftmost and rightmost columns are adjacent.
The top and bottom rows are also adjacent.
The four corners sit where both wrap-around relationships meet.
They do not form a group because diagonals are neighbours.
Diagonal cells remain non-adjacent.
In the left panel of the figure below, the corners belong to a function whose remaining 1s, m5, m7, m13, m15, form an ordinary 2×2 block. That block gives BD, so that function simplifies to B'D' + BD. The right panel shows a different function, the one used in Worked Example 1.

Two separate examples. Left: the corners m0, m2, m8 and m10 of F = Σm(0, 2, 5, 7, 8, 10, 13, 15) group as B'D' through wrap-around. Right: the top and bottom rows of F = Σm(0, 1, 2, 3, 8, 9, 10, 11) group as B'. Diagonal adjacency is never required.
Worked Example 1: An 8-Cell Wrap-Around Group
Consider:
F(A,B,C,D) = Σm(0,1,2,3,8,9,10,11)
These eight minterms fill:
AB = 00
and:
AB = 10
Those are the top and bottom rows of the Gray-code map.
Although they appear separated on the flat grid, the top and bottom edges are logically adjacent.
The two rows therefore form one valid octet.
Across the entire eight-cell group:
- B = 0
while:
- A changes
- C changes
- D changes
The changing variables disappear.
The result is:
F = B'
Worked Example 2: Overlapping an Octet and a Quad
Now add two more 1s to the function above, at m6 and m14:
F(A,B,C,D) = Σm(0,1,2,3,6,8,9,10,11,14)
That is ten required 1s. The six remaining cells, m4, m5, m7, m12, m13, m15, are 0.
Fill the Map
Using the numbering table earlier in this article, with rows AB and columns CD both in Gray-code order, the ten 1s sit like this:
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 1 | 1 | 1 | 1 |
| 01 | 0 | 0 | 0 | 1 |
| 11 | 0 | 0 | 0 | 1 |
| 10 | 1 | 1 | 1 | 1 |
The new cells are m6, in row 01 and column 10, and m14, in row 11 and column 10. Notice that m6 and m14 are not in numerical order down that column: the column reads m2, m6, m14, m10 from top to bottom.
Choose the Groups
- Group 1, the octet
m0, m1, m2, m3, m8, m9, m10, m11: rows AB = 00 and AB = 10. These are the top and bottom rows, which are adjacent through wrap-around, and all eight cells are 1. B is 0 across the group, while A, C and D take every combination, so the term isB'. - Group 2, the quad
m2, m6, m10, m14: the whole column CD = 10. It is a column of four, so it needs no wrap-around to be valid. C stays 1 and D stays 0, while A and B take every combination, so the term isCD'.
The next table marks which group covers each 1. G1 is the octet, G2 is the quad and 0 is a cell that no group may touch.
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | G1 | G1 | G1 | G1+G2 |
| 01 | 0 | 0 | 0 | G2 |
| 11 | 0 | 0 | 0 | G2 |
| 10 | G1 | G1 | G1 | G1+G2 |
The cells m2 and m10 belong to both groups. That overlap is allowed and useful. Without it, the column group would have to shrink to the pair m6, m14, which gives BCD' with three literals instead of two.
Overlap does not create extra required minterms. The two groups hold 8 + 4 = 12 cell memberships, but m2 and m10 are each counted twice, so they cover 12 − 2 = 10 distinct cells. That is exactly the ten required 1s.
Write the Result
Adding the two terms gives:
F = B' + CD'
That is 2 terms and 3 literals.
Check the Result
The expression is 1 when B = 0, or when C = 1 and D = 0. It is therefore 0 only when B = 1 and the pair CD is not 10, which is exactly the six cells m4, m5, m7, m12, m13, m15. Every required 1 is covered and no 0 is included.
You can also confirm that nothing smaller exists. Neither group can grow: the octet cannot become the whole map because the map contains 0s, and the quad cannot absorb a neighbouring column, because columns CD = 11 and CD = 00 each contain 0s. So B' and CD' are the only prime implicants. Both are essential, since m0 is covered only by B' and m6 only by CD', so every valid cover needs both of them. The Karnaugh Map Solver ranks covers by fewest terms and then fewest literals, and this cover, with 2 terms and 3 literals, is the one it reports.
Reproduce It in the Solver
In the Karnaugh Map Solver, choose 4 variables, select the Minterms input, enter 0, 1, 2, 3, 6, 8, 9, 10, 11, 14 and press Apply. The SOP result should read B' + CD'. The map should show one highlighted group across the top and bottom rows and another down the CD = 10 column, overlapping at m2 and m10.
What About Overlapping Groups?
Overlap is valid in a 4-variable K-Map.
A required cell can belong to more than one group when that helps cover the function using better valid groups.
Do not avoid overlap simply because a cell was already used once.
Worked Example 2 shows this: the cells m2 and m10 belong to both the octet and the column quad, and that shared pair is what lets the quad stay at four cells.
At the same time, overlap should serve a purpose rather than being added unnecessarily. A group whose required cells are all covered by other groups can be dropped. The grouping rules guide has an example where a large quad turns out to be redundant.
Using Don’t-Care Values in a 4-Variable K-Map
Don't-care X values follow the same rules as in smaller maps.
For SOP, an X may be used like a 1 when it helps form a useful larger group.
For POS, it may be used like a 0.
If it provides no benefit, ignore it.
A well-placed X might turn:
- a pair into a quad
- or a quad into an octet
For more detail, see the guide to don't-care conditions in Karnaugh Maps.
SOP and POS with Four Variables
The basic distinction stays the same.
- SOP: group the required 1 cells.
- POS: group the required 0 cells.
The same 4×4 layout, Gray-code ordering, wrap-around rules, and power-of-two group sizes apply to both.
For a deeper comparison, see SOP vs POS in Karnaugh Maps.
Common 4-Variable K-Map Mistakes
- Using ordinary binary axis order 00, 01, 10, 11 instead of Gray code.
- Placing minterms in numeric order across each row.
- Treating diagonal cells as adjacent.
- Forgetting that opposite edges wrap.
- Missing the four-corner quad.
- Creating groups of 3 or 6.
- Using several small groups when a larger useful valid group could reduce terms or literals.
- Refusing to overlap groups when overlap improves the cover.
- Shrinking a group to avoid overlap, for example using only
m6, m14instead of the full columnm2, m6, m14, m10in Worked Example 2. - Forcing don't-care cells into groups.
- Mixing SOP and POS grouping rules.
A Quick 4-Variable K-Map Checklist
- Start with a 4×4 grid.
- Label both axes 00, 01, 11, 10.
- Place minterms in their Gray-code positions.
- Fill every cell with 0, 1, or X.
- Decide whether the result is SOP or POS.
- Look for useful octets and large quads.
- Check opposite edges and all four corners.
- Allow overlap when it improves the cover.
- Derive terms from variables that stay constant.
- Verify the simplified result against the original function.
How to Verify a 4-Variable Result
A correct simplified expression must reproduce the original required output for all 16 input combinations.
Manual checking is possible because there are only 16 combinations, although it can become tedious.
You can also compare your manual grouping with the Karnaugh Map Solver and compare your manual result with the solver's minimized result. For higher-variable functions, explore how two linked 4×4 maps combine in our guide on the 5-variable Karnaugh Map, or see how automated tabular reduction works in our Quine-McCluskey method comparison.
Frequently Asked Questions
How many cells are in a 4-variable K-Map?
A 4-variable K-Map contains 16 cells arranged as a 4×4 grid.
What is the Gray-code order for a 4-variable K-Map?
The usual row and column order is 00, 01, 11, 10 so adjacent labels differ in only one bit.
How are minterms arranged in a 4-variable K-Map?
Their positions come from the binary ABCD values mapped onto Gray-code row and column axes. For example, m3 = 0011 sits in row AB=00 and column CD=11.
Can the four corners form one group?
Yes. They form a valid quad through simultaneous horizontal and vertical edge wrap-around, not through diagonal adjacency.
Can 4-variable K-Map groups overlap?
Yes. A required cell may belong to multiple valid groups when overlap helps create a simpler cover.
How do don't-care values work in a 4-variable K-Map?
An X may be used like 1 for SOP or like 0 for POS when it improves a valid group. Otherwise, it can be ignored.
Can the top and bottom rows of a 4-variable K-Map form one group?
Yes, when all eight cells are eligible. The top and bottom edges are adjacent through wrap-around, so rows AB = 00 and AB = 10 form an octet in which B stays 0 and A, C and D drop out.

