XOR: true when two inputs differ; XNOR: true when two inputs match
55-minute lesson sequence
0–5 · Retrieve two true inputs.
5–15 · Model the four new gates and their standard symbols.
15–25 · Guide the NAND and NOR columns; students finish XOR and XNOR.
25–45 · Students choose the alarm gate, code it and record all tests.
45–50 · Check every output against the paper table.
50–55 · Collect the inversion exit statement.
Try before notes
For A=1 and B=1, what are AND and OR?
Build the idea
NAND is an AND result followed by NOT. NOR is an OR result followed by NOT. Compute the inner gate first; then invert the result. The little output circle in a standard gate symbol means inversion.
For two inputs, XOR is true when the inputs differ. XNOR is true when they match. This includes 00: two false inputs still match. Learn the meaning as well as the name.
For actual Python Boolean values, a != b expresses XOR and a == b expresses XNOR. Do not replace a Boolean rule with ordinary addition: True + True is a numeric operation.
A,B → AND → NOT = NAND
A,B → XOR → NOT = XNOR
See the method
NAND means NOT of AND. NOR means NOT of OR. For A=1 and B=0, XOR is 1 because inputs differ; XNOR is 0. A small circle at a gate output means that output is inverted. XOR uses the extra curved line on its input side.
Predict then reveal
Two backup switches have A=0,B=0. Find NAND, NOR, XOR and XNOR.
Reveal reasoning
AND=0 so NAND=1. OR=0 so NOR=1. Inputs match, so XOR=0 and XNOR=1.
A disagreement light uses XOR. Evaluate (True,False) and (True,True) using a != b.
Reveal reasoning
True != False is True: one input differs. True != True is False: the inputs agree. OR would incorrectly light for the second pair if disagreement is the requirement.
Work one step together
Read the first task. Each learner predicts the first step privately. Compare the method, then complete one intermediate row or one code iteration together. Do not display a finished workbook answer.
Practice
For rows 00, 01, 10, 11, complete NAND, NOR, XOR and XNOR columns. Use the gate reference to draw one example of each gate.
A | B | NAND | NOR | XOR | XNOR
0 | 0 | | | |
0 | 1 | | | |
1 | 0 | | | |
1 | 1 | | | |
Your turn
Complete the remaining steps of task 1 alone, then the next tasks. Predict before running code. Save your own evidence before comparing.
Practice
For rows 00, 01, 10, 11, complete NAND, NOR, XOR and XNOR columns. Use the gate reference to draw one example of each gate.
A | B | NAND | NOR | XOR | XNOR
0 | 0 | | | |
0 | 1 | | | |
1 | 0 | | | |
1 | 1 | | | |
Two sensors A and B should agree. An alarm must be 1 when they disagree. Choose a gate and explain. Write a Boolean Python function alarm(a,b). Test all four cases.
Check and explain
XNOR means equal Boolean states, not both states must be 1.
Point to the first step, row, condition or requirement that supports your answer. If results differ, find the first different state and repair one cause.
Show what you know
How do the NAND and AND outputs relate?
HL challenge when ready
Build NOT A using only a NAND gate.
Week 2 homework
Show working. Keep code and output. Stop at 25 minutes and mark where you reached.
Make a truth table for Y=(A AND B) OR NOT C. Show intermediate columns and all eight rows.
Draw Y using standard gate symbols. Write a Python expression with the same meaning.
Simplify (X AND Y) OR (NOT X AND Y). Use algebra and a two-variable Karnaugh map.
A learner says XOR and OR are always equal. Give one counterexample.
Spend about 3 minutes on each during practice time. Predict, run, change one thing, then explain. These prompts do not add homework.
A starter is runnable code to explore or complete. If the playground restores your saved code, the linked starter is selected in Example: use Load example when ready. Download your work before confirming replacement.
Prompt 1
Compare != with not (a == b) for every Boolean pair.
No imports needed.
Hint and starter code
!= means not equal; for Boolean inputs this models XOR, true when inputs differ.
# != means not equal; for Boolean inputs this models XOR, true when inputs differ.
for a in [False, True]:
for b in [False, True]:
print(a != b, not (a == b))