# 5.2. The AND Gate¶

By changing the way wires run between our switches (the inputs) and the light (output), we can perform different Boolean operations. The circuit below demonstrates the Boolean rule AND. Notice that because there is one pathway through both switches from the battery to the light bulb, both switches must be in the on position to light the bulb:

If either switch is off, that stops the current and the output is 0 (off):

What happens if both switches are off? If the first switch is off, the current is stopped there - it doesn’t really matter what state the second one is in, we know the output will be 0. Once again we can express this as a truth table. Note that we have the same four possible sets of inputs that we had for the OR gate: 00, 01, 10, 11 - any truth table describing a two input circuit will always have those four possible inputs. What is different for the AND gate is the outputs produced by each input - it outputs a 1 only when both inputs are 1:

Truth table for AND
Input 1 Input 2 Output
0 0 0
0 1 0
1 0 0
1 1 1