Browse lessons

AND, OR, NOT gates

Three basic operations, with examples and truth tables.

AND, OR, and NOT operate on binary values: 0 and 1. Their outputs follow a small set of rules.

AND gate

AND outputs 1 when both inputs are 1. Try turning on either input alone, then both together.

Click an input to change its value.Output: 0
ABOutput
000
010
100
111

OR gate

OR outputs 1 when at least one input is 1. Compare its output with AND when only one switch is on.

Click an input to change its value.Output: 0
ABOutput
000
011
101
111

NOT gate

NOT has one input and one output. It inverts the input: 0 becomes 1, and 1 becomes 0.

InputOutput
01
10

Combine gates

A gate’s output can become another gate’s input. Placing NOT after AND gives NAND; placing NOT after OR gives NOR.

Continue with NAND and NOR gates to compare these inverted outputs.