Simplifying circuits with K-maps
The same function can be built many ways; simplifying means finding the one with the fewest gates. A Karnaugh map lays the truth table out as a grid where neighbouring cells differ in one variable, so looping neighbouring 1s cancels that variable.
- Open the K-map tab on the right — it draws the grid and loops for the current circuit.
- Sum of products: loop the 1s; each loop is an AND term and the terms are ORed together. Fewer, bigger loops are better.
- Product of sums: loop the 0s instead; each loop is an OR term and the terms are ANDed together.
- Fewest gates: allows XOR, NAND/NOR and more levels, often beating both — A̅B̅ + AB is really a single XNOR.
Tick “Edit freely” to click cells between 0, 1 and × (don't care), then “Build a circuit from this”. With several outputs, sum of products can also share AND gates between them.
The example below is a full adder — open it and compare the simplification modes in the K-map tab.