[10.3b] Truth Tables

Truth Tables

To build a truth table for a logic circuit or Boolean expression:

  • Identify the number of unique inputs.
  • Generate all possible combinations of 0s and 1s for these inputs.
  • Apply the logical operations row by row to determine outputs.

Truth Table for Basic Logic Gates

Input A Input B A AND B A OR B A XOR B A NAND B A NOR B A XNOR B
00000111
01011100
10011100
11110001

Single Input Gate: NOT

The NOT gate, also known as an inverter, takes a single input and outputs the opposite value.

Input NOT
01
10

Worked examples by starting point

Use the tabs to see how the process differs depending on whether you start from a statement, an expression, or a circuit drawing. All examples use at most three inputs and a single output.

Scenario: Safety lamp

Statement: The safety lamp turns on when the power is available AND either the door is closed OR the override is active.

  • Let inputs be: A = power available, B = door closed, C = override active.
  • Translate to structure: Q = A AND (B OR C).

How to complete the table: List all combinations of A,B,C. For each row, first evaluate the bracket (B OR C), then AND with A.

ABCB OR CQ = A AND (B OR C)
00000
00110
01010
01110
10000
10111
11011
11111
Tip: When a statement contains words like "either ... or", bracket that part first, then apply the remaining AND/NOT operations.
Truth Table from Expression

Expression: F = (A AND B) OR NOT C

A B C A AND B NOT C F = (A AND B) OR NOT C
000011
011000
100011
111101
From a drawn circuit

Imagine a circuit where A and B feed an AND gate; C goes through a NOT gate; the outputs of AND and NOT feed an OR gate to produce Q. This corresponds to Q = (A AND B) OR (¬C).

Method: Add columns for each gate in the order signals flow: first A AND B, then ¬C, finally OR them to get Q.

ABCA AND B¬CQ
000011
001000
010011
011000
100011
101000
110111
111101
Reading drawings: Track each signal through the gates from left to right. Add one column per gate output so you do not lose your place.

General method: completing any truth table

  1. Name inputs clearly: Use A, B, C and decide what each represents.
  2. Set the order of evaluation: Brackets first, then NOTs on named signals, then AND/OR as written or as gates are arranged.
  3. Create helper columns: For every sub-part (e.g. A AND B, ¬C), add a column to avoid mistakes.
  4. Fill systematically: Work row by row. For three inputs list rows from 000 to 111.
  5. Check a few rows: Pick edge rows such as all 0s and all 1s to see if the output makes sense.

Deep Dive: Generating rows and spotting patterns

For two inputs you have four rows: 00, 01, 10, 11. For three inputs you have eight rows: 000 to 111. Increase the rightmost input every row; when it wraps, toggle the next input to the left. This keeps rows ordered and reduces omissions. With practice you will also recognise common patterns, such as XOR producing 0110 down its Q column for two inputs, or AND producing 0001. These patterns are useful checks but should not replace careful evaluation, especially when brackets or NOTs are involved.

Terminology recap

  • Boolean: a value that is either 0 or 1.
  • Truth table: a table listing outputs for all input combinations.
  • Logic expression: a symbolic statement using operators such as AND, OR, NOT.
  • Logic circuit: a diagram built from gate symbols representing the same operations in hardware.

 Key Takeaways

  • Translate statements into a bracketed structure before evaluating rows.
  • Add helper columns for each sub-expression or gate output to avoid losing track.
  • Follow the circuit from left to right, writing one column per gate in that order.
  • For three inputs, complete exactly eight rows from 000 to 111.
  • Do not simplify: compute the output exactly as the statement, expression, or circuit is given.