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

Complete Counter Design

HardLogic CircuitBuild

System timers and real-time clock dividers require counters that handle arbitrary moduli, parallel data injection, and guaranteed recovery from single-event upsets. This complete counter block integrates load priority, modulo counting, terminal signaling, and robust error recovery.

The circuit is a 4-bit synchronous up-counter with outputs Q3, Q2, Q1, and Q0. It counts sequentially from 0 (0000) to 11 (1011). When load is 1, the counter synchronously loads the values from D3, D2, D1, and D0 on the next clock edge, overriding all other behaviors. When load is 0, the counter follows the counting and self-correction sequence.

| Current State (Q3 Q2 Q1 Q0) | Next State (when load = 0) | tc | |-------------------------------------|------------------------------|------| | 0 to 10 | Current State + 1 | 0 | | 11 (1011) | 0 (0000) | 1 | | 12 to 15 (Invalid) | 0 (0000) | 0 |

Constraints

  • Implement using D flip-flops and combinational logic.
  • The load signal must have strict priority over the count and self-correction logic.
  • All invalid states must transition directly to 0000 when load is 0.
  • Terminal count tc must be completely combinational and assert only during state 11.

Topics

Sequential LogicCountersState MachinesError Recovery

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