Function
The symbol for a 2-input AND gate looks like this:
Input voltages can be LOW, logic 0, or HIGH, logic 1, and the gate obeys the
following truth table:
input B
input A
output
The output becomes HIGH only when input A AND input B are HIGH.
This is the symbol for a 3-input AND gate:
As you can see from the truth table, the output becomes HIGH only when all three
inputs are HIGH:
input C
input B
input A
output
Cascading works with AND and OR gates, but not with NAND and NOR.
Applications
Most security lights and garden floodlights have a PIR, or passive infra-red device
which is sensitive to heat radiation. When a hot object such as an intruder or the
neighbour's cat, is detected the heat sensor gives a HIGH voltage, logic 1. During the
day, the floodlight doesn't light up, but, when it is dark, the floodlight comes on if the
heat sensor is triggered. Typically, the floodlight remains on for a few moments after
the intruder/cat has gone.
A system like this requires an AND gate:
For safety reasons, you must NEVER connect circuits directly to the mains supply.
Here is the subsystem diagram, or block diagram, for a bath alarm which will sound an alarm
before the water in the bath overflows:
The float sensor consists of a voltage divider with a float switch at the top and a 100
k pull down resistor at the bottom. If the water level rises above a critical level, the
float switch closes and the output of this subsystem becomes HIGH, logic 1.
The astable, or pulse generator, produces pulses. Its output alternates repeatedly from
HIGH to LOW. The float sensor provides a control input to the AND gate. If the
control input is LOW, the output of the AND gate remains LOW. However, if the
control input goes HIGH, the output of the AND gate starts to produce pulses,
alternately HIGH and LOW, following the astable.
The transducer driver is needed to provide enough current to drive the buzzer. When
the bath is full, the buzzer pulses ON and OFF.
It is easy to model this system using the system blocks provided by Crocodile
Technology :
connected either to 0 V or to the +V power supply. (You don't need to do this for
circuits on prototype board.) Unused outputs are left unconnected.
In the 74LS series, the 74LS08 provides four 2-input AND gates. As you can see, the
pin connections are different!
74LS series devices usually require a regulated 5 V power supply. The LM7805 and
LM78L05 are suitable power supply regulator devices.
The 74HC08 is a pin-compatible replacement for the 74LS08, with improved
electrical properties and a wider range of power supply voltage.
Although 74HC series devices are designed to work with a 5 V power supply,
voltages between 3 V and 6 V are allowed and most circuits work well using 4.5 V (3
x 1.5 V cells). Don't use a 9 V power supply!
Details about these integrated circuits are given elsewhere in the Beastie Zone. Click
the diagrams to follow these links.
There are other ways of making AND gates. In the diagram below, an industrial
machine is represented by a motor:
It's not immediately obvious how this arrangement works as an AND gate. Run the
simulation by clicking on the diagram and follow through the truth table to confirm
that the output goes HIGH only when both inputs are HIGH.