2 votes 2 votes A 4-stage pipelined processor executed the following loop: for(i=1;i<=100;i++) { I1; I2; I3; I4; } What is the no. of clocks to execute the above loop? a.13 b.15 c.16 d.18 S1 S2 S3 S4 I1 1 2 1 2 I2 2 1 2 1 I3 1 1 2 1 I4 2 1 2 1 sampad asked Oct 7, 2015 sampad 840 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 1 votes 1 votes if we use without loop level parallelism than it will take 1100 clock cyles becoz loop is from i=1 to 100 as also for first i=1. it will take 11 cycles similalry for next 100 it will take 1100 cycles... and with loop level parallelism it will take 11*1+99*7=704 cycle . focus _GATE answered Oct 8, 2015 focus _GATE comment Share Follow See all 3 Comments See all 3 3 Comments reply sampad commented Oct 8, 2015 reply Follow Share How is it possible that the1st instruction is taking 11 cycles and the remaining 99 instrs. taking only 7 cycles?( 11*1+99*7=704 ??) Suppose if there were two iterations then how many cycles would have taken for the 2nd iteration? 0 votes 0 votes focus _GATE commented Oct 8, 2015 reply Follow Share see in fiqure ,i have inserted the I1 instruction in the 7 th clcok cycle.and this I1 instruction time is being shared with the clock time of i4 instruction.. similarly u can see further this time is being shared till 11 clock cycle .. for the second iteration it will take only 7 clock cycle. becoz 7,8,9,10,11 clcock cycle is being shared in the case of loop level parallelism..see in diagram..and rest 7 clock for remainng.!! 0 votes 0 votes Gate Mm commented Dec 14, 2015 reply Follow Share @Kunal :can u plz xplain wat happens in loop level parallelism. In order to comprehend this solution I need to have an idea about the concept. 0 votes 0 votes Please log in or register to add a comment.