# Reset of a JK flip flop pulse indicator

I've made a circuit with 74HC109 JK flip flops. The purpose is to catch a pulse from two signals and for about 20 seconds keep the stored value (of which pulse came first). My problem is I need to reset the circuit, both at power up and later on. Unfortunately I don't know how to pull the /CLR lines without wrecking the /Q lines outputs. Grounding them when they are high, I suppose would cause the to draw a lot of current? Is it possible to solve by make a open collector coupling between the /Q and /CLR?

simulate this circuit – Schematic created using CircuitLab

• Your circuit is not clear, I don't understand what the dashed lines mean. Are these additional inputs, namely /clr and /pre(load)? please clarify this part a bit. also, are you also willing to consider other topologies to achieve your goal? You are using JK ffs as T ffs for a start, and I sense there's room for improvement (if your current circuit works). Jan 20, 2015 at 9:56
• Yes, the dashed lines are for /CLR /PRE inputs which were missing in the editor. Yes I'm interested in other topologies. Jan 20, 2015 at 10:05

I think using D flip flops with an asynchronous reset input can solve all your problems:

simulate this circuit – Schematic created using CircuitLab

How does this work? Let the top flip flop be A and the bottom one be B.

When you power your circuit you pull $\overline{RST}$ down so both flip flops hold zero value, that meaning that $Q_{A,B}$ are low an $\overline{Q}_{A,B}$ are high.

When A (B) toggles, $Q_A$ ($Q_B$) goes high because $D_A=\overline{Q}_B$ ($D_B=\overline{Q}_A$) was high, and of course $\overline{Q_A}$ ($\overline{Q_B}$) goes low. Now whatever happens to B (A) the circuit can't change state because $D_B$ ($D_A$) is low. Please note that if something happens to A (B), i.e. another pulse arrives, the circuit indeed changes state.

To reset everything just pull $\overline{RST}$ down.

This thing can work if A and B pulses can't come too near in time: i you press both buttons, or press them very fast, what this circuit is going to do is not specified.

Sorry for the ugly schematic but I could not figure out how to depict diagonal wires.

addendum if you need to use jk flip flops, because you have them lying around or because it's an homework question or because you just love jk ffs, you can build a D ff with a JK and a not port:

simulate this circuit

addendum 2: As Jasen pointed out in the comments, for this particular application the not gate isn't necessary since the input signals to the flip flops are available also in the negated form.

• you don't actially need the inverter, just use Q: Q1-K2 /Q1-J2 Q2-K1 /Q2-J1 Jan 20, 2015 at 12:32

This works:

And here are the data files you'll need to run an LTspice simulation if you want to. Download all of the files into the same folder and run the .asc file with LTspice.

• Have you tried this in a real application? In actual HW? Jan 20, 2015 at 13:24
• @Dejvid_no1: What difference does it make? Jan 20, 2015 at 13:35
• @Dejvid_no1: I don't know whether you noticed, but my circuit includes Power On Reset, manual master reset, and ~ a 20 second lockout period where once either switch is pushed and its corresponding output goes hot, both switches are ignored until the 20 second timer (U2C, R4, C2) times out. Manual reset is never locked out, however, and the circuit can be manually reset at any time. Jan 20, 2015 at 15:03
• Yes, I noticed and will probably "steal" some of your ideas. Thanks. Jan 20, 2015 at 15:21

You are having problems because JK flipflops aren't the right functional block here. As Vladimir already pointed out, this can be more easily done with D flipflops.

However, another approach to consider is a small microcontroller. It would read all the inputs (only two in your example, but easily expanded to more) often, like every 10 µs. When one is found set, it sets the outputs accordingly and ignores the switch inputs until reset. In the very unlikely event that multiple inputs are found asserted at the same time, just randomly pick one of them.

The timing and logic can now be whatever you want it to be. This method also easily scales to more than two inputs. And, the actual hardware is simpler than a bunch of flipflops. You pretty much just need the micro and its bypass cap. Many micros have internal clocks and the option for internal pullups on some of the input lines. The rest is rather simple firmware.

• Thanks, this particular application prohibits the use of an microcontroller. Although it would make things a lot simpler! Jan 20, 2015 at 13:50
• @Dejvid: You might have mentioned that up front. Jan 20, 2015 at 13:53
• Taking the time to peruse the data sheet reveals that an HC109 magically becomes a dflop just by connecting the J and Kbar inputs together and treating that junction like the D input of, say, an HC74. Also, advocating the use of an MCU without showing the code behind the application is exactly the same as advocating the use of hardware without showing the schematic, a la: "Just use an HC109 and an HC11", neither scenario being at all helpful to the querent, don't you agree? Jan 20, 2015 at 14:09