LearnGates

The AND gate

The AND gate gives 1 only when all of its inputs are 1. If even one input is 0, the output is 0. It is the logic version of the word “and”: the lamp turns on if switch A and switch B are on.

Formula Y = A · B

Truth table

Truth table of AND
ABY
000
010
100
111

Try it Click the inputs to change them.

Y0

Where it is used

AND gates let a signal through only when a condition holds, so they are everywhere a decision is made: a car that starts only if the key is turned and the brake is pressed, or a circuit that adds two bits, where the carry is A AND B (see the half adder).

With more inputs the rule stays the same: a 3-input AND gives 1 only when all three inputs are 1.

Build it yourself

An AND gate can be made from two NAND gates. Try it in the AND from NAND challenge.