99 views

I THINK ANSWER SHOULD BE 462,THEY HAVE GIVEN ANSWER 554, WHICH I FEEL IS WRONG!

| 99 views
0
0
explain !
0
+1
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
0

but here execution state takes 3 clock cycles  means

correct ??

0

Yes but for the first instruction you will not face that many stall right @magma and Somoshree Datta 5

0
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
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

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
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
@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

Gate Fever how can u consider the first instruction is performing both multiplication and division??

0

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

@Magma @Hemanth got the same question here..check out this link https://gateoverflow.in/227703/pipeline-execution-time

0

ThanksSomoshree Datta 5  :)

it is values change of last year gate question https://gateoverflow.in/204125/gate2018-50

0

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
@Magma yes your diagram is correct

3