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

Mod-3 Counter

MediumLogic CircuitBuild

Phase-locked loops, frequency dividers, and round-robin arbiters rely on non-power-of-two counters to manage uneven timing cycles. The Mod-3 counter is the fundamental building block for these asymmetric dividers.

Implement a 2-bit synchronous counter that sequences through states 0, 1, and 2. State 3 is unused and serves as a don't-care condition for logic minimization. The circuit must compute the next state (D1, D0) based on the current state (Q1, Q0).

| Q1 | Q0 | D1 | D0 | |------|------|------|------| | 0 | 0 | 0 | 1 | | 0 | 1 | 1 | 0 | | 1 | 0 | 0 | 0 | | 1 | 1 | X | X |

Constraints

  • Use exactly two D flip-flops.
  • Implement the next-state logic using only basic combinational gates.
  • Use a synchronous rst signal to initialize the state to 00.
  • Do not use high-level counter modules or adders.

Topics

CountersState MachinesNext-State Logic

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