I have a project in Discrete Math and we have to apply some switching theory with it. I've had studied different type of flip flops (JK, SR, and D) and still confused about the clock component. I know flip-flops are edge triggered. But the problem is applying this to my circuit. My project is a game (Dots and Boxes specifically) which involves 12 buttons for the main game and a single button for starting a new game. The problem is I dunno how to implement this using flip flops. I do know how to implement it using latches. So, how do I make that clock component if each of the 12 buttons have a JK flip flop and the new game button as K. Should I just connect a button and the new game button to an XNOR then to a clock. Clocks isn't straightforward for me. Please link some references I can study for me to understand this stuff better.


Just because the input is called clock it doesn't have to be a regular clock.

Do your flipflops also have an asynchronous reset input? If so the simplest solution for your situation is to tie J high and K low and use the buttons as the clocks. The reset button then connects to the reset input of all the flipflops.

Failing that you need an oscillator, a crystal and an inverter, or something like a 555 to generate a constant clock pulse.

  • \$\begingroup\$ Thank you for your input, this was the best solution. However, do you recommend using this method or just using a latch. I find latches less complicated, but how is this better than using latches itself? Does this circuit makes use of the so-called edge-triggering considering that the 'clear' input for the JK flip-flop is used? \$\endgroup\$ – Orlando Lewis Dec 8 '16 at 17:08
  • \$\begingroup\$ This is effectively using the parts as a latch, as soon as the clock transitions high the output will remain high until reset. But the basic functionality you want is that of a latch. You want to remember whether the set button or the the reset button was most recently pressed. How is this better than using latches? That's easy, flip flops are far more common parts. Common parts are cheaper and easier to source. \$\endgroup\$ – Andrew Dec 8 '16 at 17:15
  • \$\begingroup\$ Is it also possible to have an D latch be implemented using D flip-flop by connecting the enable button to the clock and the data input to D. Am I right? \$\endgroup\$ – Orlando Lewis Dec 8 '16 at 17:27
  • \$\begingroup\$ And what problems can I expect when I use flip-flops as latches? \$\endgroup\$ – Orlando Lewis Dec 8 '16 at 17:27
  • \$\begingroup\$ Yes, D types would work fine for this, you would connect the input high and the button to the clock. I can't think of any fundamental problems with using them this way. When you get down to the physical devices there may be some things to look for that you wouldn't have on a latch, e.g. maximum rise times on the clock input, but these aren't normally an issue. \$\endgroup\$ – Andrew Dec 9 '16 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.