Answer is as follows :
Pipeline Diagram for given scenario is as follows :
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
---|---|---|---|---|---|---|---|---|---|---|
Instruction 1 | IF | ID | EX | MEM | WB | |||||
Instruction 2 | IF | ID | EX | MEM | WB | |||||
Instruction 3 | IF | ID | EX | MEM | WB | |||||
Instruction 4 | IF | ID | EX | MEM | WB | |||||
Instruction 5 | IF | ID | EX | MEM | WB |
So we need 9 clock cycles for given scenario to execute.
For part b, the stages that are not useful are only with branch instruction, as we know that branch instruction is executed in part EX, so we don't need to go further.
So MEM and WB stages are not useful in instruction 5. Showed by bold in pipeline diagram.
if there is any query please ask in comments...
CS-320 Computer Organization and Architecture Homework #7 Due: 04/15/2019 1. (25 points total) Consider the following...
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...