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

Four Phase Handshake Synchronizer

HardLogic CircuitBuild

Reliable data transfer across asynchronous clock boundaries requires strict flow control. A four-phase handshake guarantees data delivery regardless of the frequency ratio between the transmitting and receiving domains.

The circuit consists of a transmitter operating in the clk_a domain and a receiver operating in the clk_b domain. Both domains share an active-high synchronous rst signal.

When the start input is asserted high for one clk_a cycle, the transmitter must assert req high and busy high. The receiver synchronizes req into the clk_b domain using a two-stage flip-flop synchronizer. Upon detecting the synchronized request transitioning high, the receiver asserts ack high and pulses valid high for exactly one clk_b cycle.

The transmitter synchronizes ack back into the clk_a domain. Upon detecting the synchronized acknowledge transitioning high, the transmitter deasserts req low. The receiver synchronizes this low request and subsequently deasserts ack low. Finally, the transmitter synchronizes the low acknowledge and deasserts busy low, completely returning the system to the idle state.

Constraints

  • Use two separate state machines: one clocked by clk_a and one by clk_b.
  • Use exactly two D-flip-flops for all cross-domain synchronizer chains.
  • Drive req and ack directly from flip-flops to prevent glitches during clock domain crossing.
  • Hold busy high continuously until the entire four-phase sequence completes.

Topics

state-machineclock-domain-crossingsynchronization

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