=========================preview======================
(COMP180)quiz01S_1.pdf
Back to COMP180 Login to download
======================================================
COMP180: Computer Organization
Spring 2001, Lecture Section 1, Dit-Yan Yeung
Quiz #1
16 February 2001
Name: __________________________ Student ID: _______________ E-mail: _________________
Answer all questions in the space provided. Time allowed: 20 minutes
1.
For each of the following statements, write down true if it is true and false otherwise.
2.
A program runs on a machine with a clock rate of 100 MHz. The following characteristics about the machine and the program are observed:
(a) COMP180 is easy. Ans: _____
(b) Arithmetic operations in MIPS can directly operate on values stored in memory. Ans: _____
(c) Increasing throughput always reduces the execution time. Ans: _____
(d) The performance measure MIPS (million instructions per second) can be expressed as the clock rate in MHz divided by CPI. Ans: _____
(e) Different compilers that run on the same computer always generate assembly or machine code with the same CPI. Ans: _____
(f) All MIPS instructions are 32 bits in length. Ans: _____
(g) If you write a program that sorts an array of numbers, the program is expected to require significantly more system CPU time than user CPU time. Ans: _____
(h) In the MIPS instruction add $t0, $s2, $t1, registers $s2and $t1store the addresses of the memory locations where the source operands are found. Ans: _____
(i) A compiler that generates machine code with the smallest instruction count is always the best choice. Ans: _____
(j) In the MIPS architecture, each byte in the main memory can be indexed by a unique 32-bit address. Ans: _____
(k) In all computers, one word corresponds to four bytes. Ans: _____
(l) Registers are some special locations in the main memory allowing faster access. Ans: _____
(m) An instruction class usually consists of instructions that have the same CPI. Ans: _____
(n) The use of simple arithmetic mean to combine the execution times for multiple benchmark programs implicitly assumes that the programs have the same usage frequency. Ans: _____
(o) Increase in clock rate may not improve the system performance in terms of CPU time if the CPI is also increased too much. Ans: _____
1
Instruction class CPI Usage frequency
A 2 40%
B 3 30%
C 4 20%
D 5 10%
For each of the following two parts, show the computational steps and the answer.
(a)
What is the overall CPI?
(b)
What is the MIPS (million instructions per second) rating?
3. The following table shows the instruction counts and execution times for two different programs to run on three different machines with the same instruction set architecture:
Program Instruction count Execution time in seconds
Computer A Computer B Computer C
1 1,000,000 1 10 20
2 5,000,000 1000 100 20
Suppose the usage frequencies of programs 1 and 2 are 99% and 1%, respectively. Using the usage frequencies as weights to compute the weighted