AND
Output 1 only when both inputs are 1.
Home / Logic Lab
Logic Lab · Switches and rules
Logic gates apply simple Boolean rules to binary inputs. Choose a gate and toggle the inputs to explore what changes.
Open the simulatorInteractive gate
The output updates when you choose a gate or change an input. Try to predict each result first.
NOT uses input A; the second input is ignored.
| Input A | Input B | AND | OR | XOR |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 |
Gate guide
Output 1 only when both inputs are 1.
Output 1 when at least one input is 1.
Output 1 when the inputs are different.
Flips one input: 0 becomes 1, and 1 becomes 0.
Build on the idea
Circuits use combinations of gates to perform arithmetic, compare values, and store information. Try drawing a two-bit adder on paper, then use an online simulator to test its outputs.
Set A to 1 and B to 0. Which gates return 1? Switch between AND, OR, and XOR to compare their rules.