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

Bidirectional SR: Serial Inputs at Both Ends

MediumLogic CircuitBuild

Data link controllers and cryptographic stream ciphers require bidirectional data flow with independent boundary feeds. A bidirectional shift register with separate left and right serial inputs enables independent data loading depending on the active shift direction.

Implement a 4-bit bidirectional shift register with independent serial inputs. The register updates its state on every clock cycle based on the direction control signal dir. When shifting right, data enters at Q0 from SER_R and propagates toward Q3. When shifting left, data enters at Q3 from SER_L and propagates toward Q0. An asynchronous active-high rst clears all bits to 0.

| rst | dir | Q3 (next) | Q2 (next) | Q1 (next) | Q0 (next) | |-------|-------|-------------|-------------|-------------|-------------| | 1 | X | 0 | 0 | 0 | 0 | | 0 | 0 | Q2 | Q1 | Q0 | SER_R | | 0 | 1 | SER_L | Q3 | Q2 | Q1 |

Constraints

  • Use exactly four D flip-flops for state storage.
  • Use 2:1 multiplexers to route the correct next-state data to each flip-flop's D input.
  • Connect the asynchronous clear ports of all flip-flops to the rst signal.

Topics

Shift RegisterMultiplexersSequential Logic

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