Courses / Computer Science I
Basic Digital Design

Truth Tables and Logical Equivalence

Computer Science I 235 words Free to read

Truth Tables and Equivalence

A truth table lists the output of a boolean function for every possible input combination. For nn inputs, the table has 2n2^n rows. It provides a complete specification of a function.

Two expressions have logical equivalence if and only if their truth tables match row for row. This gives a foolproof test for equality no matter how different the expressions look.

Inputs (nn)Rows (2n2^n)
24
38

Each row where output is 1 is a minterm. OR-ing minterms together creates a canonical sum-of-products expression, proving any function can be built from gates.

Boolean Laws and Pitfalls

Truth tables verify the laws of boolean algebra:

LawEquationsDescription
IdentityA+0=AA + 0 = A, A⋅1=AA \cdot 1 = ANeutral elements
ComplementA+A‾=1A + \overline{A} = 1, A⋅A‾=0A \cdot \overline{A} = 0Inverse logic
De MorganA⋅B‾=A‾+B‾\overline{A \cdot B} = \overline{A} + \overline{B}Negation flips operator
De MorganA+B‾=A‾⋅B‾\overline{A + B} = \overline{A} \cdot \overline{B}Negation flips operator
Common pitfall: Applying De Morgan's law incorrectly by writing A⋅B‾=A‾⋅B‾\overline{A \cdot B} = \overline{A} \cdot \overline{B} (wrong) instead of A‾+B‾\overline{A} + \overline{B} (right). Negation always flips the operator.
De Morgan's law checked row by row -- and the flipped-operator pitfall

Practise this lesson

Try the questions below, free, answers included. The full set, with its interactive scenes, is in the Tryals app.

10practice questions
2interactive scenes

Basic Digital Design