Digital Logic & Building Blocks

a Karnaugh map

/ KAR-noh /

A Karnaugh map is a hand tool for making a logic circuit smaller. You start with a truth table, but instead of a long list you redraw it as a grid where neighbouring squares differ in only one input. Once it is laid out this way, the simplifications you would have to hunt for with algebra jump out visually: any block of adjacent 1s that you can circle corresponds to a term where the inputs that changed inside the block simply do not matter and can be dropped. It is a picture that turns 'simplify this Boolean expression' into 'circle the biggest rectangles'.

The grid is arranged in Gray code order — the columns and rows are labelled 00, 01, 11, 10 (not the usual 00,01,10,11) so that any two neighbours, including the wrap-around from the last back to the first, differ in exactly one variable. You fill each cell with the output (a 1 or 0) for that input combination, then circle groups of 1s. Groups must be rectangles of size 1, 2, 4, 8 (a power of two), and bigger circles are better because they eliminate more variables: a circle covering two cells removes one input from that term, a circle of four removes two. Each circle becomes one AND term; you OR the terms. The result is a near-minimal sum-of-products expression.

Why it matters and its limits: K-maps give an intuitive, visual route to the minimization that Boolean algebra does by manipulation, and seeing the groups is far less error-prone than juggling identities. But they are a human-scale tool — they work beautifully for 2 to 4 variables, get awkward at 5 or 6, and are hopeless beyond that. For large functions, computers use systematic algorithms (like Quine-McCluskey and modern logic synthesis) instead. The honest takeaway: minimization saves gates, area, delay, and power, but the K-map is the teaching tool, not the industrial one.

A 2-variable map for the function 'A OR B' has four cells; three of them are 1 (every case except A=0,B=0). Circle the top row (both cells where A=1) and circle the left column (both cells where B=1). The first circle says 'A alone', the second says 'B alone', so the whole function reads simply A OR B — the map confirms it cannot get smaller.

Adjacent 1s that share all but one input collapse into a smaller term — the bigger the circle, the cheaper the gate.

The non-obvious rule that makes K-maps work is Gray-code ordering (00,01,11,10): if you label the grid in plain binary order, physical neighbours no longer differ by one bit and the visual grouping silently breaks.

Also called
K-mapK 圖卡諾map