How to use the K-Map Solver
- 1. Pick the variablesChoose 2, 3 or 4 variables (A is the most significant bit).
- 2. Fill the mapType minterms and don't cares, or tap cells to switch 0 → 1 → X.
- 3. SolveGet the minimal SOP, minimal POS and the groups that were used.
How the K-map is laid out
A Karnaugh map puts every input combination in a grid where neighbouring cells differ in exactly one variable. That is why the rows and columns run in Gray code order: 00, 01, 11, 10. The map also wraps around, so the left and right edges are neighbours, and so are the top and bottom.
Grouping 1s in blocks of 1, 2, 4 or 8 removes the variable that changes inside the block. Bigger groups mean fewer letters. Don't-care cells (X) can be used inside a group when they help and ignored when they do not.
Worked example
Take F(A, B, C, D) = Σm(0, 1, 2, 5, 8, 9, 10). The solver returns F = B'C' + B'D' + A'C'D:
- B'C' is a group of four: m(0, 1, 8, 9).
- B'D' is the four corners: m(0, 2, 8, 10). The corners touch because the map wraps.
- A'C'D is a pair, m(1, 5), which is needed to cover minterm 5.
The solver does not group by eye. It uses the Quine-McCluskey method to list every prime implicant, then searches for the smallest set that covers all the 1s, breaking ties by the fewest letters. So the answer is a true minimum, not just a good guess. For POS it solves the 0 cells the same way and turns each group into a sum term using De Morgan's law.
Frequently asked questions
Why is my answer different from the book but the same size?
Some functions have more than one minimal answer. If yours has the same number of terms and letters and covers the same minterms, both are correct.
What order are the variables in?
A is the most significant bit. For 4 variables minterm 5 is 0101, which means A=0, B=1, C=0, D=1.
Does it handle 5 or 6 variables?
Not yet. K-maps get hard to read beyond 4 variables. Use the truth table generator for bigger functions.
Is the K-map solver free?
Yes. Filling the map is open to all. Seeing the solution the first time asks for your name and WhatsApp number once, then every Uncodemy tool is free to use without the form.