Codiode

Custom Even-Number Sequence Counter

HardLogic CircuitBuild

Memory addressing schemes and specialized DSP algorithms often require non-linear or specific step-based data sequences. Generating a custom numeric progression directly in hardware avoids the latency of software-based lookup tables.

The circuit must generate a continuous 4-bit sequence of even numbers: 2, 4, 6, 8, 10. The sequence must wrap back to 2 on each active clock edge. Any invalid state must transition to the starting value of 2 (0010) on the next clock cycle. An active-high rst signal must asynchronously force the output to 2. The outputs Q3, Q2, Q1, and Q0 represent the current state, with Q3 as the most significant bit.

Current State (Q3 Q2 Q1 Q0) Next State (Q3 Q2 Q1 Q0)
0010 0100
0100 0110
0110 1000
1000 1010
1010 0010
All other states 0010

Constraints

  • Implement using D flip-flops and combinational logic gates.
  • All invalid states must recover to 0010 on the next clock edge.
  • The asynchronous rst input must immediately force the state to 0010.

Topics

countersstate-machinesequence-generator

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 130 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.