Professional Documents
Culture Documents
1. Consider two processors P1 and P2 operating at frequencies 1 GHz and 2 GHz, respectively.
P1 has an average cycle per instruction (CPI) of 2 while P2 has an average CPI of 3.4.
A high-level language program, when compiled for P1 and P2 produces 2x10 10 and 3x1010
instructions, respectively. Answer the following:
a. Which processor is faster and by how much
Given:
For P1:- CPI = 2
Clock rate = 1GHz
Instructions = 2x1010
CPU time P1 = (2 x 2 x 1010) / (1 x 109)
= 40s
b. What is the total execution time of the given program on the faster processor
Already mentioned in the previous question P1 has faster execution time = 40s.
c. If a new processor P3 is developed having a CPI of 1.5, what should be its frequency
such that it takes the same time to execute the given program as taken by the faster
processor. For P3, assume the number of instructions to be the same as that of the
faster processor.
We know that (Instructions x CPI) / (CPU time) is the clock rate.
therefore : (2 x 1010 x 1.5) / (40) = 0.75 x 109 = 0.75 GHz
2. Consider a processor operating at 2 GHz frequency. There are two compilers C1 and C2,
which generate machine code for this processor. The fraction of different types of instructions
generated by these compilers is shown in the table below. It is also known that C1 generates
1.2 times more instructions than C2.
Instruction type CPI Fraction of Fraction of
instr for C1 (%) instr for C2 (%)
Basic ALU 1 70 50
Load/Store 3 10 30
Others 4 20 20
Answer the following questions w.r.t. the given processor and the compilers.
a. Which compiler would generate a code with better performance.
Let number of instructions generated by: C2 = I; C1= 1.2I
Average CPI for C1 = (0.7 x 1.2I x 1 + 0.1 x 1.2I x 3 + 0.2 x 1.2I x 4) / (1.2I)= 1.8
Number of clock cycles for C1 :- Average CPI x Instructions = 1.8 x 1.2I = 2.16I cycles
b. What is the CPU execution time of the code generated by C1, if the total number of
instructions generated by C2 is 107
Given:
Instructions for C1 = 1.2 x 107
CPU time = (Instructions x Average CPI) / (Clock rate)
= (12 x 106 x 1.8) / (2 x 109)
= 10.8 ms
Therefore the CPU time should be 10.8
3. A wafer of diameter 18 cm is used for manufacturing 11mm x 12mm rectangular dies. The
wafer is processed using a manufacturing process having a defect rate of 0.04 defects/cm2. The
cost of processing each wafer is USD 200. Answer the following questions (assume that there is
no wafer area wastage due to corners):
We know that
Yield = 1 / (1 + (Defects per Area x Die Area / 2)) 2
No. of Dies = Wafer Area / Die Area
Cost = Cost per Wafer / (Dies per wafer x yield)
Given: diameter: 18 cm
rectangular dies: 11mm x 12mm
So die area= 11 x 12