retagged by
1,641 views
1 votes
1 votes

The following sequence of instruction is executed in a basic 5 stage pipelined processor (S1, S2, S3, S4, S5). Assume that data dependency present in the program is resolved by operand forwarding techniques. Load instruction output present in 4th stage ALU instruction output is available in 3rd stage. Assume each stage take 1 cycle.

$I_{1}:ADD R_{0},R_{1},R_{2}$

$I_{2}:LOAD R_{4}, 1(R_{0})$

$I_{3}: ADD R_{5},R_{4},R_{0}$

$I_{4}: ADD R_{6},R_{5},R_{4}$

$I_{5}: ADD R_{7},R_{5},R_{4}$

What is the number of instructions must be inserted to achieve CPI = 1 by using operand forwarding.

retagged by

1 Answer

0 votes
0 votes

I1 : R0 <-- R1 + R2

I2 : R4 <-- M(R0)

I3 : R5 <-- R4 + R0

I4 : R6 <-- R5 + R4

I5 : R7 <-- R5 + R4

I/C 1 2 3 4 5 6 7 8 9 10
I1 S1 S2 S3(R0) S4 S5          
I2   S1 S2 S3 S4(R4) S5        
I3     S1 X S2 S3(R5) S4 S5    
I4       S1 X S2 S3(R6) S4 S5  
I5         S1 X S2 S3 S4 S5

In this Instruction Pipeline Result of I1 are store in 3rd stage S3 but result of I2 are store in 4th stage S4 in clock cycle 5 and this instruction are immeditely use in next instruction I3 so, One Stall are genreted.

Hence must be Inserted only one independent instruction between instruction I2 and I3.

Related questions

1 votes
1 votes
1 answer
1
learner_geek asked Oct 15, 2017
466 views
Give answer for question no. 12please! provide detailed answer.
17 votes
17 votes
1 answer
3
dd asked Jan 8, 2017
20,852 views
A $5$ stage pipelined processor has the following stages:$IF$ : instruction fetch$ID$ : instruction decode$EX$ : execute$MA$ : memory access$WB$ : write back$$\large\colo...
0 votes
0 votes
1 answer
4
Deepak9000 asked Nov 5, 2023
256 views
I have a Self doubt question on Operand Forwarding . The data forwarded should be done in EX-EX stage or Mem-EX ? Which one to follow and when ?Using EX-EX we require les...