Codiode

SIPO: Variable-Length Frame Reception

HardLogic CircuitBuild

Serial protocols like SPI and various sensor interfaces use programmable word lengths to support 8-bit, 12-bit, or 16-bit transfers dynamically. A variable-length Serial-In Parallel-Out (SIPO) shift register captures incoming bits and asserts a strobe signal only when the complete data frame is assembled.

The circuit continuously shifts the 1-bit din into the least significant bit of the 8-bit dout register on every rising edge of clk. A 3-bit input FRAME_LEN specifies the frame size minus one. For example, FRAME_LEN = 3 configures a 4-bit frame, and FRAME_LEN = 7 configures an 8-bit frame.

An internal counter must track the number of received bits. When the counter reaches FRAME_LEN, it must reset to 0 on the next clock cycle and assert the 1-bit STROBE output to 1. On all other cycles, the counter increments by 1 and STROBE remains 0. The 1-bit rst is a synchronous active-high reset that clears dout, STROBE, and the internal counter to 0.

Constraints

  • Use a synchronous active-high reset for all registers.
  • Register the STROBE output to prevent combinational glitches.
  • Shift din into dout[0] and shift existing bits left toward dout[7].
  • Shift dout continuously on every clock cycle regardless of the counter state.

Topics

CountersShift RegistersSIPO

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 Shift Registers

Problem 19 of 86 in the Shift Registers track.

Related problems

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

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