Saturday, January 31, 2015

@MAKE Electronics Experiment 19 - logic chips (Part III)-Latching with a NOR

At the end of the chapter, Charles shows how to latch an AND gate to HIGH by putting a diode between the output and input 2, which goes to a 10K resistor and GND, as well as to a switch. Input 1 goes to power. So, at power up, on input 1 is H and input 2 is L, AND ing to L, so the LED does not light.  When the switch in pushed, input 2 goes H, ANDing to H, and the LED lights.  By feeding the output to input 2, when it goes H, the circuit stays H.

As I mentioned, I do not have my 74HC08 AND chips yet. I got a shipment from China today, but it was my 555s, not my 74HC08s.  I wracked my brains trying to figure out how to replicate this latching with the chips I have.  I found a useful example here That got me thinking.  However, I think I really need a gate that is H when both inputs are H. The only other one that might work is XNOR, but I don't have that either. I may be wrong--but I can't figure that out.

Then I figured that what I really need is a latch, and should focus on that.  A google for "latch a logic ic to low" yielded this.  I followed the directions for an "Active-high circuit: Both inputs are normally tied to ground (LOW), and the latch is triggered by a momentary HIGH signal on either of the inputs" (same web site).  That's what I have on the NOR Gate.  Both inputs are L, and are taken H the corresponding button is pushed.  

So, I used the gate on the opposite side of the chip. I added 10K resistors to GND on the inputs. Input 1 was tied to the output of the other gate.  Input 2 was tied to switch 2, so it goes H when the switch is pushed.  The output goes to Input 2 of the other gate.  Input 1 of that gate is still connected to the switch, and output to the NAND gate as before, in addition to input 1 of the other gate.

As before, on power up the both inputs to NOR gate 1 are L, so it's output is H, causing the NAND gate to output L in response to it's 2 H inputs, and the LED is dark.  Also as before, when we press switch 1 the output of NOR gate 1 NORs to L and the NAND gate goes H and the LED lights. HOWEVER, when we let go of the button, the LED stays lit because the output also goes to the other NOR gate which now goes H and feeds that back to input 1 of the other gate. The light stays on until it's reset, which happens when the other button is pressed, causing input 2 of gate 2 to go H and the output to go L, causing input 2 of gate 1 to go low, causing the output of gate 1 to go H as at power on.

Not as complicated as it sounds. See the reference for diagrams and further explanation.

Here's the video.