COA HW1 Answer Key Final
COA HW1 Answer Key Final
Homework 1 (Chapter 1)
Answer Key
Q Work Ans
1 A 0.6s
Char cycle time= essay time/total characters
B 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒 = 𝐶𝑃𝑈 𝐶𝑙𝑜𝑐𝑘 𝐶𝑦𝑐𝑙𝑒𝑠 (𝑛𝑒𝑒𝑑 𝑓𝑜𝑟 𝑡ℎ𝑒 𝑝𝑟𝑜𝑔𝑟𝑎𝑚) 40 billion
𝑋 𝐶𝑦𝑐𝑙𝑒 𝑇𝑖𝑚𝑒. cycles
Therefore, CPU cycles = Execution time / Clock cycle time
2 A 4000s
Execution time = words count/frequency
3 A
Execution time = word count * CPW * clock time = 2500 s
B
Total cycle = Instruction count * CPI 2.5
CPI = Total cycle / Instruction count
Since, Total cycle = Clock rate * execution time
3 ∗ 109 ∗ 25
𝐶𝑃𝐼 = = 2.5
30 ∗ 109
A Percentage of common English words in the essay = 70% CPW = 5.55
CPW for them = 4.5
4
CPI for B = 5
Instruction count in B = 3 billion
CPI for C = 10
Instruction count in C = 2 billion
Total execution time = Total CPI considering IC for each * Clock cycle
time
(1 * 10 + 5 * 3 + 10 * 2) * 2 = 90s
For Computer A:
For Computer B:
Total execution time = 30s + 25s + 100s = 155s
performance = 1/155 = 0.00645
For Computer C:
Total execution time = 15s + 30s + 45s = 90s
performance = 1/90 = 0.011
The computer with the largest performance value (or the one with the
least execution time) has the best performance. Hence, Computer C has
the highest performance
B We need to find the relative performance of the best computer which is Computer C is
Computer C, compared to the other two i.e. Computer A and Computer B 1.38 times
faster than A.
Computer C is
The relative performance of Comp. C with respect to A:
1.72 times
Relative performance = Performance of C/ Performance of A faster than B
For Integer:
7
Instructions Count = 110x106
CPI = 1
For Load/Store:
Instructions Count= 80x106
CPI = 4
For Branch:
Instructions Count= 16x106
CPI = 2
Total Execution time = Sum of Instruction count x CPI for all 4 types of
instructions / Clock rate
B We need to find the new CPI value for Floating point instructions No possible
answer
To run 10% faster the execution time must be multiplied by 90% to get
the new execution time (Since faster performance means less execution
time)