Completing a truth table from a problem statement

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

Completing a truth table from a problem statement

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A alarm sounds (X = 1) if the door is open (A) AND the system is armed (B). Which expression should you write before filling in the table?
A X = A OR B
B X = A AND B
2. A truth table for a three-input problem statement needs how many rows?
A 6 rows
B 8 rows
3. Statement: a light turns on if switch A is on AND switch B is on, OR if switch C is on. For the row A = 0, B = 1, C = 1, what is X in X = (A AND B) OR C?
A X = 1
B X = 0
4. When you complete the output column from a problem statement, what do you write in a row where the statement is true?
A 1
B 0
5. A pump runs (X = 1) if the tank is empty (A) AND it is NOT raining (B). Which expression matches this statement?
A X = A AND (NOT B)
B X = A AND B

Match the Pairs

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

Left columnRight column
1X = (A AND B) OR C AReading one row as a situation: A AND B is false, but C is true, so the OR makes the statement true and X is 1.
2A=1, B=0, C=1 gives X = 1 BThere are three inputs (A, B and C), so the table needs 8 rows, not 4. Four rows would only cover two inputs.
3A problem statement says: the alarm sounds if the door is open AND the system is on, OR if the panic button is pressed. Write it as an expression. CX = (A AND B) OR C
4With three inputs, the truth table needs every combination, so you work out X for this many rows. DThe output X is 1 when both A and B are 1, or when C is 1. Use this expression to work out X for each row of the truth table.
5Row A=0, B=1, C=0: (A AND B) OR C = 1, so X = 1 E2 x 2 x 2 = 8 rows
6Truth table for X = (A AND B) OR C has only 4 rows FA AND B is 0 AND 1 = 0, and C is 0, so 0 OR 0 = 0. X should be 0, not 1. Only put 1 where the statement is true.

Definitions

X = (A AND B) OR C

Fill in the Blanks

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

1.
// X is 1 when A and B are both 1, or C is 1 X = (A ___ B) OR C
2.
// X is 1 if the bracket is 1, or C is 1 X = (A AND B) __ C
3.
X = (A AND B) OR C A=1, B=0, C=1 -> X = _
4.
X = (A OR B) AND C A=1, B=1, C=0 -> X = _
5.
// X is 1 when A is 1 and C is 0 X = A AND ___ C

Spot the Error

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

Question 1
A A=door, B=window, C=panic
B X = (A AND B) OR C
C Row 1,1,0 gives X = 0
Question 2
A Lamp on if A or B is on
B X = A AND B
C Row A=0,B=0 gives X = 0
Question 3
A Three inputs A, B, C
B Rows = 2 x 2 = 4
C Rows go 000, 001, ... 111
Question 4
A X = (A OR B) AND C
B Row A=1,B=0,C=1
C (1 OR 0) AND 1 = 1, so X = 0
Question 5
A X = A AND NOT B
B Row A=1,B=1
C NOT B = 1, so X = 0

Answer Key

Completing a truth table from a problem statement
Section A: Quick Questions
Q1
B — X = A AND B
Q2
B — 8 rows
Q3
A — X = 1
Q4
A — 1
Q5
A — X = A AND (NOT B)
Section B: Match the Pairs
Q1
X = (A AND B) OR C → The output X is 1 when both A and B are 1, or when C is 1. Use this expression to work out X for each row of the truth table.
Q2
A=1, B=0, C=1 gives X = 1 → Reading one row as a situation: A AND B is false, but C is true, so the OR makes the statement true and X is 1.
Q3
A problem statement says: the alarm sounds if the door is open AND the system is on, OR if the panic button is pressed. Write it as an expression. → X = (A AND B) OR C
Q4
With three inputs, the truth table needs every combination, so you work out X for this many rows. → 2 x 2 x 2 = 8 rows
Q5
Row A=0, B=1, C=0: (A AND B) OR C = 1, so X = 1 → A AND B is 0 AND 1 = 0, and C is 0, so 0 OR 0 = 0. X should be 0, not 1. Only put 1 where the statement is true.
Q6
Truth table for X = (A AND B) OR C has only 4 rows → There are three inputs (A, B and C), so the table needs 8 rows, not 4. Four rows would only cover two inputs.
Section C: Definitions
Q1
X = (A AND B) OR C — Write the problem statement as an expression like this, then find X for every row of the table: put 1 where the statement is true and 0 where it is false.
Section D: Fill in the Blanks
Q1
// X is 1 when A and B are both 1, or C is 1 X = (A AND B) OR C
Q2
// X is 1 if the bracket is 1, or C is 1 X = (A AND B) OR C
Q3
X = (A AND B) OR C A=1, B=0, C=1 -> X = 1
Q4
X = (A OR B) AND C A=1, B=1, C=0 -> X = 0
Q5
// X is 1 when A is 1 and C is 0 X = A AND NOT C
Section E: Spot the Error
Q1
C — With A=1 and B=1, A AND B is 1, so (A AND B) OR C is 1 even when C is 0. The line should say X = 1.
Q2
B — The statement says A or B, so the expression must use OR, not AND. It should be X = A OR B.
Q3
B — Three inputs double the rows three times, so there are 2 x 2 x 2 = 8 rows. 2 x 2 = 4 is the count for two inputs.
Q4
C — The working gives 1, so X must be 1 for this row. The line should end with so X = 1.
Q5
C — B is 1, so NOT B is 0, not 1. The line should read NOT B = 0, so X = 0.