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

PISO: Parallel-to-Serial Conversion for SPI Transmission

MediumLogic CircuitBuild

Serial Peripheral Interface (SPI) master transmitters rely on parallel-to-serial conversion to serialize byte-wide data onto a single wire. This 8-bit PISO handles the core transmission phase of an SPI transaction.

The circuit operates on a continuous clock and receives an 8-bit parallel input D and an active-low chip select CS_bar. When CS_bar transitions from 1 to 0, the circuit must synchronously generate an internal LOAD pulse for exactly one clock cycle. During this cycle, the 8-bit value D is captured into an internal shift register.

On the clock cycle immediately following the LOAD pulse, the most significant bit (D[7]) must appear on the serial output tx. For the next 7 clock cycles, the remaining bits (D[6] down to D[0]) are shifted out to tx. When CS_bar is 1, tx must output 0.

Constraints

  • Implement an 8-bit shift register using D flip-flops.
  • Use a synchronous edge detector to generate the internal LOAD signal from CS_bar.
  • Output 0 on tx whenever CS_bar is 1 or during the LOAD cycle.
  • Shift out the most significant bit first.

Topics

State MachinesShift RegistersSPI

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