92.8k views
5 votes
consider a version of the mips 5-stage pipeline processor that does not handle data hazards (i.e., the programmer is responsible for addressing data hazards by inserting nop instructions where necessary). suppose that (after optimization) a typical n-instruction program requires an additional 0.4*n nop instructions to correctly handle data hazards. suppose that the cycle time of this pipeline without forwarding is 400 ps. suppose that adding forwarding hardware decrease the number of nops but will increase the cycle time to 450 ps. suppose that the pipeline with forwarding requires an additional 0.04*n nop instructions rather than the additional 0.4*n nop instructions without forwarding. what is the speed up with forwarding over without forwarding (within three digits, e.g., 1.27)? (be sure you compute the speed up ratio correctly)

1 Answer

3 votes

Final answer:

The speedup with forwarding hardware in a MIPS 5-stage pipeline processor over without forwarding is approximately 1.197, after calculating the execution times for programs with and without the forwarding hardware and accounting for the increased cycle time and reduced number of necessary NOP instructions with forwarding.

Step-by-step explanation:

When evaluating the impact of forwarding hardware in a MIPS 5-stage pipeline processor on execution time, we need to calculate the total time it takes to execute a given program with and without forwarding.

Without forwarding, the total time (Tno_forward) can be calculated as follows:

  • Time for original instructions = n * 400 ps
  • Time for NOPs due to data hazards = (0.4 * n) * 400 ps
  • Tno_forward = (n + 0.4 * n) * 400 ps
  • Tno_forward = 1.4 * n * 400 ps

With forwarding, the total time (Tforward) is:

  • Time for original instructions = n * 450 ps
  • Time for NOPs due to reduced data hazards = (0.04 * n) * 450 ps
  • Tforward = (n + 0.04 * n) * 450 ps
  • Tforward = 1.04 * n * 450 ps

We then calculate the speedup by dividing Tno_forward by Tforward:

Speedup = Tno_forward / Tforward

Speedup = (1.4 * n * 400 ps) / (1.04 * n * 450 ps)

Speedup = (1.4 * 400) / (1.04 * 450)

Speedup = 560 / 468

Speedup ≈ 1.196581

Therefore, the speedup with forwarding over without forwarding is approximately 1.197 (when rounded to three digits).

User Wei Shen
by
7.8k points