Skip to content
BetterDL

Truth table

Also called: truth tables, function table, 2ⁿ rows

A table that lists every possible combination of input values and the output for each one. With n inputs it has 2ⁿ rows.

A truth table is the complete, unambiguous description of a boolean function. It has one column per input, one column per output, and one row for every possible input combination.

Each input can be 0 or 1, and each extra input doubles the number of combinations, so n inputs give 2ⁿ rows: 4 rows for 2 inputs, 8 for 3, 16 for 4.

Rows are listed by counting in binary: 000, 001, 010, … 111. The first input column (A) is the most significant bit, so it changes slowest. A row is usually named by its input bits, so row 101 means A = 1, B = 0, C = 1, which is row 5 in decimal.

Why truth tables matter:

  • They are the reference. Two expressions are equivalent exactly when their output columns match in every row.
  • One row where they differ, a counterexample, is enough to prove two expressions are not equal.
  • Later, every row where the output is 1 becomes a minterm and every row where it is 0 becomes a maxterm.
0000
0011
0101
0111
1000
1011
1100
1111

Worked examples

Example

Building the table for [[A'B + C]]

Fill the output column one part at a time instead of one row at a time.

  1. 1.

    List the 8 rows 000 to 111.

  2. 2.

    is 1 when A = 0 and B = 1: rows 010 and 011.

  3. 3.

    C is 1 in rows 001, 011, 101 and 111.

  4. 4.

    OR the two parts: the output is 1 in rows 001, 010, 011, 101, 111 and 0 in rows 000, 100, 110. That matches the table above.

Example

How many rows?

A function has 6 inputs. How many rows does its truth table have, and how many inputs does a 256-row table have?

  1. 1.

    6 inputs: 2⁶ = 64 rows.

  2. 2.

    256 rows: 256 = 2⁸, so 8 inputs.

  3. 3.

    Each extra input doubles the row count, so going from 6 inputs to 8 multiplies the table by 4.

Common mistakes

  • Using 2n rows instead of 2ⁿ. Four inputs give 16 rows, not 8.

  • Listing rows in a random order. Count in binary with A as the most significant bit, so everyone's row numbers agree.

  • Deciding two expressions are equal because they agree in most rows. They must agree in every row.

Practice Truth table

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Truth table is taught in Boolean Algebra, Logic Gates and Combinational Logic.