Logic gates

Pick a gate, then flip the switches. The bulb shows the gate’s output, and the truth table highlights the row you are on.

AND gate

AND gate: switch A is off, switch B is off. The bulb is off.000AOFFBOFFQ = 0

Tap the switches to turn them on and off.

Truth table
ABQ
000
010
100
111

What is a logic gate?

A logic gate is a tiny electronic part that takes one or two inputs, each either 1 (on) or 0 (off), and gives one output. Computer chips are made of millions of them, working together.

The five gates

  • AND: the output is 1 only when both inputs are 1.
  • OR: the output is 1 when at least one input is 1.
  • NOT: has one input and flips it. 1 becomes 0, and 0 becomes 1.
  • NAND: “NOT AND”. The opposite of AND. The small circle on its symbol means “flip the output”.
  • NOR: “NOT OR”. The opposite of OR. The output is 1 only when both inputs are 0.

What is a truth table?

A truth table lists every possible set of inputs and the output for each. A gate with two inputs has four rows, because there are four ways to set two switches.

Ready to join gates together? Try the logic circuit builder.

More free ICT tools