-
Consider a 4 stage pipeline processor. The number of cycles needed by the four instructions I1, I2 , I3 , I4 in stages S1 , S2 , S3 , S4 is shown below.
What is the number of cycles needed to execute the following loop ?
For (i = 1 to 2) {I1; I2; I3; I4;}
-
- 16
- 23
- 28
- 30
- 16
Correct Option: B
Here bound of the loop are constants, therefore compiler will do the loop un rolling (if compiler won't then prefetcher will do) to increase the instruction level parallelism. And after loop unrolling 23 cycles are required for execution. Therefore option (b) is the correct answer.