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

Pulse Width Capture Register

MediumLogic CircuitBuild

Pulse width modulation receivers and frequency counters require stable data for downstream processing. A capture register holds a fleeting measurement while the system prepares for the next incoming pulse.

The circuit must monitor the 1-bit pulse signal and detect its falling edge. When a falling edge occurs, it must store the current 8-bit count_in value into the 8-bit capture_out register. Simultaneously, it must assert the 1-bit valid signal to notify downstream logic that new data is available.

Behavioral requirements: * Synchronous updates occur on the rising edge of the 1-bit clk signal. * When the 1-bit rst signal is 1, capture_out is reset to 0 and valid is forced to 0. * When pulse transitions from 1 to 0, capture_out updates with count_in and valid becomes 1 for exactly one clock cycle. * During all other conditions, capture_out retains its previous value and valid remains 0.

Constraints

  • Implement using synchronous logic triggered by the rising edge of clk.
  • Treat rst as a synchronous, active-high reset.
  • The valid signal must be registered and remain high for exactly one clock cycle per falling edge.

Topics

Synchronous LogicRegistersEdge 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