CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Sequential Logic

Minimum Flip-Flop Count for Mod-N Counter

MediumLogic CircuitAnalyze

Every custom counter design begins with determining the exact number of storage elements required to hold the sequence state. A Mod-N counter cycles through exactly N distinct states before returning to zero. The circuit relies on an array of flip-flops to represent these states in binary.

Because flip-flops provide states in powers of two, any Mod-N counter where N is not a power of two will contain unused or invalid states. The design is presented with two target specifications: a Mod-100 counter and a Mod-12 counter.

Calculate the minimum number of flip-flops required for each specification. Determine the exact number of invalid states the logic must handle and evaluate the architectural trade-offs for self-correction.

Constraints

  • All flip-flops are standard D-type edge-triggered devices.
  • The counter must strictly follow a binary sequence starting from zero.
  • Invalid states must be accounted for to ensure the state machine does not latch into an unrecoverable loop.

Topics

flip-flopscountersstate-machineshardware-design

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • 3-bit Ripple Counter from Toggle Flip-FlopsEasy
  • D Latch from a 2:1 MUXEasy
  • 2-bit Ring CounterEasy
  • T Flip-Flop from a D Flip-FlopEasy
  • Handshake Deadlock Due to Early ResetHard
  • Reconvergence of Individually Synchronized BitsHard
  • Debug: Asynchronous Clear GlitchHard
  • Clock Gate Enable Crossing DomainsHard

Browse all problems · Learning tracks