Logic Gates

Middle schoolComputer ScienceBoolean logic gates with an optional extra NOT stage and slowed signal propagation

Output settled

000AND
ABOutput
00
10
00
11

About this experiment

Flip Boolean inputs and trace their result through a logic gate. Select AND, OR, XOR and their inverted forms, or use NOT with one input. Add another NOT stage to compose gates, then inspect the complete truth table. The moving signal markers and output lamp make the evaluation sequence visible at a classroom-friendly speed.

Learning goals

  • Evaluate Boolean gates from their truth tables
  • Distinguish OR from XOR and identify inverted outputs
  • Compose a gate with an additional NOT stage
  • Relate logic gates to everyday decisions and to how computers add numbers

How to use it

  1. 1Select AND and cycle through all input combinations. Note the single row that produces output 1.
  2. 2Choose OR, then XOR. Compare the row where both inputs are 1.
  3. 3Choose AND and add the extra NOT stage. Compare the result with NAND.
  4. 4Choose NOT with the extra NOT stage enabled and test both values of A. Explain the effect of two inversions.
  5. 5Find the gate whose truth table is the exact opposite of OR. Check your answer with the extra NOT stage.

The model

AND is true only when both inputs are true
OR includes the case where both inputs are true
XOR is true when inputs differ
Double negation and a composed inverted gate

Assumptions

  • Signals are ideal Boolean values 0 and 1. Voltage thresholds, transistor circuits and electrical noise are not modeled.
  • Signal propagation is deliberately slowed to about 0.55 seconds so the evaluation can be inspected. This is not a measured gate delay.
  • The truth table and logical output readout give the final Boolean result. The output lamp settles after the visual propagation completes.
  • NOT ignores input B and has a two-row truth table. Other selected gates have four rows.

Try this in class

  1. Q1Why do OR and XOR disagree when A and B are both 1?
  2. Q2Which gate is formed by adding NOT after AND?
  3. Q3Why does adding NOT after an existing NOT gate reproduce input A?
  4. Q4A car alarm sounds if a door is open OR the boot is open, but only when the car is locked. Write this with AND and OR.
  5. Q5Why are NAND gates called universal gates?

Frequently asked questions

Does a gray moving marker represent a broken wire?

No. The marker traces a Boolean 0, while an orange marker traces a Boolean 1. Both values are valid signals.

Why does the lamp update after the table result?

The table shows the logical answer immediately. The lamp follows the intentionally slowed propagation animation so students can trace the circuit stages.

How are logic gates used in a computer?

Combining gates builds circuits that add numbers, compare values and store bits. For example, an XOR gate gives the sum digit and an AND gate gives the carry when two binary digits are added, which is called a half adder.