Works on this device
Boolean Expression Simplifier
Find the shortest sum of products (SOP) and product of sums (POS) for a Boolean function. Type an expression, a list of minterms or maxterms with don't-care rows, or the output column of a truth table, and see every step of the Quine-McCluskey method.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this simplifier
- Choose how you give the function: an expression, minterms (Σm), maxterms (ΠM) or the output column of a truth table.
- For minterms, maxterms and the output column, type the variable names in order, such as
A B C D. The first name is the first (highest) bit of the row number. - Add don't-care rows if some outputs do not matter. The page uses them only where they make the answer shorter.
- Choose Calculate. The answer comes first, then the Quine-McCluskey steps, the prime implicants and the chart.
The method
- Minimal means the fewest terms first, then the fewest literals. A literal is one variable, plain (A) or inverted (A').
- Quine-McCluskey: the 1 rows and the don't-care rows are written as patterns of bits. Two patterns that differ in one place are joined, and that place becomes a dash. This is repeated until nothing joins. Patterns that never join are the prime implicants.
- Essential prime implicants are the only ones that cover some 1 row, so every answer has them.
- Petrick's method covers the rest: for each row still open it writes the sum of the prime implicants that cover it, multiplies the sums out and keeps the shortest products. Rows that share no prime implicant are solved in separate groups, and products longer than a quick cover found first are left out, because they can never be the shortest.
- The product of sums is found in the same way from the 0 rows (a minimal sum of products of NOT F) and turned round with De Morgan's laws.
- When several answers are equally short, the page says how many there are and shows one of them.
Worked example
F(A, B, C, D) = Σm(4, 8, 10, 11, 12, 15) + d(9, 14). The prime implicants are BC'D' (rows 4, 12), AB' (8 to 11), AD' (8, 10, 12, 14) and AC (10, 11, 14, 15). BC'D' is the only one that covers row 4 and AC the only one that covers row 15, so both are essential. Row 8 is still open: AB' or AD' covers it, and both have two literals. So there are 2 minimal answers, and the page shows AB' + AC + BC'D' (3 terms, 7 literals). Terms are listed with A before A' before terms without A, and so on for the next variables.
The expression AB + A'C + BC simplifies to AB + A'C: the term BC is the consensus of the other two and adds nothing.
Limits you should know
- At most 8 variables (256 rows). Petrick's method is exact, but its work grows very fast. The page stops with a message when one group of rows has more than 2,000 partial covers. This happens for many functions of 7 or 8 variables whose 1s are spread out with no pattern, such as random ones. Functions of up to 6 variables and functions from exercises are solved.
- The answer is a two-level form (sums of products or products of sums). Forms with XOR or more levels can be shorter and are not searched.
- The page shows the Quine-McCluskey working. It does not write a proof with the named laws of Boolean algebra.
- For a drawn Karnaugh map of 2 to 6 variables, use the Karnaugh Map Solver. For truth tables and equivalence checks, use the Boolean Logic Calculator.