Push-button and Jk flip flop

digital-logic

I have a mechatronics project where I have to use a push button switch at the input of A jk-flip flop my problem is when I click the switch it gives me the input 1 to the jk input the moment I remove my finger from the button it gets to zero. I want a way so that when I click the push button the input to be saved as 1 at the input of jk. I mean even when I remove my finger the input to remain 1 and get back to zero just when I click the switch again.

Best Answer

I made this small circuit plan for you: enter image description here

It basically splits the signal from the button and compares it with the JKs output to determin whether J or K shall be activated. Please notice that the purpose of the two inverters in the very middle is just adding a delay. You can achieve that in a more elegant way probably in reality (e.g. loading a capacitor to the threshold voltage).

Short summary:

if Button:

if J==1:

  K=1

if K==1:

  J=1

I hope that this answer was helpful!

All the best!