# General Approach To Calculate Minimum Number Of Flip-Flops Required

In the previous two years of the GATE exams, a question has been asked for finding number of flip flop's for counting sequence $0−1−0−2−0−3$ in 2016 and $0−0−1−1−2−2−3−3−0−0$ in 2015. But still, the approach discussed in these questions hasn't arrived at Common answer (or) solution.

For $0−1−0−2−0−3$, there are $6$ different states, and thus it acts as a mod−6, counter So, 3 FF's are suffice. In another approach it is said that $2$ bits are used to distinguish three $0$′s and $2$ for $1,2,3$. So number of FF's required =2+2=4

Similar is the case in $0−0−1−1−2−2−3−3−0−0$, one approach says setting clock such that output of FF will be sampled at twice the input frequency makes me think 2 FF's would suffice. But on the other-hand using 2 FF's for $1,2,3,4$ and 1 FF for identifying which 1 out of two 1′s makes me think $3$ is also right.

So, I want to be sure in answering these type of questions as they have been asked in recent past [GATE] Exams.Please tell the general approach to solve these type of questions also please comment about minimum number of JK FF's required for following counting sequence so that i will be able to work out myself using the technique provided by you and evaluate my understanding.

1. $0−0−0−1−1−2−2−3−3−...$
2. $0−1−0−2−0−2−0−3−0−2−...$
3. $1−2−3−0−0−1−0−2−2−...$
• I may be missing something. If the sequence is cyclic with period $n$, why isn't the answer $\left\lceil \log_2 n \right\rceil$? You must have enough memory to store a number between $0$ and $n-1$. The rest can be done with combinatorial logic. – Pseudonym Nov 22 '16 at 3:53
• You are editor of that commercial website. You should not post name of your commercial website here. gateoverflow.in/user/pC – ً ً Jun 29 '17 at 11:40
• You can give original reference(i.e., IIT websites). – ً ً Jun 29 '17 at 11:41