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

Zero Deletion Deserializer

HardLogic CircuitBuild

Serial communication protocols like USB and CAN use bit stuffing to maintain clock synchronization. The receiver must strip out these dummy bits to recover the original data payload.

The circuit receives a continuous serial bitstream on din. It shifts valid bits into an 8-bit parallel register dout, shifting new bits into the LSB and existing bits left. If three consecutive valid 1s are shifted in, the protocol dictates that the immediately following bit is a stuffed bit. The circuit must ignore this stuffed bit: it must not be shifted into dout. After ignoring the stuffed bit, the consecutive 1s counter resets to 0.

| Cycle | rst | din | dout | Note | |-------|-------|-------|--------|------| | 1 | 1 | 0 | 0 | Reset | | 2 | 0 | 1 | 1 | Valid | | 3 | 0 | 1 | 3 | Valid | | 4 | 0 | 1 | 7 | Valid (3rd consecutive 1) | | 5 | 0 | 0 | 7 | Stuffed bit is ignored | | 6 | 0 | 0 | 14 | Valid, shifted in normally |

Constraints

  • Use a synchronous active-high reset rst.
  • dout must initialize to 0.
  • Shift new valid bits into the LSB of dout.
  • The stuffed bit must not affect the consecutive 1s counter.

Topics

Sequential LogicInterfaceDeserializer

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