IDEA SOLUTION

Sponsored Links

Suppose that a certain program takes 200 seconds of elapsed time to execute. Out of
these 200 seconds, 180 seconds is the CPU time and the rest is I/O time. If the CPU
performance improves by 40% every year for the next seven years because of
developments in technology, but the I/O performance stays the same, let us look at the
following table, which shows the situation at the end of each year. Remember that
Elapsed time = CPU time + I/O time.
This gives us the I/O time = 200 – 180 = 20 seconds at the beginning, which is 10 % of
the elapsed time.
Advanced Computer Architecture-CS501
__________________________________________________ ______
Last Modified: 17-Feb-07 Page 234
Year # CPU
Time
I/O
Time
Elapsed
Time
I/O Time x100 %
Elapsed Time
Year
0 180 20 200 10 %
1 129 20 149 13.42 %
2 92 20 112 17.85 %
3 66 20 86 23.25 %
4 47 20 67 29.85 %
5 34 20 54 37.03 %
6 24 20 44 45.45 %
7 17 20 37 54.05 %
It can be easily seen that over seven years, the I/O time will become more than 50 % of
the total time under these conditions. Therefore, the improvement of I/O performance is
as important as the improvement of CPU performance. I/O performance will also be
discussed in detail in a later section.


Example # 325
What percentage of time will a 20MIPS processor spend in the busy wait loop of an 80-
character line printer when it takes 1 msec to print a character and a total of 565
instructions need to be executed to print an 80 character line. Assume that two
instructions are executed in the polling loop.
Solution:
Out of the total 565 instructions executed to print a line, 80x2=160 are required for
polling. For a 20MIPS processor, the execution of the remaining 405 instructions takes
405/ (20x106) = 20.25μsec. Since the printing of 80 characters takes 80ms, (80-0.02025)
=79.97msec is spent in the polling loop before the next 80 characters can be printed. This
is 79.97/80=99.96% of the total time.