About this tool
K-Map Solver simplifies boolean logic equations using 2-variable, 3-variable, and 4-variable Karnaugh maps. By organizing minterms in adjacency Gray-code grids (), the solver groups contiguous powers of two () to eliminate redundant literals. It computes both Minimal Sum of Products (SOP) and Minimal Product of Sums (POS), supports Don’t Care conditions (), and provides full prime implicant grouping breakdowns for digital circuit optimization.
When to use it
- Minimize combinational digital logic circuits to reduce physical gate count and propagation delay
- Check homework and exam problems for Computer Architecture and Digital Systems coursework
- Solve boolean minimization problems with Don’t Care states ()
- Compare canonical Sum of Products (SOP) and Product of Sums (POS) implementations
- Verify logic simplification proofs derived via boolean algebra theorems or De Morgan’s laws
How to use it
To solve a Karnaugh map
- Select the Number of variables:
- 2 variables (): 4 cells ( grid).
- 3 variables (): 8 cells ( grid).
- 4 variables (): 16 cells ( grid).
- Enter values into the map using either of two methods:
- Interactive grid: Click any cell to cycle through values:
01X(Don’t care)0. - Text input: Type comma-separated minterm numbers () and optional don’t cares (), then click Fill K-map from text.
- Interactive grid: Click any cell to cycle through values:
- The solver computes the minimal boolean expressions in real time:
- Minimal Sum of Products (SOP): Grouping of 1s and available Xs.
- Minimal Product of Sums (POS): Grouping of 0s and available Xs.
- Review the Prime Implicant Groupings table below the expressions to see the binary cover and covered decimal minterms for each rectangular loop.
- Click Copy SOP or Copy POS to copy the simplified expression to your clipboard.
Questions
Why does a Karnaugh map use Gray code ordering?
Standard binary counting sequences () change two bits between and . Karnaugh maps use Gray code sequences:
In Gray code, adjacent cells differ by exactly one bit (Hamming distance of 1). This ensures that any adjacent rectangular group of cells shares identical literal states, allowing the differing variable to be factored out via the boolean identity:
How are Don’t Care conditions () utilized?
Don’t care conditions represent input combinations that can never occur in normal operation or whose output value does not affect system correctness (such as invalid BCD digits through ).
- When grouping for Sum of Products (SOP), an is included in a loop of 1s if it helps form a larger rectangular power-of-two group (reducing literal count). Otherwise, it is ignored.
- When grouping for Product of Sums (POS), an is similarly included if it expands a group of 0s.
What are Essential Prime Implicants?
- A Prime Implicant is a maximal rectangular grouping of 1s (of size ) that cannot be merged into any larger power-of-two group.
- An Essential Prime Implicant is a prime implicant that covers at least one minterm that is not covered by any other prime implicant. Essential prime implicants must be included in every minimal SOP solution.