// LAB 08 · INTERACTIVE
Logic gates simulator: AND, OR, NOT, NAND, NOR, XOR
Flip two switches and watch AND, OR, NOT, XOR and friends decide if the lamp lights.
⚡ POWERING UP THE LAB…
// HOW IT WORKS
The idea in 30 seconds
- AND: ON only when both inputs are ON. OR: ON when at least one is ON. NOT: flips its input.
- NAND and NOR are AND and OR with the answer flipped. XOR is ON when the inputs are different.
- Each gate is a few transistors. Billions of them, wired together, make a processor.
- A truth table lists the output for every possible input — the highlighted row is your switches now.
Watch the lessons
More labs
All labs →LAB · INTERACTIVE · NEWPWM dimmerChange the duty cycle and the speed: see the square wave, the average voltage and the LED dim.LAB · INTERACTIVE · NEWBinary & hex bitsFlip 8 bits and see the number in decimal, hex and binary — plus the PORTB line to write it.LAB · INTERACTIVEResistor colour codeTap the bands, read the value — then beat the decode challenge.

