← IGCSE Computer Science Paper 2

Truth table layout for two inputs

A table listing every input combination in its rows, with the output in the last column. Two inputs give 2^2 = 4 rows, in the order 00, 01, 10, 11.

Understanding Truth table layout for two inputs in IGCSE Computer Science Paper 2

What it does: Counting in binary from 00 gives 00, 01, 10, 11, which is the row order every two-input truth table uses. The formula 2^n, where n is the number of inputs, tells you how many rows to draw before you fill in any values. Two inputs give 2^2 = 4 different combinations, so the table needs 4 rows. The rows count up in binary: 00, 01, 10, 11. Input columns (A, B) come first and the output (X) goes in the last column on the right. A is the left-hand bit, so it goes 0, 0, 1, 1. The B column is the one that alternates 0, 1, 0, 1.

Common mistakes: This is an AND truth table, and AND only outputs 1 when both inputs are 1. For inputs 0 0 the output X must be 0, so the row should be 0 0 0. Rows count up in binary: 00, 01, 10, 11. The second data row must be 0 1, so it should read 0 1 1. Starting 1 0 early puts the rows out of order.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 539–551) and word search (Modules 539–580).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How many rows does a truth table for a gate with two inputs have?
4 rows2 rows
Matches
A B X 0 0 0 1 1 0
↓
Only 3 rows are listed. Two inputs need 2^2 = 4 rows, so the row 1 1 is missing.
Applying
Meanings
Term
truth table
Meaning
A table listing every input combination in its rows, with the output in the last column. Two inputs give 2^2 = 4 rows, in the order 00, 01, 10, 11.
Practice
A B X
Testing
Gaps
rows = 2 ^ = 4
Check Answer
Spots
1A B X
20 0 1

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Red Panda' badge — Forest Explorer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How many rows does a truth table for a gate with two inputs have?
A. 4 rows ✓
B. 2 rows
Two inputs give 2^2 = 4 different combinations, so the table needs 4 rows.
2. Which shows the correct order of input rows (A B) for a two-input truth table?
A. 00, 01, 10, 11 ✓
B. 00, 11, 01, 10
The rows count up in binary: 00, 01, 10, 11.
3. Where does the output column go in a truth table?
A. In the last column, after the input columns ✓
B. In the first column, before the inputs
Input columns (A, B) come first and the output (X) goes in the last column on the right.
4. Which formula gives the number of rows in a truth table with n inputs?
A. n x 2
B. 2^n ✓
Each input can be 0 or 1, so the number of rows is 2 to the power of n. For n = 2 that is 4, while n x 2 would wrongly give 4 only by coincidence and fails for 3 inputs (6 instead of 8).
5. In a two-input truth table, what do the columns A and B show?
A. Only the combinations that make the output 1
B. Every possible combination of the inputs ✓
A truth table lists ALL input combinations, whether the output is 0 or 1.

Match the Pairs

A B X 0 0 0 1 1 0 1 1 → The standard layout of a two-input truth table: input columns A and B first, then output column X, with four rows in binary counting order.
2^2 = 4 → Two inputs give four rows, because each input can be 0 or 1 and 2 x 2 = 4 combinations.
The input combinations must go down the rows in binary counting order, starting with both inputs at 0. → 00, 01, 10, 11
Rows needed in a truth table equal 2 to the power of the number of inputs, so one more input doubles the rows. → rows = 2^n
A B X 0 0 0 1 1 0 → Only 3 rows are listed. Two inputs need 2^2 = 4 rows, so the row 1 1 is missing.
A B X 0 0 1 0 0 1 1 1 → The rows are not in binary counting order. 01 must come before 10, so the middle two rows are swapped.

Key Term

truth table
A table listing every input combination in its rows, with the output in the last column. Two inputs give 2^2 = 4 rows, in the order 00, 01, 10, 11.

Fill in the Blanks

1. rows = 2 ^ 2 = 4
Hint: Type the number of inputs, which is the power that 2 is raised to.
2. A | B | X
Hint: Type the label of the output column, which is the last column.
3. Row order: 00, 01, 10, 11
Hint: Type the binary pair that comes after 01 when counting down the rows.
4. Two inputs: 2 ^ 2 = 4 rows
Hint: Type the total number of rows in a two-input truth table.
5. Input columns first, output column last
Hint: Type the word for the kind of column that goes at the end of the table.

Spot the Error

Question 1
A A B X
B 0 0 1
C 0 1 0
D 1 0 0
E 1 1 1
Line B — This is an AND truth table, and AND only outputs 1 when both inputs are 1. For inputs 0 0 the output X must be 0, so the row should be 0 0 0.
Question 2
A A B X
B 0 0 0
C 1 0 1
D 1 0 1
E 1 1 1
Line C — Rows count up in binary: 00, 01, 10, 11. The second data row must be 0 1, so it should read 0 1 1. Starting 1 0 early puts the rows out of order.
Question 3
A X A B
B 0 0 1
C 0 1 1
D 1 0 1
E 1 1 0
Line A — A truth table lists the input columns first and the output column last. The header should be A B X, not start with the output X.
Question 4
A A B X
B 0 0 1
C 0 1 0
D 1 1 0
E 1 1 0
Line D — The third data row must be 1 0 so that all four combinations 00, 01, 10, 11 appear once each. Here 1 1 is repeated and 1 0 is missing. It should be 1 0 0.
Question 5
A inputs ← 2
B columns ← inputs + 1
C rows ← 2 ^ columns
D OUTPUT rows
Line C — The number of rows is 2 to the power of the number of inputs, not the number of columns. The output column is not an input. It should be rows ← 2 ^ inputs, which gives 4.

Student with a class code? Join your class →