Karnaugh Map Simplifier
Simplify small Boolean functions with 2, 3, and 4 variable Karnaugh maps. Enter minterms, add optional don't-care terms, or convert a Boolean expression into a K-map workflow.
DIG-003 focuses on Boolean-level SOP minimization. It does not perform FPGA mapping, propagation-delay optimization, power analysis, or physical gate placement.
Engineering tool
Karnaugh Map Simplifier
Simplify 2, 3, and 4 variable Boolean logic with Karnaugh maps, minterms, don't-care terms, and deterministic SOP grouping.
V1 supports 2, 3, and 4 variable Karnaugh maps.
Enter comma-separated minterms, for example: 1,3,5,7 or Σm(1,3,5,7).
Optional comma-separated don't-care cells, for example: 0,2 or d(0,2).
Result console
- Simplified SOP
- C
- Variables
- 3
- Minterms
- 1, 3, 5, 7
- Don't Cares
- None
- Groups
- 1
- Verification
- Equivalent
Karnaugh map grid
| A \ BC | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0m0 | 1m1 | 1m3 | 0m2 |
| 1 | 0m4 | 1m5 | 1m7 | 0m6 |
Grouping
| Term | Group Size | Cells Included | Type |
|---|---|---|---|
| C | 4 | m1, m3, m5, m7 | Essential Prime Implicant |
Formula reference
Karnaugh Map Simplification Rules
K-map simplification groups adjacent 1 cells in Gray-code order and creates a reduced sum-of-products expression.
Valid group sizes = 1, 2, 4, 8, 16K-map adjacency uses Gray codeSOP = ProductTerm1 + ProductTerm2 + ...A changing variable inside a group is removedDon't-care cells may expand groupsVerification: original truth table = simplified SOP truth tableVariable definitions
- Minterm
- truth-table row where output is 1
- Don't-care
- input condition that may be treated as 0 or 1
- Prime implicant
- group that cannot be expanded further
- Essential prime implicant
- group required to cover a unique minterm
- SOP
- sum of products form
- Gray code
- ordering where adjacent labels differ by one bit
Worked Examples
2-variable AND
Σm(3) simplifies to AB.
2-variable OR
Σm(1,2,3) simplifies to A + B.
XOR
Σm(1,2) remains A'B + AB' because no larger adjacent group covers both 1s.
3-variable majority
Σm(3,5,6,7) simplifies to AB + AC + BC.
4-variable wrap-around
Σm(0,2,8,10) uses edge wrapping and simplifies to B'D'.
Minterms 1,3,5,7
A full column group in a 3-variable map simplifies to C.
Don't-care grouping
Σm(1,3) with d(5,7) can simplify to C by using don't-care cells.
Expression simplification
(A & B) | (A & C) converts to minterms and verifies equivalent SOP output.
Fully minimized case
All minterms in a map simplify to logic 1.
No simplification possible
XOR-style isolated cells remain separate product terms.
Engineering Notes
- Karnaugh maps are a visual Boolean minimization method for small logic functions.
- Adjacent groups must contain 1, 2, 4, 8, or 16 cells.
- K-map rows and columns use Gray-code order, not normal binary counting order.
- Groups may wrap around the left and right edges or top and bottom edges.
- Groups may overlap when that produces a smaller final SOP expression.
- Don't-care cells may be used to enlarge groups, but they are not required output cells.
- An essential prime implicant covers a required minterm that no other group covers.
- A simpler SOP expression can reduce gate count, but it does not guarantee fastest hardware timing.
Common Mistakes
- Using binary order instead of Gray-code order.
- Forgetting wrap-around adjacency.
- Treating don't-care terms as required 1 outputs.
- Grouping cells in sizes that are not powers of two.
- Missing overlapping groups that reduce the final expression.
- Confusing SOP and POS forms.
- Assuming the fewest Boolean terms always produce the fastest circuit.
- Using K-map simplification as a substitute for timing analysis.
Support reference
FAQ
What is a Karnaugh map?
A Karnaugh map is a visual Boolean simplification method that arranges truth-table cells so adjacent cells differ by only one variable.
How does K-map simplification work?
Adjacent 1 cells are grouped in powers of two. Each group removes variables that change inside the group and produces a simpler SOP term.
How many variables can K-map handle?
This calculator supports 2, 3, and 4 variable Karnaugh maps. Larger maps are usually better handled with formal minimization tools.
What are minterms?
Minterms are truth-table row numbers where the Boolean function output is 1.
What are don't-care conditions?
Don't-care terms are input combinations that may be treated as either 0 or 1 to create larger groups and simpler logic.
What is a prime implicant?
A prime implicant is a group that cannot be expanded into a larger valid group while still covering only 1 or don't-care cells.
What is an essential prime implicant?
An essential prime implicant covers at least one required minterm that no other prime implicant covers.
Why does K-map use Gray code?
Gray-code ordering ensures adjacent cells differ by one variable, which is the condition required for valid Boolean grouping.
Can K-map simplify XOR logic?
K-map can represent XOR logic, but XOR often does not reduce well in SOP form because its 1 cells are not adjacent in a way that forms larger groups.
Does K-map optimize hardware timing?
No. K-map simplification reduces Boolean terms. It does not model propagation delay, fanout, hazards, routing, or physical implementation timing.
Related Calculators
Logic Gate Truth Table Calculator
AvailableGenerate truth tables and compare standard logic gate behavior.
Open calculatorBoolean Logic Calculator
AvailableEvaluate Boolean expressions, generate truth tables, and compare expression equivalence.
Open calculatorBinary Arithmetic Calculator
Coming_SoonPlanned calculator for binary addition, subtraction, signed arithmetic, and overflow.
Flip-Flop Calculator
Coming_SoonPlanned calculator for SR, JK, D, and T flip-flop state transitions.
Related Engineering Guides
Planned Guide
Karnaugh Map Explained
Planned Guide
Boolean Minimization Methods
Planned Guide
SOP and POS Logic
Planned Guide
