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

Ring Counter: Asynchronous Preset for Power-On Initialization

MediumLogic CircuitBuild

Control state machines often require a valid initial state before the first clock edge arrives. A power-on reset sequence relies on asynchronous initialization to force the initial token into the correct flip-flop.

Construct a 4-bit ring counter that shifts a single high bit rightward on each rising edge of clk, wrapping from the least significant bit back to the most significant bit. The circuit must handle an active-low initialization signal PRE_bar. When PRE_bar is asserted low, the counter must immediately output 1000 without waiting for a clock transition.

| PRE_bar | Current Q3 Q2 Q1 Q0 | Next Q3 Q2 Q1 Q0 (after clk ↑) | |-----------|-----------------------------|------------------------------------------| | 0 | Any | 1000 (Immediate, ignores clk) | | 1 | 1000 | 0100 | | 1 | 0100 | 0010 | | 1 | 0010 | 0001 | | 1 | 0001 | 1000 |

Constraints

  • Use standard D flip-flops for the state elements.
  • The initialization must be purely asynchronous.
  • Do not use synchronous reset logic to establish the power-on state.

Topics

sequentialasynchronouscounterspower-on

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