A Karnaugh map turns truth-table output values into a layout where adjacent cells represent input combinations that differ in only one variable. By grouping neighboring 1s, you remove variables that change within each group and produce a shorter sum-of-products expression.
The reliable process is: label the map in Gray-code order, copy each truth-table output into its matching cell, form the largest valid groups, and write one product term for each group.
How is a Karnaugh map arranged in Gray-code order?
For three variables, use one variable for the rows and two for the columns. Let A label the rows and BC label the columns:
- Rows: A = 0 and A = 1
- Columns: BC = 00, 01, 11, 10
The column labels use Gray-code order. Each neighboring label changes by one bit, including the transition from the last column, 10, back to the first column, 00. Therefore, the left and right edges are adjacent. The same wraparound rule applies to the top and bottom edges in maps with more row variables.
Cells that touch along an edge are adjacent. Cells that meet only at a corner are diagonal and are not adjacent. This distinction controls which cells may form a group.
How do you fill Karnaugh maps from a truth table?
Start with the truth table’s variable order and match each input combination to its map coordinates. Place a 1 where the function output is 1 and a 0 where it is 0. For example, use this three-variable function with 1s at minterms 0, 1, 2, 4, and 6:
- BC = 00: row A = 0 has 1; row A = 1 has 1
- BC = 01: row A = 0 has 1; row A = 1 has 0
- BC = 11: row A = 0 has 0; row A = 1 has 0
- BC = 10: row A = 0 has 1; row A = 1 has 1
The resulting rows are therefore 1 1 0 1 for A = 0 and 1 0 0 1 for A = 1. Keep the labels visible while filling the map; using ordinary binary order such as 00, 01, 10, 11 would incorrectly change the adjacency pattern.
How does K-map simplification use wraparound, overlap, and power-of-two groups?
Each group must be a rectangle containing only 1s. Its size must be a power of two: 1, 2, 4, 8, or more cells. Groups may span an edge, and a 1 may belong to more than one group when overlap creates larger or simpler terms.
In this map, group the two outer columns, 00 and 10, across both rows. They are adjacent through horizontal wraparound, creating a four-cell rectangle. Across this group, A changes and B changes, but C remains 0. This group produces C′.
The remaining 1 at row A = 0, column BC = 01 can pair with the 1 at column 00 in the same row. That two-cell group overlaps the four-cell group. Within it, A remains 0 and B remains 0, while C changes, so it produces A′B′.
How do you read the simplified Boolean expression?
For every group, keep only variables whose values stay constant. Write an uncomplemented variable when it remains 1 and a complemented variable when it remains 0. Omit variables that change inside the group. Then join the retained variables within each term with AND and join the group terms with OR.
For the example:
F = C′ + A′B′
The first term covers all cells where C = 0. The second covers the remaining required 1 where A = 0 and B = 0. This is the result of the Karnaugh-map reduction, with each original 1 covered by at least one valid group.
