OR versus XOR: the row where both inputs are 1

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

OR versus XOR: the row where both inputs are 1

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A = 1 and B = 1. What does an OR gate output?
A 1
B 0
2. A = 1 and B = 1. What does an XOR gate output?
A 1
B 0
3. Which gate gives a different output from OR only in the row where A = 1 and B = 1?
A XOR
B AND
4. Which statement describes XOR correctly?
A Outputs 1 when exactly one input is 1
B Outputs 1 when at least one input is 1
5. A shop sign says 'You may have a free drink or a free snack, but not both.' Which gate matches this wording?
A OR
B XOR

Match the Pairs

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

Left columnRight column
1A = 1, B = 1, A OR B AOR is shown outputting 0 when both inputs are 1. OR is inclusive, so it must output 1 whenever at least one input is 1, including both.
2A = 1, B = 1, A XOR B BXOR is shown outputting 1 when both inputs are 1. XOR must output 0 in this row because it needs exactly one input to be 1.
3The only row where the OR and XOR output columns differ is the row where both inputs are 1 CA B | OR XOR 1 1 | 1 0
4Everyday 'either...or but not both' wording describes XOR, for example you can have tea or coffee but not both DOutputs 1, because OR is inclusive and accepts one input or both inputs being 1
5A B | XOR 1 1 | 1 EX = A XOR B
6A B | OR 1 1 | 0 FOutputs 0, because XOR is exclusive and needs exactly one input to be 1

Definitions

XOR

Fill in the Blanks

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

1.
X = A ___ B
2.
X = A OR B A = 1, B = 1 X = _
3.
A = 1, B = 1 X = A XOR B X = _
4.
A B OR XOR 1 1 _ 0
5.
Tea or coffee, or both: X = A __ B

Spot the Error

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

Question 1
A X = A OR B
B A=1, B=1 -> X=0
C A=1, B=0 -> X=1
D A=0, B=0 -> X=0
Question 2
A A B | OR | XOR
B 0 0 | 0 | 0
C 1 1 | 1 | 1
D 1 0 | 1 | 1
Question 3
A A <- 1
B B <- 1
C X <- A OR B
D OUTPUT X // prints 0
Question 4
A Either tea or coffee, not both
B Gate needed: XOR
C Tea and coffee both 1: X = 1
D Only tea is 1: X = 1
Question 5
A OR gate, inputs A and B
B A=1, B=1 gives X=0
C A=1, B=0 gives X=1
D A=0, B=0 gives X=0

Answer Key

OR versus XOR: the row where both inputs are 1
Section A: Quick Questions
Q1
A — 1
Q2
B — 0
Q3
A — XOR
Q4
A — Outputs 1 when exactly one input is 1
Q5
B — XOR
Section B: Match the Pairs
Q1
A = 1, B = 1, A OR B → Outputs 1, because OR is inclusive and accepts one input or both inputs being 1
Q2
A = 1, B = 1, A XOR B → Outputs 0, because XOR is exclusive and needs exactly one input to be 1
Q3
The only row where the OR and XOR output columns differ is the row where both inputs are 1 → A B | OR XOR 1 1 | 1 0
Q4
Everyday 'either...or but not both' wording describes XOR, for example you can have tea or coffee but not both → X = A XOR B
Q5
A B | XOR 1 1 | 1 → XOR is shown outputting 1 when both inputs are 1. XOR must output 0 in this row because it needs exactly one input to be 1.
Q6
A B | OR 1 1 | 0 → OR is shown outputting 0 when both inputs are 1. OR is inclusive, so it must output 1 whenever at least one input is 1, including both.
Section C: Definitions
Q1
XOR — Exclusive OR: outputs 1 when exactly one input is 1. When A and B are both 1 it outputs 0, but OR outputs 1 in that row. XOR means one or the other, but not both.
Section D: Fill in the Blanks
Q1
X = A XOR B
Q2
X = A OR B A = 1, B = 1 X = 1
Q3
A = 1, B = 1 X = A XOR B X = 0
Q4
A B OR XOR 1 1 1 0
Q5
Tea or coffee, or both: X = A OR B
Section E: Spot the Error
Q1
A — The results show X=0 when both inputs are 1, which is XOR behaviour. OR would output 1 in that row. The line should be X = A XOR B.
Q2
C — When A and B are both 1, OR outputs 1 but XOR outputs 0, because XOR means one or the other but not both. The row should be 1 1 | 1 | 0.
Q3
C — With A and B both 1, OR would give 1, but the program expects 0. It should use XOR: X <- A XOR B.
Q4
C — 'Either...or, not both' describes XOR. When both inputs are 1, XOR outputs 0, so the line should say X = 0.
Q5
B — OR is inclusive, so it outputs 1 when both inputs are 1. The line should be A=1, B=1 gives X=1.