Question

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 50% are sw and R-type instructions that don’t cause any stalls.

How many cycles we need to execute the 10,000 instructions on the pipeline? You may ignore the pipeline overhead such as start-up cost.

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

1 cycle stall for the load by immediate use,
2 cycle stalls for branch taken.

stalls due to load by immediate use
=> 10000*(0.35 * 0.1* 1) = 350 cycles

stalls due to branch taken
=> 10000*(0.15*0.4*2) = 1200 cycles

cycle taken to execute 10000 instruction in 5-stage pipeline without any stalls.
First instruction needs 5 cycles for execution
Next 9999 instruction needs only 1 clocks
Total cycles = 5 + 9999 = 10004 cycles

Total cycles we need to execute the 10,000 instructions on the pipeline = 10004 + 1200 + 350 = 11554 cycles

Add a comment
Know the answer?
Add Answer to:
We implemented a new 5-stage pipeline with the following features: the delay by data and control...
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. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between th...

    1. Given the following instruction sequence for the MIPS processor with the standard 5 stage pipeline $10, S0. 4 addi lw S2.0(S10) add sw S2,4(510) $2, $2, $2 Show the data dependences between the instructions above by drawing arrows between dependent instructions (only show true/data dependencies). a. Assuming forwarding support, in what cycle would the store instruction write back to memory? Show the cycle by cycle execution of the instructions as they execute in the pipeline. Also, show any stalls...

  • We execute the following instruction sequence (data hazards may exhibit in the sequence) on a MIPS...

    We execute the following instruction sequence (data hazards may exhibit in the sequence) on a MIPS 5-stage pipeline with forwarding and stall features implemented. Draw a graphical representation for the execution of the instruction sequence that clearly shows (1) forwarding path (if any); (2) stall cycles (if any); and (3) total cycles needed for the execution. lw R8, 0x0020(R10) add R9, R8, R10 sw R8, 0x0040(R10)

  • Using graphical representation, show the pipeline execution of the following instructions on the 5-stage pipeline with...

    Using graphical representation, show the pipeline execution of the following instructions on the 5-stage pipeline with hazard detection and forwarding as implemented in Lecture 6. Clearly indicate the forwarding path(s) and stall(s). Note: highlight the forwarding path and use bubbles (or O) for stalls. Lw R20, 0x0100(R18) Add R14, R20, R16 Sw R18, 0x0110(R16) Or R12, R14, R20 Lw R18, 0x0100(R12) instr CC1 CC2 CC3 lw

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

  • In this exercise, we examine how data dependences affect execution in the basic 5-stage pipeline described...

    In this exercise, we examine how data dependences affect execution in the basic 5-stage pipeline described in Section 4.5. Problems in this exercise refer to th following sequence of instructions: addi $2,$2,22 SW $3,20($2) OR $4,$2,$3 Also, assume the following cycle times for each of the options related to forwarding: Without Forwarding With Full Forwarding 300ps With ALU-ALU Forwarding Only 250ps 290ps 4.9.1 [10] <4.5> Indicate dependences and their type. 4.9.2 [10] <S4.5> Assume there is no forwarding in this...

  • Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF- ID-EX-M-WB....

    Consider a standard 5-stage MIPS pipeline of the type discussed during the class sessions: IF- ID-EX-M-WB. Assume that forwarding is not implemented and only the hazard detection and stall logic is implemented so that all data dependencies are handled by having the pipeline stall until the register fetch will result in the correct data being fetched. Furthermore, assume that the memory is written/updated in the first half of the clock cycle (i.e. on the rising edge of the clock) and...

  • Consider the following loop. loop: Iw r, 0(r1) 9. and rl, r1, r2 lw ri, o(ri)...

    Consider the following loop. loop: Iw r, 0(r1) 9. and rl, r1, r2 lw ri, o(ri) lw r1, O(r1) beq rl, rO, loop that perfect branch prediction is used (no stalls due to control hazards), that there are no delay Assume slots, and that the pipeline has full forwarding support. executed before the loop exits. A - Show a pipeline execution diagram for the third iteration of this loop, from the cycle in which we fetch the first instruction of...

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

  • 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)

  • A 5-Stage pipeline is composed of the following stages Instruction Fetch (IF), Decode (DE), Execute (EX), Memory Access...

    A 5-Stage pipeline is composed of the following stages Instruction Fetch (IF), Decode (DE), Execute (EX), Memory Access (ME) and Register Write-back (WB). Assume the pipeline does not have a branch prediction unit, does not have superscalar support and does not support out of order execution. Assume that all memory accesses are in the L1 cache and therefore do not introduce any stalls. Show a pipeline diagram that shows the execution of each stage for the assembly code below. Also...

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
ADVERTISEMENT