
Written and maintained by the PhDino author · Last reviewed 21 September 2026 · Checked against 3 independent reference calculations · how PhDino checks its numbers
Why Karnaugh maps arrange their rows and columns in Gray code order, and where a given minterm actually lands.
A Karnaugh map (K-map) is a grid layout of a truth table designed to make Boolean simplification visual rather than algebraic — adjacent cells on the map are meant to differ in exactly one variable, so that groups of adjacent 1s can be spotted by eye and directly translated into simplified terms. That "one variable changes at a time" property is exactly why K-map rows and columns are labeled in Gray code order (00, 01, 11, 10) instead of ordinary binary counting order (00, 01, 10, 11) — Gray code is specifically constructed so that consecutive values differ by only one bit.
For the common 4-variable K-map, two variables (conventionally A and B) select the row and the other two (C and D) select the column — a given minterm's row and column position is found by locating its AB bits among the Gray-coded row labels and its CD bits among the Gray-coded column labels.
Gray code order for 2 bits: 00, 01, 11, 10 Row = Gray-code position of the minterm's AB bits Column = Gray-code position of the minterm's CD bits
PhDino earns a commission on qualifying purchases made through this link, at no extra cost to you.
Code: The Hidden Language of Computer Hardware and Software by Charles Petzold — Builds from switches and logic gates up to a working computer, one clear step at a time. (Bookshop.org UK, UK delivery only)
→ The full PhDino bookshelf on Bookshop.org (UK delivery only)
