Home / Learn Chip Programming / Karnaugh Maps Step by Step
Karnaugh Maps Step by Step
A K-map is a picture of a truth table that makes simplification visual.
Theory in plain words
What it is
Cells are ordered in Gray code so neighbours differ by one input. Circle groups of 1, 2, 4 or 8 ones; each group drops the variables that change.
Why we use it
It is the fastest hand method to simplify logic of up to 4 inputs. It also builds the intuition that synthesis tools use.
How it works
Fill 1s from the truth table. Make the biggest possible groups (powers of two, rectangles, wrapping around edges). Each group gives one product term; OR the terms.
Where it is used
- Designing small controllers and decoders
- Exam questions and interviews
- Understanding how tools optimise logic
3 variable K-map minimiser
Try 1s at 3, 7 (BC = 11): the result is B C. Try the whole row A = 1: result is A. Groups of two cells drop one variable, groups of four drop two.
Worked example
Truth table 1s at ABC = 011, 111, 101, 110. On the K-map the cells 011 and 111 form a group (BC), 101 and 111 form a group (AC), 110 and 111 form a group (AB). Result: Y = AB + AC + BC, the "majority" function (output is 1 if at least two inputs are 1).
Quick quiz
1. How are K-map columns ordered?
Gray order makes neighbours differ by one input.
2. A group of 4 ones removes how many variables?
Group size 2^k removes k variables.
Common questions
How are K-map columns ordered?
Gray code order. Gray order makes neighbours differ by one input.
A group of 4 ones removes how many variables?
2. Group size 2^k removes k variables.