
Introduction
The Frog guards a bridge with a precise rule:
“Only those carrying exactly one lit torch may cross.
If you carry none or both, the bridge closes.”

Logical goal
Build an output that equals 1 when A and B are different.
It is built using only AND, OR, and NOT:
See full truth table
| A | B | A OR B | A AND B | NOT(A AND B) | Output |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |

Simulator instructions
1. Place
- Inputs: A, B
- OR Gate
- AND Gate (x2)
- NOT Gate
- Output

2. Connect
- A and B ➔ OR:
OR_AB - A and B ➔ AND1:
AND_AB AND_AB➔ NOT:NOT_AND_ABOR_ABandNOT_AND_AB➔ AND2- AND2 ➔ Output
3. Test
- Verify 00, 01, 10, 11.
- The output should be 1 only for 01 and 10.
Victory condition: output = 1 when A ≠ B.
Quick tips
- If you get 1 for 11, you are missing the negation of
AND_AB. - Visually separate the
OR_ABandNOT_AND_ABbranches to avoid crossed wires.
Simulator
What did you learn?
- How to build the “they are different” condition using AND/OR/NOT.