00:01
We need to calculate average cpi every cpi that is cycle per instruction for program a on computer.
00:12
C1 and computer c2 as well as the execution time.
00:17
We need to calculate.
00:18
So first let's calculate the average cpi.
00:21
So first for average cpi for program a or computer c1.
00:29
So the formula is and we will put the values average cpi is equals to percentage of type 1 instruction, which is 40 % multiply by cycle of type 1 2 plus percentage of type 2 instruction, which is 60 % multiply by type of type cycle of type 2 3 divided by 100.
00:51
So when we sort this out, we got 0 .8 plus 1 .8 divided by 100, which is 2 .6 divided by 100.
01:02
So here it is 0 .026.
01:06
Now, we need to calculate the average cpi for program a on computer c2.
01:15
The formula is same.
01:17
So for the first percentage type instruction 40 % multiply by cycle 2 plus percentage of type 2 instruction 60 % and cycle of type 2 is also true divided by 100.
01:30
Here we got 0 .8 plus 1 .2 divided by 100 2 .0 divided by 100.
01:40
So it will be 0 .02.
01:43
Now, let's calculate the execution time for program a or both both the computers.
01:49
So here now we need to calculate the execution time for program a on computer c1.
01:58
So execution time for c1 will be.
02:02
Dynamic instructions multiply by average cpi divided by frequency.
02:06
So dynamic instruction will be 8 multiply by 10 to the power 9 average cpi for c1 is 0 .026 divided by frequency.
02:17
So that will will be 4 .0 gets when we sort this out.
02:22
We got 208 triple 0 triple 0 divided by 4 triple 0 triple 0 triple 0 by calculating this we got 0 .052 seconds.
02:40
Now execution time for program a on compute for program b.
02:48
Basically for program b on computers c1...