Equivalence (XNOR): truth table to Boolean expression

The truth table for Equivalence (XNOR), and the formulas it defines: canonical DNF, canonical CNF and the minimal form.

Truth table
RowpqOutput
1⊥⊥⊤
2⊤⊥⊥
3⊥⊤⊥
4⊤⊤⊤

How the forms were read off the table

  • The output is ⊤ in 2 of the 4 rows: 1, 4. Each contributes one minterm to the DNF.
  • The output is ⊥ in 2 of the 4 rows: 2, 3. Each contributes one maxterm to the CNF.
Disjunctive Normal Form (Sum of Products)
(¬p ∧ ¬q) ∨ (p ∧ q)
Conjunctive Normal Form (Product of Sums)
(¬p ∨ q) ∧ (p ∨ ¬q)

Frequently Asked Questions

Find answers to common questions about using the Logic Calculator

What does the truth table to expression tool do?

It runs the calculator backwards. You set the output column of a truth table by clicking each row, and it produces a formula with exactly that truth table, in disjunctive normal form (an OR of ANDs) or conjunctive normal form (an AND of ORs).

What is the difference between DNF and CNF?

DNF is a sum of products: one conjunction for each row where the output is true, all ORed together. CNF is a product of sums: one disjunction for each row where the output is false, all ANDed together. Both describe the same function, so the one to prefer is whichever is shorter for your table — a mostly-false column gives a short DNF, a mostly-true one a short CNF.

How many variables can the synthesis tool take?

Up to five, which is a table of 32 rows. Each variable you add doubles the rows, and beyond five the table stops being something anyone can set by hand.

Why is the generated expression so long?

A normal form is built row by row, one full-width term for every row it has to cover, so its length follows the truth table rather than the idea behind it. It is correct by construction rather than compact. To shorten it, open it in the calculator, which lists equivalent forms including a minimized DNF.

Can I get a simplified version of a formula?

Yes. Enter it in the calculator and look at the equivalent forms below the truth table. They include forms derived by rewriting with the algebraic laws, and the DNF and CNF read back off the truth table together with a minimized DNF.

See all questions