Codiode

Zero Insertion Serializer

HardLogic CircuitBuild

Serial communication protocols like CAN and USB require frequent edge transitions for reliable clock recovery. A bit stuffing circuit monitors the outgoing data stream and automatically injects dummy bits to break up long sequences of identical values.

The circuit tracks the number of consecutive 1s transmitted. During normal operation, dout mirrors din. When three consecutive 1s are transmitted, the circuit enters an insertion cycle. During the insertion cycle, dout is forced to 0 and stall is asserted to 1 to signal the upstream data source to hold its current bit. The internal counter resets after any 0 is transmitted.

rst din Current Count dout stall Next Count
1 X X 0 0 0
0 0 0 0 0 0
0 1 0 1 0 1
0 0 1 0 0 0
0 1 1 1 0 2
0 0 2 0 0 0
0 1 2 1 0 3
0 X 3 0 1 0

Constraints

  • Implement synchronous reset using the rst signal.
  • Use D flip-flops to maintain the consecutive bit count.
  • The stall signal must assert exactly during the cycle the stuffed 0 is output.

Topics

State MachineBit StuffingProtocol

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.

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.

Part of Interface and Communication Circuits

Problem 37 of 79 in the Interface and Communication Circuits track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.