Truth table layout for two inputs

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Truth table layout for two inputs

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How many rows does a truth table for a gate with two inputs have?
A 4 rows
B 2 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
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
4. Which formula gives the number of rows in a truth table with n inputs?
A n x 2
B 2^n
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

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1A B X 0 0 0 1 1 0 1 1 AThe 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.
22^2 = 4 BOnly 3 rows are listed. Two inputs need 2^2 = 4 rows, so the row 1 1 is missing.
3The input combinations must go down the rows in binary counting order, starting with both inputs at 0. CThe rows are not in binary counting order. 01 must come before 10, so the middle two rows are swapped.
4Rows needed in a truth table equal 2 to the power of the number of inputs, so one more input doubles the rows. Drows = 2^n
5A B X 0 0 0 1 1 0 ETwo inputs give four rows, because each input can be 0 or 1 and 2 x 2 = 4 combinations.
6A B X 0 0 1 0 0 1 1 1 F00, 01, 10, 11

Definitions

truth table

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
rows = 2 ^ _ = 4
2.
A | B | _
3.
Row order: 00, 01, __, 11
4.
Two inputs: 2 ^ 2 = _ rows
5.
Input columns first, ______ column last

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A A B X
B 0 0 1
C 0 1 0
D 1 0 0
E 1 1 1
Question 2
A A B X
B 0 0 0
C 1 0 1
D 1 0 1
E 1 1 1
Question 3
A X A B
B 0 0 1
C 0 1 1
D 1 0 1
E 1 1 0
Question 4
A A B X
B 0 0 1
C 0 1 0
D 1 1 0
E 1 1 0
Question 5
A inputs ← 2
B columns ← inputs + 1
C rows ← 2 ^ columns
D OUTPUT rows

Answer Key

Truth table layout for two inputs
Section A: Quick Questions
Q1
A — 4 rows
Q2
A — 00, 01, 10, 11
Q3
A — In the last column, after the input columns
Q4
B — 2^n
Q5
B — Every possible combination of the inputs
Section B: Match the Pairs
Q1
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.
Q2
2^2 = 4 → Two inputs give four rows, because each input can be 0 or 1 and 2 x 2 = 4 combinations.
Q3
The input combinations must go down the rows in binary counting order, starting with both inputs at 0. → 00, 01, 10, 11
Q4
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
Q5
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.
Q6
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.
Section C: Definitions
Q1
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.
Section D: Fill in the Blanks
Q1
rows = 2 ^ 2 = 4
Q2
A | B | X
Q3
Row order: 00, 01, 10, 11
Q4
Two inputs: 2 ^ 2 = 4 rows
Q5
Input columns first, output column last
Section E: Spot the Error
Q1
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.
Q2
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.
Q3
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.
Q4
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.
Q5
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.