Make Electronics

(nextflipdebug2) #1

Experiment 19: Learning Logic


196 Chapter 4


In the 74HCxx logic family, each input of a logic gate consumes just a micro-
amp, while the output can source 4 milliamps. This seems paradoxical: how
can the chip give out more than it takes in? The answer is that it also consumes
power from the power supply attached to pins 7 and 14. That’s where the ad-
ditional electricity comes from.
Because the logical output from a chip can be greater than the logical input,
we can put the chip in a state where it keeps itself “switched on” in a way which
is similar to the way the relay in the alarm project was wired to lock itself on.
The simplest way to do this in a logic chip is by feeding some of the output
back to one of the inputs.
Figure 4-79 shows an AND gate with one of its inputs wired to positive and its
other input held low by a pull-down resistor, with a pushbutton that can make
the input high. A signal diode connects the output of the chip back to the
pushbutton-controlled input. Remember that the diode has a mark on it indi-
cating the end which should be connected to the negative side of the power
supply, which in this case will be the end of the 10K resistor.
The schematic in Figure 4-79 shows how the circuit should look in breadboard
format. Figure 4-80 shows it in a simpler format.

From this point on, I won’t bother to show the power regulator and the capacitors
associated with it. Just remember to include them every time you see the power sup-
ply labeled as “5V DC Regulated.”

When you switch on the power, the LED is dark, as before. The AND gate needs
a positive voltage on both of its logical inputs, to create a positive output, but
it now has positive voltage only on one of its inputs, while the other input
is pulled down by the 10K resistor. Now touch the pushbutton, and the LED
comes on. Let go of the pushbutton, and the LED stays on, because the posi-
tive output from the AND gate circulates back through the diode and is high
enough to overcome the negative voltage coming through the pull-down
resistor.
The output from the AND gate is powering its own input, so the LED will stay
on until we disconnect it. This arrangement is a simple kind of “latch,” and can
be very useful when we want an output that continues after the user presses
and releases a button.
You can’t just connect the output from the gate to one of its inputs using an
ordinary piece of wire, because this would allow positive voltage from the tac-
tile switch to flow around and interfere with the output signal. Remember, you
must never apply voltage to the output pin of a logic gate. The diode prevents
this from happening.
If you’ve grasped the basics of logic gates, you’re ready now to continue to our
first real project, which will use all the information that I’ve set out so far.

74HC08
AND
gate

5VDC Regulated

10K

1K

Figure 4-79. Using a diode, the logical
output from a gate can be allowed to feed
back to one of its inputs, so that the gate
latches after receiving a brief logical input
pulse.


Figure 4-80. The breadboard-format sche-
matic in is simplified here to show more
clearly the way in which a gate can latch
itself after receiving an input pulse.

Free download pdf