Codiode

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.

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.

Part of Counters

Problem 137 of 139 in the Counters track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.