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

Frequency Limit Detector

HardLogic CircuitBuild

Hardware systems must protect themselves from interrupt storms or mechanical contact bounces that escape early filtering stages. A frequency limit detector acts as a digital throttle: it enforces a strict minimum spacing between incoming events.

The circuit must monitor event_in for a rising edge (a transition from 0 to 1). When a rising edge is detected, the circuit evaluates the number of clock cycles elapsed since the most recent rising edge.

  • If 10 or more clock cycles have elapsed, or if this is the first edge since reset: assert valid_event to 1 for exactly one clock cycle.
  • If strictly fewer than 10 clock cycles have elapsed: assert error to 1 for exactly one clock cycle and keep valid_event at 0.
  • The internal timer restarts its count on every rising edge of event_in, regardless of whether the event was flagged as valid or an error.

Outputs must remain 0 on clock cycles where no rising edge is detected.

Constraints

  • Use a synchronous active-high rst signal.
  • Evaluate the rising edge and assert the corresponding output in the same clock cycle that the 0-to-1 transition occurs.
  • Do not increment the internal counter beyond the threshold required to validate the next event.

Topics

CountersState MachinesEdge Detection

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