Since I wanted to use set and reset buttons, I needed to provide normally high inputs to the latching circuit. I did that with the other two gates on the 74HC00 chip. Since NAND output is L only when both inputs are H, I was able to provide one H input from each Gates C & D by connecting one input to Vcc and the other to a momentary pushbutton. Each pushbuton is connected to Vcc on one side and the input to C or D as well as a 10K resistor and GND on the other side.Therefore, the outputs of C & D are H unless the corresponding button is pushed, in which case that input is H, paired with other H input, so the output is L.
On the other side of the chip, I moved the LED circuit to gate B. The output of gate B goes to the LED and on to a 1K resistor and GND. That output also goes to input 1 of gate A. Input 1 of gate B is output of C and input B2 is the output of A. Input A1 is the output of B as just described and input A2 is the output of Gate D. Here's the schematic:
|Make:Electronics Experiment 19 Part IV - Latching with NAND|
On power up, this LED is lit, I did not expect that, but here's what I think is happening:
- Pin 8 is H (see above), so Pin 4 is H. There is not enough current in the circuit to make pin 5 H, so pint 6 NANDs to H, lighting the LED and making pin 2 H, Pins 2 and 3 (H for the same reason as pin 4), NAND to L, so pin 5 is L and the LED stays lit.
- Press S2 and pins 11 and 1 go L. Pin 2 is still H, so 1&2 NAND to H, making 5 H, which NANDs with pin 4 (H), to make pin 6 L, turning the LED off and latching pin 2 to L to keep it off.
- Press S1, Pins 8&4 go L, and since 5 is H they NAND to H on pin 6, turning the LED on and latching pin 2 to H to keep it on.
And so on. Here's the video.