In my free time I've been trying to implement some simple logic gates and circuits using BJTs only (BC547s are the ones I have lying around).
The circuit
I've successfully built inverters, NAND and NOR gates. However I ran into trouble when I tried creating some sort of "latching" circuit. Here's the logic diagram:
Both A AND B need to be HIGH in order to turn on the output, but once it's on, A can go back LOW and Q will stay HIGH until A goes back LOW.
Here's what my attempt looks like using a NAND and NOR gate, each followed by an inverter:
The base resistors are 10k and the collector resistors are 1k, VCC is 5V
The Problem
The circuit works. Sometimes. When I first tried it out, it worked like a charm. All of a sudden it stopped working. It would get stuck in the HIGH state when it should have been LOW and the other way around. I found out that if that happened, I could "flip" it into the correct state by touching resistor R8.
I'm a 2nd year EE student, I know about digital circuits (only on the logic gate level, not how they're implemented) and a bit about BJTs.
I'd greatly appreciate if somebody could shed some light on this for me.
Thanks, and a happy new year :)