Boolean Algebra Calculator

Simplify any Boolean expression, generate complete truth tables, and obtain the minimal Sum‑of‑Products (SOP) form using exact Quine‑McCluskey minimization. Supports variables A, B, C, D and operators: & (AND), | (OR), ! (NOT) ∧ ∨ ¬ → ↔ ⊕ | Also accepts & | ! | Variables: A-Z (max 4 for K-map), parentheses.

How it works

Uses Quine-McCluskey algorithm to generate minimal Sum-of-Products (SOP) from truth table minterms. Supports implication (→), equivalence (↔), XOR (⊕) by rewriting to ∧,∨,¬. No eval() used: expression is parsed recursively and evaluated safely. Also accepts ASCII operators: & for ∧, | for ∨, ! for ¬.

Master Boolean Algebra: Core Laws & Applications

Boolean algebra is the backbone of digital logic design, computer architecture, and formal verification. Developed by George Boole in the 19th century and later refined by Claude Shannon, it enables the analysis and simplification of logic circuits. Our calculator reduces complex expressions to minimal Sum‑of‑Products (SOP) form using exact prime implicant selection (Quine‑McCluskey with optimal covering), equivalent to Karnaugh maps for up to 4 variables.

? Key Laws: Identity, Idempotent, Complement, De Morgan’s, Distributive, Absorption ?

  • De Morgan’s: !(A & B) = !A | !B    |    !(A | B) = !A & !B
  • Absorption: A | (A & B) = A    |    A & (A | B) = A
  • Distributive: A & (B | C) = (A & B) | (A & C)

Why simplify Boolean expressions?

Minimizing logic expressions reduces the number of logic gates (AND/OR/NOT) in digital circuits, lowering power consumption, cost, and propagation delay. From CPU design to FPGA programming, Boolean minimization is essential. Our calculator uses exact prime implicant extraction and optimal set cover to guarantee the most compact representation, avoiding redundant terms.

Step‑by‑step minimization insight

The tool parses your expression, builds a truth table for all variable combinations, extracts minterms where output = 1, then computes all prime implicants using iterative merging. Finally, an exact minimum cover (exhaustive search) selects the simplest SOP expression. The result matches what you would obtain from a 4‑variable Karnaugh map, but extended algorithmically and verified for optimality.

Real‑world application: 7‑segment display decoder

Engineers use Boolean simplification to drive 7‑segment displays. For a BCD to 7‑segment decoder, each segment’s logic is reduced from canonical forms to minimal gates. For example, segment ‘a’ expression !A & !C | B & C | A & !B & !C | A & B & C simplifies dramatically. Using our calculator, you can experiment with such expressions and witness the power of minimization.

Supported Operators & Syntax Rules

OperatorSymbolExamplePrecedence
NOT (Complement)!!AHighest (applied to immediate variable)
AND&A & BMedium
OR|A | BLowest
Parentheses( )(A & B) | COverride precedence
Variables must be uppercase letters A, B, C, D (max 4 distinct variables). Expressions are case‑sensitive; spaces are ignored automatically.

Frequently asked questions

Sum‑of‑Products (SOP) is an OR of AND terms. For example, A·B + !A·C. Every Boolean expression can be represented in SOP, and minimal SOP uses the fewest literals and terms, which is ideal for AND‑OR logic circuits.

For performance and clarity, the calculator supports up to 4 variables (A,B,C,D). Expressions with more than 4 distinct variables will show an error. 4 variables cover most educational and many practical logic designs.

Our algorithm generates all prime implicants from the truth table, then solves a minimum cover set covering all on‑set minterms using exact backtracking (exhaustive search). For up to 4 variables (max 16 minterms) this ensures the true minimal SOP. Results are mathematically exact.

Absolutely. Students and educators rely on our calculator to verify simplifications, check truth tables, and understand the relationship between expressions and logic gates. All steps are transparent and reproducible.

Authoritative foundation: Boolean algebra principles derive from works of George Boole (1854), Claude Shannon (1938), and modern switching theory. Our implementation adheres to standard minimization practices (IEEE Std 91). Reviewed by digital logic experts and continuously updated to ensure accuracy. References: Wolfram MathWorld, All About Circuits, and “Fundamentals of Logic Design” by Roth & Kinney.