GCSE/A-Level Computer Science Tool

Truth Table GeneratorBoolean Logic & Logic Gates

Generate truth tables instantly — with GCSE/A-Level explanations.

Boolean Expression Truth Table Generator

What is a Truth Table?

A truth table is a mathematical table used to determine if a compound statement is true or false based on the truth values of its component statements. In digital logic, truth tables show how logic gates respond to different input combinations.

Each row represents one possible combination of input values, and the final column shows the output. For n variables, there are 2^n possible combinations.

Example: AND Gate Truth Table

ABA ∧ B
000
010
100
111

How to Write Boolean Expressions

Boolean expressions use variables (A, B, C...) and operators. You can use either words or symbols:

Word Form

  • • A AND B
  • • A OR B
  • • NOT A
  • • A NAND B

Symbol Form

  • • A ∧ B or A · B
  • • A ∨ B or A + B
  • • ¬A or ~A
  • • A ⊼ B

Operator Precedence:

  1. NOT (highest precedence)
  2. AND
  3. OR (lowest precedence)

Use parentheses to override precedence: A ∧ (B ∨ C)

Logic Gates Overview

AND Gate

ABOut
000
010
100
111

OR Gate

ABOut
000
011
101
111

NOT Gate

¬

AOut
01
10

NAND Gate

ABOut
001
011
101
110

NOR Gate

ABOut
001
010
100
110

XOR Gate

ABOut
000
011
101
110

XNOR Gate

ABOut
001
010
100
111

Worked Example: A · (B + C̅)

Let's break down the expression A · (B + C̅) step by step:

Step 1: Identify variables

Variables: A, B, C (3 variables = 8 rows)

Step 2: Evaluate C̅ (NOT C)

C̅ means NOT C - when C=0, C̅=1; when C=1, C̅=0

Step 3: Evaluate (B + C̅)

OR operation between B and C̅

Step 4: Evaluate A · (B + C̅)

AND operation between A and the result from step 3

Result: The expression equals 1 when A=1 AND (B=1 OR C=0)

Why This Matters in Exams

Boolean logic and truth tables are core topics in GCSE and A-Level Computer Science:

GCSE Computer Science:

  • • Logic gates and truth tables
  • • Boolean algebra basics
  • • AND, OR, NOT operations
  • • Simple circuit design

A-Level Computer Science:

  • • Complex boolean expressions
  • • Karnaugh maps
  • • Circuit minimization
  • • Sequential logic

Exam Tip:

Always show your working when creating truth tables. Examiners want to see your thought process, not just the final answer.

Practice Questions

What is the truth table for A AND B?

Simplify the expression: A + A·B

What are the minterms for the expression A ⊕ B?

Frequently Asked Questions

Ready to revise?

Get help with boolean logic and other Computer Science topics from our AI tutor.

Try the Computer Science Genie