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

Read After Write Hazard and Bypass Forwarding

HardLogic CircuitBuild

Pipelined processors frequently encounter structural hazards when an instruction attempts to read a register in the exact clock cycle another instruction writes to it. Without intervention, the read operation fetches stale data. A bypass forwarding network solves this by routing the incoming write data directly to the output port when a simultaneous read and write target the same address.

Construct the bypass logic for a single read port. The circuit receives the data fetched from the storage array (reg_read_data), the incoming write data (write_data), the target read address (read_addr), the target write address (write_addr), and the write enable signal (write_en).

The output out_data must reflect the bypassed write_data if a valid write is occurring at the requested read address. In all other cases, it must output reg_read_data. Address inputs are 2 bits wide. Data buses are 4 bits wide.

Constraints

  • Implement combinational bypass logic only.
  • Do not include sequential register storage elements.
  • Route the data using a single multiplexer.

Topics

forwardingmultiplexerdatapathhazards

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