# Can you have different clocks working at different intervals to operate a flip flop?

Is it possible to have two clock signals driving a JK toggling flip flop, in which both signals are connected by a XOr gate so that the flip flop only works on either edge of either clock? If possible, then there are also two sequences for how the clock inputs will go. Assume that the clock is positive edge triggered.

For Sequence A, Phase 1 is when the clock is driven to 0 by the two low inputs. In Phase 2, the clock is driven 1 by Input 1, after which a desired flip flop output is obtained. Afterwards, in Phase 3, the clock goes back to 0 when the input combination is "11" due to the XOr gate, where the Q output will stay the same. In Phase 4, now the combination is "01" after "11", the clock is back on. Despite this, I wish to keep the output as obtained in Phases 2 and 3.

On the other hand, for Sequence B, Input 2 going high first in Phase 2 will generate a desired Q output, which is different than the one obtained in the first sequence. Similarily as in the first sequence, "11" combination will turn the clock off due to the XOr Gate. Finally, at "10" I wish to keep the same Q output as the 2nd and 3rd Phases.

The Output "Q" is supposed to be like the following, assuming that the flip flop is initially at RESET:

It might be confusing, but is any of this possible? Thank you.

• You've drawn the input waveforms. It would be less confusing if you draw your desired output waveforms as well. Is this a 'first contestant to press the button' indicator? Apr 2, 2020 at 5:12
• @Neil_UK Thanks for the note. I have modified the post to contain the Q output I wish to have from both sequences. Also, it isn't the indicator you've mentioned. Apr 2, 2020 at 6:19
• You've only drawn one Q output, how is that different from the first? Draw an output under sequence A, draw another output under sequence B. You might find you answer your own question once you've been forced to show us precisely what you want. Input 2 going high first in Phase 2 will generate a desired Q output, which is different than the one obtained in the first sequence. Apr 2, 2020 at 7:49
• @Neil_UK The Q output for Sequence A from the waveform I added is 1, while the Q output for Sequence B is 0. I just combined both sequences for clarity on how they are different. Sequence A generates a high, while Sequence B generates a low. Apr 2, 2020 at 8:27
• Don't paint word pictures, DRAW A DIAGRAM, showing each sequence and its results, in time alignment. It's an important skill that all engineers have to learn, and as I said, the answer may pop out at you as you are forced to put on paper exactly what you want. 'I just combined both sequences for clarity'? What would the next sentence read like if I combined the first half with the second half 'for clarity'? Voting to close. Apr 2, 2020 at 10:02