Recently searched
      • Published 12 Jun 2023
      • Last Modified 25 Jan 2024
    • 5 min

    Guide to AND Gates

    Dating back to the earliest computers and calculators, AND gates have long been essential for the running of machines, computers and devices.

     AND Gates Banner

    With any circuit that goes beyond a simple power source, conductor and load, there will usually be some form of switching, which lets the user turn it on and off. As circuits become more complex, however, a degree of logic will enter the equation. That means that switching the circuit on and off will only happen when two or more conditions are in place. Those conditions might be a button being pressed, a sensor transmitting a voltage, another circuit being live or any of a host of potential conditions being met. Rather than relying on humans to ensure all the conditions are met, a logic gate can be included in the circuit that won’t allow the device or process to operate unless the input conditions are met.

    This form of logic switching was the basis for the earliest computers and calculating machines. The original hardware used was bulky, power-hungry valves or vacuum tubes, but these would eventually be replaced by transistors and then silicon chips. There’s still a need for such automatic switches in all manner of engineering tasks, however, and that’s why they are available as self-contained logic gates.

    Logic gates come in several forms, the commonest being AND, OR, NOR, NAND (NOT-AND), XOR (exclusive OR), but there are others too. In this article, we’ll be looking at AND gates.

    What is an AND Gate?

    The “AND” in “AND gate” might look like an abbreviation, but it is literally the English word “and”, rendered in capitals by convention. Its job in a circuit is to switch the circuit on or to divert it when two conditions are both in the “on”, “true” or “1” position.

    A 2-input AND gate works on the following truth table, where 1 means “on” or where a voltage is present, and 0 means “off”.


    Input A

    Input B

    Output

    0

    0

    0

    1

    0

    0

    0

    1

    0

    1

    1

    1

    Table 1: AND logic gate truth table

    As you can see, there are four possible conditions here, but there’s only one condition where the output is a 1, and that’s when both A and B are also 1. If you imagine a circuit with two buttons and an AND gate linked to a lamp, the lamp will only come on if both buttons are pressed simultaneously. As soon as one button is released, or if both buttons are released, the lamp will switch off.

    AND Gates with More than Two Inputs

    All the examples above use just two inputs, or conditions, to determine whether the output is on or off. There are AND gates with three, four or more inputs, but still, all the inputs need to be in the 1 position for the gate to output a 1. The truth table for a 3-input AND gate looks like this:


    Input A

    Input B

    Input C

    Output

    0

    0

    0

    0

    0

    0

    1

    0

    0

    1

    0

    0

    0

    1

    1

    0

    1

    0

    0

    0

    1

    0

    1

    0

    1

    1

    0

    0

    1

    1

    1

    1

    Table 2: 3-input AND gate truth table

    There are eight potential input states from the three inputs, but only one (1, 1, 1) will result in the output also being a 1. You can probably guess what the truth tables for 4- and 5-input AND gates look like, so we won’t reproduce them here. Basically, though, all inputs need to be 1s for the output to be a 1.

    How Do AND Gates Work?

    In their original incarnation, AND gates would have been built from valves, and eventually, transistors, arranged in a circuit so their base, collector and emitter leads set up the logic sequence. Only when certain conditions were met, namely when a small signal voltage was allowed to pass through the transistor, would the transistor allow voltage to pass through from the collector to the emitter, and thereby make a circuit.

    Time has passed, and technological advances have allowed the miniaturisation of components. Now, a simple AND gate is available as a single electronic component that is attached to the circuit board as per the requirements. There are two types of logic gates: TTL (Transistor-Transistor Logic) and CMOS (Complementary Metal-Oxide-Silicon).

    Uses of AND Logic Gates

    AND Gate Circuit Symbol

    An AND gate logic circuit can be used wherever a desired output (i.e. a voltage) will be switched on when two or more inputs are also on, but not when at least one of the inputs is off. Some typical examples would be:

    • In an application where two keyholders several meters apart need to simultaneously activate their own switch (perhaps to open a safe or launch a weapon), it will only work when person 1 AND person 2 turn their keys (a 2-input AND gate)
    • A circular saw will only turn on if the safety guard is down (activating a sensor) AND the foot pedal is pressed, but never for just one of those conditions (a 2-input AND gate)
    • A machine putting cream on cakes on a production line will only open its nozzle when sensors indicate that the conveyor belt is moving AND there’s a cake underneath the nozzle AND the hopper contains cream (a 3-input AND gate)

    You can see an example of the circuit symbol for an AND gate on the left.

    Further Reading