0% found this document useful (0 votes)
18 views7 pages

COA HW1 Answer Key Final

The document provides an answer key for Homework 1 of COSC 2425, covering various computational problems related to computer organization and architecture. It includes calculations for execution time, CPU cycles, CPI, and performance comparisons among different computers. The document concludes that achieving a desired performance improvement in floating-point instructions is not feasible due to resulting negative CPI values.

Uploaded by

ninja86420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

COA HW1 Answer Key Final

The document provides an answer key for Homework 1 of COSC 2425, covering various computational problems related to computer organization and architecture. It includes calculations for execution time, CPU cycles, CPI, and performance comparisons among different computers. The document concludes that achieving a desired performance improvement in floating-point instructions is not feasible due to resulting negative CPI values.

Uploaded by

ninja86420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

COSC 2425: Computer Organization and Architecture

Homework 1 (Chapter 1)
Answer Key
Q Work Ans

1 A 0.6s
Char cycle time= essay time/total characters

Essay time = 15mins = 15*60 = 900s


Total characters = 1500

Char cycle time = 900/1500 = 0.6

B 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒 = 𝐶𝑃𝑈 𝐶𝑙𝑜𝑐𝑘 𝐶𝑦𝑐𝑙𝑒𝑠 (𝑛𝑒𝑒𝑑 𝑓𝑜𝑟 𝑡ℎ𝑒 𝑝𝑟𝑜𝑔𝑟𝑎𝑚) 40 billion
𝑋 𝐶𝑦𝑐𝑙𝑒 𝑇𝑖𝑚𝑒. cycles
Therefore, CPU cycles = Execution time / Clock cycle time

Execution time = 10s


Clock cycle time = 250ps
10/(250 * 10^12) = 4 * 10^10 = 40 billion

2 A 4000s
Execution time = words count/frequency

Words count = 16000


Frequency = 4Hz
16000/4 = 4000
B
Frequency = Instruction Count/execution time 0.5 GHz
Or
Instruction Count = 6 billion 5 ∗ 108 𝐻𝑧
Execution time = 12s
(6 * 10^9) / 12 = (5 * 10 ^ 8)

3 A
Execution time = word count * CPW * clock time = 2500 s

Word count = 2500


CPW = 5
Clock time = 0.2s

B
Total cycle = Instruction count * CPI 2.5
CPI = Total cycle / Instruction count
Since, Total cycle = Clock rate * execution time

Therefore, CPI = Clock rate * execution time / Instruction count

Clock rate = 3 𝐺𝐻𝑧

Execution time = 25s


Instruction count= 30 ∗ 109

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

Percentage of Scientific words in the essay = 30%


CPW for them = 8

4.5 * 0.7 + 8 * 0.3 = 5.55

B CPI for A = 1 90s


Instruction count in A = 10 billion

CPI for B = 5
Instruction count in B = 3 billion

CPI for C = 10
Instruction count in C = 2 billion

Clock cycle time = 2ns

Total execution time = Total CPI considering IC for each * Clock cycle
time

(1 * 10 + 5 * 3 + 10 * 2) * 2 = 90s

A Total execution time = Execution Time for P1 (Program 1) + Execution Computer C is


Time for P2 + Execution Time for P3 the fastest
Performance = 1/Execution Time

For Computer A:

5 Total execution time = 10s + 55s + 60s = 125s


performance = 1/125 = 0.008

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

= 0.011/ 0.008 = 1.38

The relative performance of Comp. C with respect to B:


Relative performance = Performance of C/ Performance of B
= 0.011/ 0.00645 = 1.72

Note that an alternate approach would be to divide the execution times


instead of performance; For eg. To find the relative performance of
Comp. C with respect to A:
Relative performance = Execution time of A / Execution time of C
= 125 / 90 = 1.38
Similarly, To find the relative performance of Comp. C with respect to B:
Relative performance = Execution time of B / Execution time of C
= 155 / 90 = 1.72
A CPI = CPU Time / Instruction Count x Cycle time Computer A:
1.25
Computer B:
Average CPI for Compiler A:
1.5
Clock cycle time = 1ns
Instruction Count = 109
CPU Time = 1.25s
1.25/(1 * 10^9 * 10^-9) = 1.25

Average CPI for Compiler B:


Clock cycle time = 1ns
6
Instruction Count = 1.2 x 109
CPU Time = 1.8s
1.8/(1.2 * 10^9 * 10^-9) = 1.5

B For new Computer C: CPU time =


0.66s
CPU Time = Instruction Count x CPI x Clock cycle time
Instruction Count = 6 x 108
CPI = 1.1
Clock cycle time = 1ns
6*10^8 * 1.1 * 1 * 10^-9 = 0.66s

A For floating point: Execution


time = 0.256s
Instructions count= 50x106
CPI = 1

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)

New Execution time = (90/100) x 0.256 = 0.2304

CPI for FP (Using the same equation as part A of this question):

Solving this equation to get the value of New CPI:

50 x 106 x CPI(FP) + 462 x 106 = 0.4608 x 109

CPI(FP) = (460.8 – 462 )/50 = -0.024


We get a negative value for the CPI which is not possible.
Hence, its not possible to make this improvement in the execution time by
changing the Floating Point CPI

You might also like