Make Electronics

(nextflipdebug2) #1

Experiment 22: Flipping and Bouncing


212 Chapter 4


How It  Works
Two NOR gates or two NAND gates can function as a flip-flop:


  • Use NOR gates when you have a positive input from a double-throw switch.

  • Use NAND gates when you have a negative input from a double-throw
    switch.
    Either way, you have to use a double-throw switch.
    I’ve mentioned the double-throw switch three times (actually, four times if you
    count this sentence!) because for some strange reason, most introductory books
    fail to emphasize this point. When I first started learning electronics, I went crazy
    trying to understand how two NORs or two NANDs could debounce a simple
    SPST pushbutton—until finally I realized that they can’t. The reason is that
    when you power up the circuit, the NOR gates (or NAND gates) need to be
    told in which state they should begin. They need an initial orientation, which
    comes from the switch being in one state or the other. So it has to be a double-
    throw switch. (Now I’ve mentioned it five times.)
    I’m using another simplified multiple-step schematic, Figure 4-99, to show the
    changes that occur as the switch flips to and fro with two NOR gates. To refresh
    your memory, I’ve also included a truth table showing the logical outputs from
    NOR gates for each combination of inputs.


Figure 4-99. Using two NOR gates in conjunction with a positive input through a SPDT
switch, this sequence of four diagrams shows how a flip-flop circuit responds.

Suppose that the switch is turned to the left. It sends positive current to the
lefthand side of the circuit, overwhelming the negative supply from the pull-
down resistor, so we can be sure that the NOR gate on the left has one posi-
tive logical input. Because any positive logical input will make the NOR give
a negative output (as shown in the truth table), the negative output crosses
over to the righthand NOR, so that it now has two negative inputs, which make
it give a positive output. This crosses back to the lefthand NOR gate. So, in this
configuration everything is stable.
Now comes the clever part. Suppose that you move the switch so that it
doesn’t touch either of its contacts. (Or suppose that the switch contacts are
bouncing, and failing to make a good contact. Or suppose you disconnect the
switch entirely.) Without a positive supply from the switch, the lefthand input
Free download pdf