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

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.

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