Using the solver
Type the function as an expression, such as `AB + A'C`. If you have minterms instead, write each as a product: minterm 5 of three variables is 101, so it's `AB'C`. The map is drawn for two, three or four variables, with each group ringed in its own colour and the matching terms in the simplified answer.
The small number in each cell is its minterm number, so you can check the layout against your worksheet. Rows and columns run 00, 01, 11, 10, Gray code order, so neighbouring cells differ in one variable, edges included. A group that wraps from one edge to the other is drawn as its pieces, which is why the sample's corner group shows as four rings.
Grouping by hand
Ring the 1s in rectangles of 1, 2, 4, 8 or 16 cells, as large as possible, with the map treated as wrapping round at the edges. Each ring is one term: the variables that stay the same across it, and the ones that change drop out. Use as few rings as you can, overlapping is fine, and every 1 must be in at least one. A ring of two removes one variable, four removes two, eight removes three.
The solver finds the same answer with the Quine–McCluskey method, which follows the same rules without needing to see the shape. That's also what works past four variables, where maps stop being readable.
Veitch, Karnaugh and Marquand
Maurice Karnaugh published the map in November 1953, in a paper titled The Map Method for Synthesis of Combinational Logic Circuits. It refined a chart Edward Veitch had published in 1952, and Veitch's chart turned out to repeat a logical diagram Allan Marquand drew in 1881. Karnaugh's change was the Gray code ordering, which puts cells that differ in one variable next to each other so groups can be seen at a glance. Two years later, in 1956, Edward McCluskey extended Willard Quine's 1952 method into the tabular one this solver uses.
Writing an expression
Type it the way your course writes it. AND can be `·`, `*`, `&`, `&&`, `∧` or the word AND, or nothing at all, so `AB` and `A(B + C)` are ANDs. OR is `+`, `|`, `||`, `∨` or OR. NOT is a `'` after a term, as in `A'` or `(A + B)'`, or `!`, `~`, `¬` or NOT before it. XOR is `^`, `⊕` or XOR, and NAND, NOR and XNOR work as words. `0` and `1` are constants.
Single letters are variables, so `abc` means a AND b AND c. A name with a digit, mixed case or more than four letters stays whole, so `x1`, `Rain` and `sprinkler` each count as one variable. Up to eight variables fit, a table of 256 rows.
Questions
How do I solve a K-map?
Ring the 1s in the largest possible rectangles of 1, 2, 4, 8 or 16 cells, wrapping round the edges, then write one term per ring. Type the function here to check your answer.
Why are the columns 00, 01, 11, 10?
That's Gray code. Neighbouring cells differ in exactly one variable, so a ring of adjacent 1s always simplifies.
Can it solve a 5-variable K-map?
It gives the minimal answer and truth table for up to eight variables, but it only draws the map for two to four.
Can a K-map have more than one answer?
Yes. When a 1 can be covered by two equally good rings, either choice is minimal. The solver shows one.
Sources
- Wikipedia: Quine–McCluskey algorithm
- Wikipedia: Karnaugh map
- Wikipedia: A Symbolic Analysis of Relay and Switching Circuits
- Wikipedia: The Laws of Thought
Added . What's new






