COA ASSIGNMENT 1 - Answers
COA ASSIGNMENT 1 - Answers
1. If computer A runs a program in 10 seconds and computer B runs the same program in 25
seconds, how much faster is A than B?
Solution:
3. A machine has a CPI of 3, and a single program requires 20 instructions to execute. What will
be the execution time if the clock frequency of the machine is 1 GHz?
Solution:
4. Computer A runs a program in 12 seconds with a 3 GHz clock. We have to design a computer
B such that it can run the same program with in 9 seconds. Determine the clock rate for
computer B. Assume that due to increase in clock rate, CPU design of computer B is affected
and it requires 1.2 times as many clock cycles as computer A for execution this program.
5. Let us assume that two computers use same instruction set architecture. Computer A has a
clock cycle time of 250 ps and a CPI of 2.0 for some program and computer B has a clock
cycle time of 500 ps and a CPI of 1.2 for the same program. Which computer is faster for this
program and by how much?
6. The table (a) shows the two code sequences with number of instructions of different
instruction classes within each code sequence respectively. The instruction are classified as A,
B and C according to the CPI as shown in table (b). From the given information,
(i)Determine which code sequence executes the most instructions.
(ii)Determine which code sequence will execute quickly.
(iii)Determine the CPI for each code sequence.
7. Consider three different processors P1, P2 and P3 executing the same instruction set. P1 has a
3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0 and P4 has a
4 GHz clock rate and a CPI of 2.2.
(a)Which processor has the highest performance expressed in instructions per second?
(b)If the processors each execute a program in 10 seconds, find the number of cycles ad the
number of instructions in each processor.
Solution:
10. Consider a machine with a clock frequency of 2.5 GHz executing 3000 instructions with an
average CPI of 3. Suppose we use a new compiler on the same program for which the new
instruction count is 6000, and a new CPI is 1.5, running on a faster machine with a clock rate
of 3 GHz. What will be the speedup achieved?
Solution: