Logic Gates
Flip the switches and watch the signal pass through gates like AND and OR to a bulb. At the end, two gates team up to do addition.
AND: the output is 1 only when both A and B are 1.
| A | B | Bulb |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | ? |
| 1 | 0 | ? |
| 1 | 1 | ? |
A simplified teaching model.
How to play
Press switches A and B to flip between 0 (off) and 1 (on). The gate in between decides whether the bulb lights. The table fills in as you try each combination. "Run it for me" lets the computer try every combination in turn. In "Addition (half adder)", two gates work together to calculate 1 + 1.
Learn more
AND gives 1 only when both inputs are 1. OR gives 1 when either input is 1. NOT swaps 0 and 1. XOR gives 1 only when the inputs differ. In addition, XOR produces the ones digit of the answer and AND produces the carry. In binary (writing numbers with only 0 and 1), 1 + 1 is 10. Chain several of these half adders together and you can add bigger numbers. Computer arithmetic is built from small parts like these. This diagram is a simplified teaching model: real chips use high and low voltages for 0 and 1 and have wiring and timing details we leave out.