Hardware Hacking - Nicolas Collins

(Brent) #1

76 Nicolas Collins


INPUT A INPUT B OUTPUT


0 0 0


1 0 0


0 1 0


1 1 1


You see that the output only goes “true” when both inputs are true.


A NAND gate adds an inverter stage after the AND logic to flip the output like
this:


INPUT A INPUT B OUTPUT
0 0 1
1 0 1
0 1 1
1 1 0


The inverter introduces the principle of Pythonesque denial (discussed in the
Chapter 18) that transforms this logic circuit into a “gateable oscillator.”


Look at the circuit below. Note that the basic design is similar to our earlier
oscillator: a capacitor between an input and ground; a feedback resistor from the
output back to the input. But where each stage in the Hex Inverter package had
just one input, each NAND gate has two inputs. Because of the combinatorial
logic of the NAND gate, the second input of the gate can be used as a control
input to turn the oscillator on and off: the output of the circuit can only change
state (i.e., oscillate) when the control input is held “high” (+9 volts), otherwise
the output always stays in its “1” state (+ 9 volts.)


Try it. Remember to hook up power to the chip as you did with the 74C14: +9
volts to pin 14, ground (battery -) to pin 7. For the “switch” indicated in the
schematic, you can just plug a bit of wire into the socket near the gate input and
connect and disconnect the other end from the +9 volt bus to make the contact.
The two inputs to each gate are identical -- it doesn’t matter which you use for
the “control input” (the one with the switch) and which for the “feedback input”

Free download pdf