GATE / CS ARCHIVE

SIMILAR QUESTIONS / DIGITAL LOGIC

Count storage bits for distinct counter states

2 questions solved the same way, newest first. Back to Digital Logic

How these are solved

A counter with N distinct states needs the smallest integer k for which 2^k>=N; evaluate ceil(log2 N). Explicit distinct-state/modulus counts.

1 mark · MCQ
Report issue

Asked again GATE 1994, Q2.1 (different numbers)

Flip-flops for modulus258

Counters & Timing

Question 15, GATE 2011: What is the minimum number of D flip-flops needed for a modulo-258 counter?

(A) 9
(B) 8
(C) 512
(D) 258
Tap to enlarge
Your answer
Answer & solution

Official answer: A

k flip-flops provide at most 2k states. Since28=256<258≤512=29, at least 9 are needed; a 9-bit counter with suitable reset logic suffices. Hence A.

A modulo-m counter needs m distinct states before repeating. Each flip-flop stores one binary bit, so k of them encode at most 2k different combinations. Taking a ceiling gives k=ceil(log2 258)=9. The 9-bit device has extra possible combinations, but logic can reset or redirect the sequence after 258 states. Options 258 and 512 confuse the number of states with the number of storage bits.

Original paper, page 4 · Answer key

Report issue

Asked again GATE 2011, Q15 (different numbers)

Flip-flops for a modulo counter

Counters & Timing

Question 2.1, GATE 1994: Fill in the minimum number of flip-flops required for a binary modulo-N counter.
Tap to enlarge
Answer & solution

Answer: ceil(log₂N), for N≥2 (no official key was published)

With k flip-flops, the state register has at most 2^k distinct binary states. A modulo-N counter must distinguish N positions before repeating, so 2^k≥N and k≥ceil(log₂N). This many bits are sufficient: use N of the available states and arrange the transition after N−1 to return to zero. Non-power-of-two counters leave unused codes, whose recovery behavior should be designed separately. The degenerate N=1 counter can be a constant output with no state bits in the abstract model.

Original paper, page 3