standarddeviationcalculator.net

Updated Free · runs in your browser

Math

Boolean algebra calculator

Type a logic expression in whatever notation you use. The calculator builds the truth table, writes the canonical sum-of-products and product-of-sums forms, and minimises the expression with the Quine–McCluskey method, showing the prime implicant chart.

NOT: A', ¬A, !A or NOT A. AND: A·B, AB, A*B, A&B, A∧B or A AND B. OR: A+B, A|B, A∨B or A OR B. XOR: A⊕B, A^B or A XOR B. Also NAND, NOR, → and ↔. 0 and 1 are constants.

Minimised SOP AB + A′C
VariablesA, B, C
Minterms Σm1, 3, 6, 7
Maxterms ΠM0, 2, 4, 5
Literals: original → minimised6 → 4
Equivalent to the second expression?Yes

Canonical SOP (sum of minterms):

F = Σm(1, 3, 6, 7) = A′B′C + A′BC + ABC′ + ABC

Canonical POS (product of maxterms):

F = ΠM(0, 2, 4, 5) = (A + B + C)(A + B′ + C)(A′ + B + C)(A′ + B + C′)

Truth table; G is the second expression
#ABCFG
000000
100111
201000
301111
410000
510100
611011
711111
Prime implicant chart: × marks the minterms each prime implicant covers
Prime implicantCoversm1m3m6m7
A′C (essential)1, 3××
BC3, 7××
AB (essential)6, 7××
Show the working, step by step
  1. Read the expression (NOT binds tightest, then AND, XOR, OR). Fully bracketed it is:

    F = ((A·B) + (A′·C)) + (B·C)

  2. Evaluate F for all 2^3 = 8 combinations of A, B, C. The rows where F = 1 are the minterms.

    F = Σm(1, 3, 6, 7) F = ΠM(0, 2, 4, 5)

  3. Quine–McCluskey: write each minterm in binary and group by the number of 1s. Two terms in neighbouring groups that differ in exactly one bit combine, with a dash in that bit (XY + XY′ = X). Repeat until nothing combines. Terms that never combine are the prime implicants.

  4. Prime implicants (3):

    0-1 = A′C covers m1, m3 -11 = BC covers m3, m7 11- = AB covers m6, m7

  5. A prime implicant is essential if it is the only one covering some minterm. Here the essential prime implicants cover every minterm.

    essential: A′C, AB F = AB + A′C

  6. Compare with G = (A·B) + (A′·C) row by row.

    Every row matches, so F ≡ G.

Pass 1: minterms grouped by number of 1s
1sPatternMinterms
10011✓ combined
20113✓ combined
21106✓ combined
31117✓ combined
Pass 2: terms combined from pass 1
1sPatternMinterms
10-11, 3prime
2-113, 7prime
211-6, 7prime

Notation the calculator accepts

OperationYou can typePrecedence
NOTA' ¬A !A ~A NOT AHighest
ANDAB A·B A*B A&B A∧B A AND BNext
XORA⊕B A^B A XOR BNext
ORA+B A|B A∨B A OR BNext
Implies, iffA→B A->B, A↔B A<->BLowest

Variables are single letters, optionally followed by digits (x1, x2). A run of letters such as ABC means A·B·C, the usual textbook shorthand, and the words AND, OR, NOT, XOR, NAND, NOR and XNOR are read as operators. 0 and 1 are the constants. Use brackets whenever the precedence is not what you want: (A + B)' is NOR, A + B' is not.

A worked example

The default expression is F = AB + A′C + BC.

  1. Truth table. F is 1 on rows 1 (001), 3 (011), 6 (110) and 7 (111), so F = Σm(1, 3, 6, 7) and F = ΠM(0, 2, 4, 5).
  2. Canonical forms. SOP: A′B′C + A′BC + ABC′ + ABC. POS: (A + B + C)(A + B′ + C)(A′ + B + C)(A′ + B + C′).
  3. Combine. 001 and 011 differ only in B, giving 0-1 = A′C. 011 and 111 give -11 = BC. 110 and 111 give 11- = AB. Nothing combines further, so these three are the prime implicants.
  4. Chart. m1 is covered only by A′C, and m6 only by AB, so both are essential. Together they cover m1, m3, m6 and m7, so BC is not needed.
  5. Result: F = AB + A′C, four literals instead of six. The comparison box holds AB + A′C, and the calculator confirms that the two are equivalent.

Laws worth knowing

LawAND formOR form
IdentityA·1 = AA + 0 = A
ComplementA·A′ = 0A + A′ = 1
IdempotentA·A = AA + A = A
AbsorptionA(A + B) = AA + AB = A
De Morgan(AB)′ = A′ + B′(A + B)′ = A′B′
DistributiveA(B + C) = AB + ACA + BC = (A + B)(A + C)
Consensus(A + B)(A′ + C)(B + C) = (A + B)(A′ + C)AB + A′C + BC = AB + A′C

The second distributive law, A + BC = (A + B)(A + C), has no counterpart in ordinary arithmetic and is a common source of slips. Type both sides into the calculator to see that they agree on all eight rows.

About the minimisation

Quine–McCluskey finds every prime implicant, takes the essential ones, and then chooses the fewest extra implicants that cover the remaining minterms (fewest literals on a tie). The result is a minimal sum of products. There can be more than one minimal answer; the calculator shows one. A product-of-sums minimum, or a form using XOR, can sometimes be shorter still: A ⊕ B needs four literals as a sum of products, A′B + AB′.

Common mistakes

  • Reading AB + C as A(B + C). AND binds more tightly than OR, so it is (AB) + C.
  • Misapplying De Morgan. (AB)′ is A′ + B′, not A′B′.
  • Writing a prime on a bracket but meaning one letter. (A + B)′ = A′B′, while A + B′ keeps A as it is.
  • Mixing up the variable order in minterm numbers. Here the first variable alphabetically is the most significant bit: with A, B, C, m6 is 110, that is ABC′.

Common questions

How do I simplify a Boolean expression?

Either apply the laws of Boolean algebra by hand (absorption, De Morgan, consensus and so on) or do it systematically: list the minterms from the truth table, combine minterms that differ in one variable, and pick the fewest prime implicants that cover them all. That is the Quine–McCluskey method, which this calculator uses. A Karnaugh map does the same combining visually, for up to four or five variables.

What is the difference between SOP and POS?

Sum of products (SOP) is an OR of AND terms, such as AB + A′C; it lists the input rows where the output is 1. Product of sums (POS) is an AND of OR terms, such as (A + B)(A′ + C); it rules out the rows where the output is 0. The canonical forms use full-length terms, one per row: minterms for SOP and maxterms for POS.

What are minterms and maxterms?

A minterm is an AND of every variable, each plain or complemented, that is 1 on exactly one row of the truth table. For variables A, B, C, row 3 (011) has minterm A′BC, written m3. A maxterm is an OR of every variable that is 0 on exactly one row: row 3 has maxterm (A + B′ + C′), written M3. A function is the sum of its minterms, Σm, and the product of its maxterms, ΠM, and the two index lists are complementary.

What is the consensus theorem?

AB + A′C + BC = AB + A′C. The term BC is redundant: whenever B and C are both 1, either A is 1 and AB covers it, or A is 0 and A′C covers it. It is the default example here, and the prime implicant chart shows why: BC is a prime implicant, but its minterms m3 and m7 are already covered by the essential implicants A′C and AB.

How do I check whether two Boolean expressions are equivalent?

Two expressions are equivalent when they give the same output for every combination of inputs, so compare their truth tables row by row. Type the second expression in the comparison box. If they differ, the calculator names an input where they do; for A ⊕ B and A + B that is A = 1, B = 1, where XOR gives 0 and OR gives 1.