Using the solver
Type the function as an expression, such as AB + A'C. If you have minterms instead, type the list, such as Σm(1, 3, 5) or just m(1,3,5). Add don't cares with + d(0, 2), and use ΠM(0, 2) for maxterms. The variables are A, B, C and so on, as many as the largest number needs. To set them yourself, start with F(A, B, C, D) =. The map is drawn for two, three or four variables, with each group ringed in its own color 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 neighboring 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. Three 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. Implication is ->, →, => or IMPLIES, and if-and-only-if is <->, ↔, ≡, == or IFF. A leading F = just names the output. 0 and 1 are constants.
Single letters are variables, so abc means a AND b AND c, and ABCDE is five variables. A name with a digit, mixed case or more than eight letters stays whole, so x1, Rain and sprinkler each count as one variable. A run of nine capitals, like ABCDEFGHI, is refused, since that would be one variable more than fits. Case counts, so a and A are two different variables. 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. Neighboring 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
- Maurice Karnaugh, "The Map Method for Synthesis of Combinational Logic Circuits", Transactions of the AIEE, Part I, 72(5), November 1953
- W. V. Quine, "The Problem of Simplifying Truth Functions", American Mathematical Monthly 59(8), 1952
- E. J. McCluskey, "Minimization of Boolean Functions", Bell System Technical Journal 35(6), November 1956
Added . Last updated and reviewed . What's new






