0 votes 0 votes I THINK ANSWER SHOULD BE 462,THEY HAVE GIVEN ANSWER 554, WHICH I FEEL IS WRONG! CO and Architecture co-and-architecture pipelining made-easy-test-series numerical-answers + – Gate Fever asked Nov 6, 2018 retagged Aug 3, 2022 by Shubham Sharma 2 Gate Fever 635 views answer comment Share Follow See all 17 Comments See all 17 17 Comments reply Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share Answer is 454. Not 462. 0 votes 0 votes Magma commented Nov 6, 2018 reply Follow Share explain ! 0 votes 0 votes Hemanth_13 commented Nov 6, 2018 reply Follow Share Somoshree Datta 5 How? 0 votes 0 votes Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share Normally if all the stages would have taken 1 clock cycle as is the case with a normal pipelined execution, then number of clock cycles needed to execute 200 instructions would be= 1*5+199*1=204 now add instruction executes in 1 clock cycle, so it doesnt take up any extra time. Division requires 5 clock cycles for execution, so number of stalls in the pipeline caused due to these 25 instructions= 4 So extra clock cycles needed by these 25 instructions= 25*4=100 Similarly multiplication requires 3 clock cycles in execute stage. So number of stalls for each of these 75 instructions= 2 So extra clock cycles needed by these 75 instructions= 75*2=150 hence total number of clock cycles needed= 204+100+150= 454 1 votes 1 votes Magma commented Nov 6, 2018 reply Follow Share but here execution state takes 3 clock cycles means correct ?? 0 votes 0 votes Hemanth_13 commented Nov 6, 2018 reply Follow Share Yes but for the first instruction you will not face that many stall right @magma and Somoshree Datta 5 0 votes 0 votes Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share But u don't know what the first instruction will be right? So u can never say whether there will be any stalls or not.. 0 votes 0 votes Hemanth_13 commented Nov 6, 2018 reply Follow Share I mean can't we take all ADD first followed by all MUL and DIV, the first mul and first div instruction will have 0 stalls and 2 stalls respectively then answer would be 454-4=>450. Shouldn't we do in this way 0 votes 0 votes Magma commented Nov 6, 2018 reply Follow Share Division requires 5 clock cycles for execution, so number of stalls in the pipeline caused due to these 25 instructions= 4 I think that this approach doesn't hold good for this question 0 votes 0 votes Gate Fever commented Nov 6, 2018 reply Follow Share see my approach:- for addition : 100+5-1= 104 cycles for divison : for 1st instruction it will take 9 cycles and for rest of 24 instructions it will be 24*5 , therefore 9+24*5 = 129; for multiplication : for 1st instruction it will take 7 cycles and for rest 74 instruction it will take 3 cycles ;therefore 7+74*3=229 hence total cycles = 104+129+229= 462 0 votes 0 votes Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share @Hemanth_13 why will u assume such? It could be the case that the first instruction performs multiplication or division also. Here it isn't mentioned in the question that the instructions are executed sequentially in this order i.e. add, divide and then multiply 0 votes 0 votes Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share Gate Fever how can u consider the first instruction is performing both multiplication and division?? 0 votes 0 votes Hemanth_13 commented Nov 6, 2018 reply Follow Share Thanks Somoshree Datta 5 but I'm still worried is that the right way because we not giving the worst case pipeline value or the best case value. Gate Fever what's you reason for using 5 here and for rest of 24 instructions it will be 24*5 , therefore 9+24*5 = 129; 0 votes 0 votes Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share @Magma @Hemanth got the same question here..check out this link https://gateoverflow.in/227703/pipeline-execution-time 0 votes 0 votes Hemanth_13 commented Nov 6, 2018 reply Follow Share ThanksSomoshree Datta 5 :) it is values change of last year gate question https://gateoverflow.in/204125/gate2018-50 0 votes 0 votes Magma commented Nov 6, 2018 reply Follow Share Somoshree Datta 5 thank you and I understood your explanation clearly but the image that I was uploaded above Is it right way to analyzing it ?? still I have some doubt ...I've to work on it :/ 0 votes 0 votes Somoshree Datta 5 commented Nov 6, 2018 reply Follow Share @Magma yes your diagram is correct 0 votes 0 votes Please log in or register to add a comment.