Karnaugh Map Minimization
Karnaugh Map Minimization turns a Boolean function into a visual grouping problem. You place the required output for each input combination into a grid, then combine neighbouring cells to remove variables that do not affect the output within that group. This method is especially useful for functions with two, three, or four inputs, where you can inspect the whole map directly. Here, juxtaposition means AND, + means OR, and a prime means NOT.
Arrange cells by one-bit changes
A map with n inputs contains 2n cells. For four inputs, use AB to label the rows and CD to label the columns. Both labels follow 00,01,11,10. This is Gray code: an ordering in which consecutive labels differ in exactly one bit.
Cells sharing a horizontal or vertical edge therefore differ in one input. Opposite edges also touch: the leftmost and rightmost cells in a row are neighbours, as are the top and bottom cells in a column. Diagonal contact alone does not establish adjacency.
When cells carry decimal minterm indices, read the input word as ordinary binary with A most significant. For example, ABCD=0110 identifies minterm m6. Gray code determines where that cell sits; it does not change its binary value.
Group ones to obtain product terms
For a sum-of-products expression, cover every required 1 with rectangular groups containing 1,2,4,8, or another power of two cells. Each rectangle's width and height must also be powers of two. Groups may wrap across an edge, and the four corners can form one group. A group must contain no required 0.
The governing idea is that a changing input cancels when both its values are included:
A group of 2k cells in an n-input map removes k variables, leaving n−k literals. A literal is one occurrence of an input or its complement. An implicant is a product term whose covered input combinations all permit output 1.
To read a group, keep only inputs that remain constant. Write a constant 1 input uncomplemented and a constant 0 input complemented. OR the resulting product terms together.
In the highlighted group, A=0 and B=1, while C and D each take both values. Its product term is therefore A′B.
Prefer larger valid groups because they produce shorter terms. However, consider the complete cover: choosing one large group does not necessarily finish the minimization. Groups may overlap, and a shared cell can help you form two useful large groups. Remove a group if every required 1 it covers is already covered by the remaining groups.
Grouping zeros and using don't-care cells
You can also obtain a product-of-sums expression by grouping zeros. Each zero group produces a sum term that equals zero throughout that group. Consequently, its complement rule is reversed: a constant 0 input appears uncomplemented, and a constant 1 input appears complemented. AND these sum terms together.
Map entry or approach | Grouping rule | How to read fixed inputs |
|---|---|---|
Group required ones | Include no required zeros | Fixed 0 gives X′; fixed 1 gives X |
Group required zeros | Include no required ones | Fixed 0 gives X; fixed 1 gives X′ |
Use a don't-care entry, marked X | Include it when it improves a group | It imposes no required output value |
A don't-care entry represents an input for which the specification permits either output. You may include it to enlarge a group or leave it unused. You do not need to cover every X, and separate valid minimized expressions may assign different outputs to the same don't-care input.
What to remember
- Use Gray-code labels and include adjacency across opposite edges.
- Make rectangular groups with power-of-two dimensions; overlap is allowed.
- Keep constant inputs and eliminate changing inputs.
- Cover every required output of the chosen type without including its opposite.
- Use don't-care cells only when they help the cover.
Example: Minimize a test fixture's indicator logic
A test fixture receives four digital inputs A,B,C,D. Its inspection indicator F must be 1 for decimal input codes 0, 2, 5, 7, 8, 10, 13, and 15, and 0 for every other code. Interpret each code as the binary word ABCD, with A most significant. There are no don't-care states. Logic values and literal counts are dimensionless.
a) Populate a Karnaugh map using rows AB=00,01,11,10 and columns CD=00,01,11,10.
Write 1 in every cell whose index appears in the specified list, then write 0 in each remaining cell. For example, code 13 is 1101, so its 1 belongs at row AB=11, column CD=01.
Reading each row's indices in the required column order gives:
- Row 00: indices ________ give outputs 1, 0, 0, 1.
- Row 01: indices ________ give outputs 0, 1, 1, 0.
- Row 11: indices 12, 13, 15, 14 give outputs 0, 1, 1, 0.
- Row 10: indices 8, 9, 11, 10 give outputs 1, 0, 0, 1.
The completed map contains eight ones and eight zeros, matching the specification.
b) Find the largest valid groups needed to cover all the ones, and read the product term from each group.
The four corners, at minterms 0, 2, 8, and 10, form one group because both pairs of opposite edges touch. Their input words are 0000, 0010, 1000, and 1010. Inputs A and C vary, while B=D=0. This group gives
The central four cells, at minterms 5, 7, 13, and 15, form another group. Their words are 0101, 0111, 1101, and 1111. Again, A and C vary, but now B=D=1. This group gives
Each group contains four ones. Together, the two groups cover all eight required ones without including a zero. No group of eight can be formed without including a required zero.
c) Write the minimum sum-of-products expression, count its literal occurrences, and check one on-state and one off-state.
OR the two product terms obtained from the groups:
The first term contains ________ literal occurrences, B′ and D′. The second contains ________ more, B and D. Therefore,
Because no eight-cell group is valid, every term needs at least two literals. One four-cell group cannot cover eight required ones, so at least two terms are needed. The expression attains both lower bounds: two terms and four literal occurrences.
For the required on-state 13, the input is 1101, so B=1 and D=1:
For the required off-state 12, the input is 1100, so B=1 and D=0:
These checks agree with the specified outputs. The minimum result is F=B′D′+BD, with four literal occurrences.
A four-input controller labels each Karnaugh-map cell with its minterm index, the decimal value of the binary input word ABCD. The bit A is most significant and D is least significant. Rows represent AB and columns represent CD, both in Gray-code order.
Complete the table with each cell's minterm index. Enter exact integers, which have no units. Read the row label before the column label when forming ABCD.
| AB / CD | 00 | 01 | 11 | 10 |
| 00 | ||||
| 01 | ||||
| 11 | ||||
| 10 |
A three-input status indicator has output F=1 at minterm indices 0, 2, 4, and 6, and output 0 at all other indices. Indices use the binary word ABC, with A most significant. Which expression is the minimum sum-of-products form?