Computing Library › Classical Logic Gates
Classical Logic Gates

Karnaugh Maps

A Karnaugh map is a grid arrangement of a truth table that makes Boolean simplification a matter of grouping adjacent 1s.

What it is

A Karnaugh map, or K-map, is a truth table redrawn as a grid whose rows and columns are labeled in Gray-code order, so any two neighboring cells differ in exactly one input. Simplification becomes visual: group adjacent 1s and each group collapses to a smaller product term.

Gray-code adjacency

Kronos motion — grid 2040

Cells are ordered 00, 01, 11, 10 rather than in binary counting order. This ensures single-variable changes between neighbors, which is what lets a group of 1s eliminate the variable that changes across it. The grid also wraps: left and right edges are adjacent, as are top and bottom.

Grouping rules

Don't-care conditions

Some input combinations never occur or have no defined output. Marked with an X, these don't-cares can be treated as 1 or 0 freely, whichever makes groups larger and the expression simpler.

Reading a group

Within a group, keep the variables that stay constant and drop the ones that change. A group of two drops one variable, a group of four drops two, and so on. OR the resulting terms for the minimized function.

Limits

K-maps are ideal for three or four variables and workable at five or six with care. Beyond that, tabular methods such as Quine-McCluskey or automated logic synthesis take over.