Where NOT applies in an expression

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

Where NOT applies in an expression

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. In X = NOT (A AND B), what does NOT apply to?
A The output of the bracket (A AND B)
B Only input A
2. In X = (NOT A) AND B, what does NOT apply to?
A Only input A
B The output of A AND B
3. A = 1 and B = 1. Which expression gives X = 0?
A (NOT A) AND B
B NOT (A AND B)
4. A = 0 and B = 1. Which expression gives X = 1?
A NOT (A AND B)
B (NOT A) AND B
5. A = 1 and B = 0. Which expression gives X = 1?
A NOT (A AND B)
B (NOT A) AND B

Match the Pairs

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

Left columnRight column
1(NOT A) AND B ANOT flips only input A first. The result of that is then ANDed with B.
2NOT (A AND B) BX = NOT (A AND B)
3NOT applies to the input A alone, and B is not changed before the AND CA AND B is worked out first. NOT then flips the whole result of the bracket.
4NOT is applied to the output of an AND gate, so it flips the result of the bracket DThe brackets are placed round A AND B, so NOT flips the final output. The student wanted NOT on input A only.
5X = NOT A AND B (meant: NOT (A AND B)) EThe brackets are missing, so NOT applies only to A. The student wanted NOT to flip the whole result of A AND B.
6X = NOT (A AND B) (meant: (NOT A) AND B) FX = (NOT A) AND B

Definitions

NOT (A AND B)

Fill in the Blanks

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

1.
X = ___ (A AND B)
2.
X = (NOT A) ___ B
3.
X = (NOT _) AND B
4.
When A = 1 and B = 0: NOT (A AND B) = _
5.
When A = 1 and B = 0: (NOT A) AND B = _

Spot the Error

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

Question 1
A # A=1, B=0, so X must be 1
B X = (NOT A) AND B
C # bracket = 0, NOT gives 1
Question 2
A # A=1, B=0, so X must be 0
B # NOT flips only input A
C X = NOT (A AND B)
Question 3
A a = True
B b = False
C x = not a and b
D print(x) # True
Question 4
A A = 0, B = 0
B A AND B = 0
C NOT (A AND B) = 1
D (NOT A) AND B = 1
Question 5
A A = 1, B = 1
B A AND B = 1
C NOT (A AND B) = 1
D (NOT A) AND B = 0

Answer Key

Where NOT applies in an expression
Section A: Quick Questions
Q1
A — The output of the bracket (A AND B)
Q2
A — Only input A
Q3
B — NOT (A AND B)
Q4
B — (NOT A) AND B
Q5
A — NOT (A AND B)
Section B: Match the Pairs
Q1
(NOT A) AND B → NOT flips only input A first. The result of that is then ANDed with B.
Q2
NOT (A AND B) → A AND B is worked out first. NOT then flips the whole result of the bracket.
Q3
NOT applies to the input A alone, and B is not changed before the AND → X = (NOT A) AND B
Q4
NOT is applied to the output of an AND gate, so it flips the result of the bracket → X = NOT (A AND B)
Q5
X = NOT A AND B (meant: NOT (A AND B)) → The brackets are missing, so NOT applies only to A. The student wanted NOT to flip the whole result of A AND B.
Q6
X = NOT (A AND B) (meant: (NOT A) AND B) → The brackets are placed round A AND B, so NOT flips the final output. The student wanted NOT on input A only.
Section C: Definitions
Q1
NOT (A AND B) — NOT before a bracket flips the whole bracket's result. In (NOT A) AND B, NOT flips only input A, so NOT (A AND B) gives different results.
Section D: Fill in the Blanks
Q1
X = NOT (A AND B)
Q2
X = (NOT A) AND B
Q3
X = (NOT A) AND B
Q4
When A = 1 and B = 0: NOT (A AND B) = 1
Q5
When A = 1 and B = 0: (NOT A) AND B = 0
Section E: Spot the Error
Q1
B — NOT must go before the bracket so it flips the whole result of A AND B. (NOT A) AND B only flips A, giving 0 here instead of 1. It should be X = NOT (A AND B).
Q2
C — The comment says NOT applies to input A only, so A needs its own brackets: (NOT A) AND B. NOT (A AND B) flips the whole bracket and gives 1, not 0.
Q3
C — Without brackets, not applies only to a, so the result is False. To flip the whole result of a and b, write x = not (a and b), which gives True.
Q4
D — NOT A is 1 and B is 0, so 1 AND 0 = 0. The answer should be (NOT A) AND B = 0, which differs from NOT (A AND B) = 1.
Q5
C — A AND B is 1, and NOT flips the bracket's result, so NOT (A AND B) = 0, not 1.