2,652 views

2 Answers

2 votes
2 votes

IF :instruction fetch 

ID :instruction decode

EX : execution

MA: memory access

WB: write back

 I1:Load R0,3(R1)

I2:Sub R3,R0,R4

I3: Mul R5,R0,R6

I4: Div R7,R0,R8 

  1 2 3 4 5 6 7 8 9 10 (cycle)
I1 IF ID EX MA WB          
I2   IF ID -----------   EX MA WB    
I3     IF     ID EX MA Wb  
I4           IF ID EX MA WB

so 10 cycles required..

0 votes
0 votes
  1 2 3 4 5 6 7 8 9 10
I1 IF ID EX MA WB          
I2   IF ID ------ EX MA WB      
I3     IF ID ---- EX MA WB    
I4       IF ID ---- EX MA WB  

 

 

THEREFORE total 9 cycles needed.
Since this is RISC pipeline by default it will use operand forwarding and we will witness operand forwarding between I1’s  MA and I2’s EX where dependent operand will be directly forwarded and thus other answer is completely wrong