Boolean Algebra Simplifier

Use A, B, C... for variables. Operators: & (AND), | (OR), ! (NOT), ^ (XOR), ( )

Given a Boolean expression — A·B + A·¬B + ¬A·B or a truth table with minterms — this simplifier returns the minimal sum-of-products form using the Quine-McCluskey algorithm, plus a Karnaugh map visualisation for up to six variables. It shows every step (prime implicants, essential prime implicants, the covering table) so it’s useful not just for homework but for auditing what a minimiser inside your synthesis tool chose.

How Boolean simplification runs

  1. 1

    Enter the expression or minterms

    Use operators · (AND), + (OR), ' or ¬ (NOT), ⊕ (XOR). Or paste minterm indices like m(0,1,3,7).

  2. 2

    Truth table is generated

    Every variable assignment is evaluated and the function output is tabulated.

  3. 3

    Quine-McCluskey finds prime implicants

    Minterms are grouped and combined iteratively. Adjacent groups (differing in one variable) merge until no more reductions are possible.

  4. 4

    Essential implicants cover the function

    A Petrick-method covering table picks the minimum set of prime implicants. The result is the simplified SOP. POS form is derived from the complement.

Operator notation supported

Operation Symbols accepted
AND ·, *, &, , space
OR +, |,
NOT ', ¬, !, ~, overbar (A with overbar renders as A')
XOR , ^
Constants 0, 1

Example

Input: A·B + A·¬B + ¬A·B

Truth table:

A B F
0 0 0
0 1 1
1 0 1
1 1 1

Minterms: m(1, 2, 3). The minimal SOP reduces to A + B (OR of the two variables). The simplifier walks through:

  1. Group minterms by number of 1s
  2. Combine adjacent pairs: (1,3) → -B, (2,3) → A-
  3. Cover table shows both are essential — final form: A + B

Why minimise

  • Fewer gates: each AND/OR term costs silicon or FPGA LUTs.
  • Shorter critical path: smaller logic usually means lower propagation delay.
  • Lower power: fewer switching nodes.

Algorithm limits

  • Number of variables: Quine-McCluskey scales as O(3^n / n) in the worst case. The tool handles up to 8 variables comfortably; beyond that, use Espresso-style heuristic minimisers (you will not get guaranteed minimality but it’s feasible).
  • Don’t-care terms: include them with d(indices) syntax to get smaller results when some input combinations cannot occur.

Frequently Asked Questions

Sum-of-products is OR-of-ANDs (like AB + CD); product-of-sums is AND-of-ORs (like (A+B)(C+D)). Same function, different structure. The simplifier returns both — pick whichever suits your downstream tool.

Yes. Enter them as d(index1, index2, ...) alongside the minterms. The minimiser treats them as “free” to assign whichever value gives a smaller result.

Both produce minimal cost if you pick correctly, but K-maps depend on the person spotting the largest possible groups. Quine-McCluskey is deterministic and always finds an optimum.

XOR is expanded into AND/OR/NOT before minimisation. You will get an equivalent SOP but the XOR structure is lost. For XOR-preserving optimisation, a different algorithm (Reed-Muller) is needed.

Related Tools