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

4-Bit Step-3 Counter: Custom Sequence

HardLogic CircuitBuild

Phase generators and memory address sequencers often require non-standard counting intervals to align with specific timing windows. The step-3 counter generates a custom sequence that increments by three on every clock cycle.

The circuit must produce a 4-bit output using four 1-bit signals: Q3 (MSB), Q2, Q1, and Q0 (LSB). The counter must follow the valid sequence 0, 3, 6, 9, 12, and loop back to 0. It must be self-correcting: if the circuit enters any of the 11 invalid states, the next clock edge must transition the state to 0. An active-high 1-bit rst signal synchronously forces the output to 0.

| Q3 | Q2 | Q1 | Q0 | Next State (Q3 Q2 Q1 Q0) | |------|------|------|------|----------------------------------| | 0 | 0 | 0 | 0 | 0011 | | 0 | 0 | 1 | 1 | 0110 | | 0 | 1 | 1 | 0 | 1001 | | 1 | 0 | 0 | 1 | 1100 | | 1 | 1 | 0 | 0 | 0000 |

For all other 11 state combinations of Q3, Q2, Q1, and Q0, the next state must be 0000.

Constraints

  • Use D flip-flops for all sequential elements.
  • Implement synchronous active-high reset logic.
  • Map all 11 invalid states explicitly to 0 in the next-state logic.

Topics

k-mapcountersstate-machine

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