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

SPI Mode 1 Timing

MediumLogic CircuitBuild

Many high-speed sensors require SPI communication where data is shifted on the leading clock edge and sampled on the trailing edge. This specific phase and polarity configuration ensures setup and hold times are met across long bus traces.

Implement the core datapath for an SPI Mode 1 interface. The system uses a clock signal sck which idles low. The mosi output must update with the value of tx_bit on the rising edge of sck. The rx_bit output must capture the value of miso on the falling edge of sck. An active-high rst signal asynchronously clears both outputs to 0.

| Event | mosi | rx_bit | |-------|--------|----------| | rst = 1 | 0 | 0 | | sck ↑ | tx_bit | Unchanged | | sck ↓ | Unchanged | miso |

Constraints

  • Use D flip-flops for state retention.
  • Do not use transparent latches.
  • The reset signal must clear the state asynchronously.

Topics

Sequential LogicFlip-FlopsSPI

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