Sub topic 9
Grouping Cells in a K-map
Prerequisites and grouping rules
This chapter assumes that you can convert between binary and decimal, use AND, OR, and NOT gates, and read a Boolean expression. A Karnaugh map, or K-map, is a grid that represents the rows of a truth table. It helps you simplify a Boolean function by combining adjacent cells.
Each cell represents one minterm. For sum-of-products simplification, place a 1 in every cell where the function is 1. Then group the 1s using these rules:
- Every group must contain 1, 2, 4, 8, or another power of two cells.
- Each group must form a rectangle. A rectangle may have one row or one column.
- Groups may wrap around the left and right edges or the top and bottom edges.
- Groups may overlap when overlap produces a simpler expression.
- Every 1 must belong to at least one group.
- Do not group diagonal cells. Diagonal cells differ in two variables.
K-map rows and columns use Gray code order. Gray code changes only one bit between neighboring labels. For four variables, a common layout is:
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 0 | 1 | 3 | 2 |
| 01 | 4 | 5 | 7 | 6 |
| 11 | 12 | 13 | 15 | 14 |
| 10 | 8 | 9 | 11 | 10 |
The first and last columns are adjacent because their labels, 00 and 10, differ in only one bit. The first and last rows are also adjacent.
Converting a group into a term
For SOP minimization, each group produces a product term.
- Keep a variable if its value stays constant throughout the group.
- Remove a variable if its value changes.
- Write a variable with a complement when its constant value is 0.
- Write it without a complement when its constant value is 1.
A group of two removes one variable. A group of four removes two variables. A group of eight removes three variables. Therefore, make groups as large as possible.
Consider:
F(A,B,C,D) = Σm(0,1,2,3,8,9,10,11)
These minterms fill two edge rows, AB = 00 and AB = 10. They form an octet through wraparound. Across this group, A changes, C changes, and D changes. B remains 0, so the simplified term is B'.
Common mistakes
A group of six cells is invalid because six is not a power of two. If six 1s are present, use overlapping groups such as two groups of four.
Do not assume that a group must stay inside the visible boundary. Edge cells can be combined. However, cells that touch only at a corner are not adjacent.
For product-of-sums minimization, group 0s instead of 1s. A variable fixed at 0 appears uncomplemented in the sum term, while a variable fixed at 1 appears complemented.
Exercise
Simplify F(A,B,C,D) = Σm(0,1,2,3,8,9,10,11,12,13,14,15) using K-map groups.
Show answer
Form one octet from minterms 0 through 3 and 8 through 11, giving B'. Form another octet from minterms 8 through 15, giving A. The minimal SOP is F = A + B'.