Skip to content
Tactiverge

Digital logic

Truth table

Also called: logic table · all input combinations · Boolean function

Definition

A truth table lists the output of a logic function for every possible combination of its inputs; n inputs need 2^n rows.

Picture it

It is the complete specification of a combinational circuit: if two circuits have the same truth table they do the same job, however different they look. Write the inputs in binary counting order so no row is missed.

The maths

rows = 2^n for n inputs
SI units used in this entry
QuantityUnitSymbol
ratiodimensionless1

Worked example

An alarm should sound (Y = 1) when the door is open (D) AND the system is armed (A), OR when the panic button (P) is pressed. How many rows does the table need, and in how many is Y = 1?

  1. 3 inputs → 2^3 = 8 rows
  2. P = 1 in 4 rows, all Y = 1
  3. P = 0: Y = 1 only when D = 1 and A = 1, 1 more row
  4. Total 5

Answer8 rows, with Y = 1 in 5 of them.

✓ The 2 numbers in this answer are recomputed from scratch by an automated test.

logic tester

Logic gate tester

Y = 1

Y = A ⊕ B

Truth table for XOR; the current row is marked.
ABY
000
011
101 ◀ now
110
XOR with A = 1, B = 0 gives Y = 1.

Ideal gates: no propagation delay. 1 = true = high, 0 = false = low.

Common misconceptions

  • Misconception: Skipping rows by hand is common; counting in binary guarantees every row appears once.
  • Misconception: A truth table cannot describe memory; flip-flops need a state table.