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

Handshake with Mismatched State Machines

HardLogic CircuitDebug

A fully interlocked handshake protocol ensures safe data transfer across clock domains. The source state machine asserts REQ to initiate a transfer and waits for the destination to assert ACK. Once ACK is received, the source deasserts REQ and must wait for ACK to return to zero before initiating the next transfer.

Expected behavior:

| Current State | Start | ACK | REQ | Done | Next State | |---------------|---------|-------|-------|--------|------------| | IDLE | 0 | X | 0 | 0 | IDLE | | IDLE | 1 | X | 0 | 0 | REQUEST | | REQUEST | X | 0 | 1 | 0 | REQUEST | | REQUEST | X | 1 | 1 | 1 | WAIT_LOW | | WAIT_LOW | X | 1 | 0 | 0 | WAIT_LOW | | WAIT_LOW | X | 0 | 0 | 0 | IDLE |

Simulation of back-to-back transfers shows the source domain registering a second completed transfer prematurely. When a new transfer is initiated while ACK is still high from the previous cycle, the source domain outputs Done = 1 again instead of waiting for ACK to drop. Inspect the circuit and correct the fault.

Constraints

  • You must only modify the state transition logic of the source domain.
  • Do not add new input or output ports.

Topics

Clock Domain CrossingDebugState MachinesHandshake

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