Codiode

Bidirectional SR: PISO Application (Choose Bit Order)

HardLogic CircuitBuild

Serial peripheral interface (SPI) controllers must often communicate with devices that expect data either least-significant bit (LSB) first or most-significant bit (MSB) first. A bidirectional parallel-in serial-out (PISO) shift register handles both formats dynamically by changing the shift direction and routing the appropriate end of the register to the output pin.

Construct a 4-bit bidirectional PISO shift register with internal flip-flop states Q3, Q2, Q1, and Q0.

load dir Action sout
1 0 Parallel load D3, D2, D1, D0 into Q3, Q2, Q1, Q0 Q0
1 1 Parallel load D3, D2, D1, D0 into Q3, Q2, Q1, Q0 Q3
0 0 Shift right: Q[2:0] gets Q[3:1], Q3 gets 0 Q0
0 1 Shift left: Q[3:1] gets Q[2:0], Q0 gets 0 Q3

Constraints

  • Use only standard D flip-flops and combinational logic gates.
  • Do not use high-level shift register primitives.
  • The serial output sout must reflect the currently selected end of the register immediately when dir changes.
  • Shift in 0 for the empty bit positions during shift operations.

Topics

Shift RegistersSPIPISOBidirectional

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 49 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.