# How many flip flops are required to build a digital circuit?

Here is an example:

The periode of the this circuit is 9, and i want to build a digital circuit with only J-K flip flops.

Here is my argument, I can tell there is nine different states that leads to four possible combinations, for instance 0 results in 00 ... . In order to describe these nine states we need at least four bits, so we need four J-K flip flops to fully design the digital circuit.

There is also another argument, says, count the number of maximum occurrence, this would be the minimum number of logical ports that require to build the circuit. To clarify myself, here the 11 state comes four times and the rest each one or three times.

Are these two arguments equivalent? I had a very brief course on digital circuit at college, so i appreciate any reference to a reliable source if my question too general to be answered here.

• What is happening with the other input(s) to this circuit? How do you know what its initial state will be? – Elliot Alderson Aug 4 '18 at 16:54
• @ElliotAlderson If you mean J's and K's port, i don't know it yet, the Q1 and Q2 are the outputs of the first two flip flops. I added a new photo. – Sam Farjamirad Aug 4 '18 at 17:35
• The question cannot be answered if you don't know what the initial state of the flip-flops will be. Do you have a reset input? Any other inputs? Yes or no? – Elliot Alderson Aug 4 '18 at 17:50
• @ElliotAlderson No, nothing else. – Sam Farjamirad Aug 4 '18 at 18:10

However, without some kind of reset input the machine could wake up in one of the seven ($2^4$ possible states minus the 9 that are defined) unused states. Your problem definition doesn't suggest how we should deal with that possibility.