Question

Suppose that a machine with a 5-stage pipeline uses branch prediction. 12% of the instructions for...

Suppose that a machine with a 5-stage pipeline uses branch prediction. 12% of the instructions for a given test program are branches, of which 84% are correctly predicted. The other 16% of the branches suffer a 4-cycle mis-prediction penalty. (In other words, when the branch predictor predicts incorrectly, there are four instructions in the pipeline that must be discarded.) Assuming there are no other stalls, develop a formula for the number of cycles it will take to complete n lines of this program

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If we ignored the branches completely, our program would take n + 4 cycles: One cycle per instruction, plus 4 more cycles to flush the pipeline at the end. 12% of the instructions are branches; however, 84% of those branches cause no delay. Thus, only 16% of 12% of n, or 1.92% of the instructions cause a 4-cycle delay. These delays cannot be overlapped,

therefore our formula is: n + 4 + 0.0192n ∗ 4 =0.0768n + 4.

Add a comment
Know the answer?
Add Answer to:
Suppose that a machine with a 5-stage pipeline uses branch prediction. 12% of the instructions for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1.We have a single stage, non-pipelined machine and a pipelined machine with 5 pipeline stages. The...

    1.We have a single stage, non-pipelined machine and a pipelined machine with 5 pipeline stages. The cycle time of the former is 5 ns and the latter is 1ns. Assuming no stalls, what is the speedup of the pipelined machine over the single stage machine? 2.We have prediction schemes: not taken, predict taken and dynamic prediction. Which of these prediction would be best if we have no penalty on right, 2 cycles on wrong, average 90% accuracy and 95% frequency

  • Suppose the branch frequencies are as follows: Conditional branches 15% Unconditional branches 1% Taken conditional branches...

    Suppose the branch frequencies are as follows: Conditional branches 15% Unconditional branches 1% Taken conditional branches 60% We are examining a 9-stage pipeline where the branch target address is calculated in the 3rd stage and the branch condition is evaluated in the 5th stage. Compare the performance of the machine when 90% of the conditional branches are predicted correctly with the performance of the machine when all the conditional branches are predicted to be untaken. Only branch stalls are considered

  • We implemented a new 5-stage pipeline with the following features: the delay by data and control...

    We implemented a new 5-stage pipeline with the following features: the delay by data and control hazards are as follows: 1 cycle stall for the load by immediate use, 2 cycle stalls for branch taken. Assume we now run 10,000 instructions on the pipeline, among them: (1) 35% are lw instructions. 10% of lw instructions are followed by instructions that use lw result immediately in ALU input; (2)15% are branch instructions with 40% possibility of branch taken; (3) the remaining...

  • 1. Suppose we have a 5-stage pipeline CPU and run the following instructions: or $tl, $t2, $t3 or...

    1. Suppose we have a 5-stage pipeline CPU and run the following instructions: or $tl, $t2, $t3 or $t2, $tl, $t4 or $tl, $tl, $t2 1.1. What dependencies are there in the code? 1.2. Suppose there is no forwarding. What hazard may happen? Draw the pipeline diagram and insert stall (nop) to prevent these hazard. 1.3. If the pipeline has full forwarding. Are there still hazard? If so, draw the pipeline diagram and insert stall (nop) to prevent the hazard....

  • 17. A computer with a 5 stage pipeline is measured an d has the following characteristies...

    17. A computer with a 5 stage pipeline is measured an d has the following characteristies Instruction Type Avg. stall cycles/instructions % of instructions Branches Loads & Stores ALU ops Other what is the average CPI for the computer? What is the speedup for this machine? .4 .2 2 .2 .3 .5 a) b)

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: The architecture fully supports forwarding, Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, Register R4 is initially 100. L1:  lw    R1, 0(R4)   add   R3, R1, R2 sw   ...

  • 12 po Iw add Question 11 The dassic five-stage pipeline MIPS architecture is used to execute...

    12 po Iw add Question 11 The dassic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: • The architecture fully supports forwarding • Register write is done in the first half of the clock cycles register read is performed in the second half of the clock cyde. Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism Register R4 is initially...

  • The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    The classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: • The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 100. L1: lw add...

  • A program that executes 12.3x107 instructions is run on a pipelined processor. The table below provides...

    A program that executes 12.3x107 instructions is run on a pipelined processor. The table below provides the percentage of executed instructions for each type of instruction. Instruction Executed P ipeline CPU type instructions (%) w/o hazards ALU 29.4 Load 29.7 Store 14.7 Branch 26.2 2 (w/o prediction) 27% of the load instructions are followed by instructions that need the data being loaded, 47% of the branches are actually.not taken, please assume not taken prediction. a) Please determine the overall cycles...

  • he classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem....

    he classic five-stage pipeline MIPS architecture is used to execute the code fragments in this problem. Assume the followings: The architecture fully supports forwarding, • Register write is done in the first half of the clock cycle; register read is performed in the second half of the clock cycle, • Branches are resolved in the third stage of the pipeline and the architecture does not utilize any branch prediction mechanism, • Register R4 is initially 100. Ll: lw add SW...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT