You are on page 1of 2

Activity #3 Solutions

A. (50 points) Consider a simple CPU with just the instructions listed below

Instruction Operation # Cycles # Bytes


LDAA Load Accumulator from Memory 4 3
STAA Store Accumulator to Memory 4 3
ADDA Add Memory to Accumulator 5 3
BEQ Branch on Equal to 0 10 4
CMPA Compare accumulator to Memory 5 3
NEGA Negate Accumulator 2 1
BRA Branch always 6 3
MUL Multiply Accumulator 3 3
SUBA Subtract Memory from Accumulator 5 3
ANDA AND Accumulator with Memory 5 3
HALT Halt 1 2
NOP No Operation 1 2

a. (5 points) What is the average number of cycles per instruction (CPI) for this CPU,
assuming that all instructions are executed equally often? CPI = __________
51cycles
= 4.25cycles / instructio n
Answer: 12instructio ns
Grading: 5pts for correct answer, 2pts for partial, 0 for not trying.

b. (5 points) If the CPU cycle time is 35ns, what is the average number of instructions executed per
second, assuming that all instructions are executed equally often?
MIPS = __________
Answer:
Execution of a single instruction is 4.25*35 = 148.75ns/instruction = 148.75*10-9sec/instruction.
Reciprocal of this is 0.0067*109 instructions/sec = 6.7 million instructions per second = 6.7
MIPS.
Grading: 5pts for correct answer, 2pts for partial, 0 for not trying.

c. (5 points) Given that cycle time is 35ns and no parallelism is possible in the architecture, what would
the highest "peak MIPS" that a computer salesman could (misleadingly) claim?
Peak MIPS = _________
Answer: Since no parallelism is possible, salesman can at most claim 1 instruction is executed
per cycle. That means an instruction takes 35*10-9sec/instruction, which means 0.0286*109
instructions could be executed per second. So, the peak is 28.6 MIPS.
Grading: 5pts for correct answer, 2pts for partial, 0 for not trying.

d. (5 points) How long would it take to execute a program P with 4 million instructions executed
equally often, and no I/O? State your answer in seconds.
TP= ____________seconds;
Answer: From part (b), we know that an instruction takes 148.75ns for execution, which is
0.14875*10-6 seconds. So, the total execution time for the program P will be
4,000,000*0.14875*10-6 seconds = 0.595 seconds.
Grading: 5pts for correct answer, 2pts for partial, 0 for not trying.

ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2014 Page 1 of 2
e. (10 points) What is the average number of bytes per instruction, if all instructions are executed
equally often?
Average BPI = ________________
33bytes
= 2.75bytes / instructio n
Answer: 12instructio ns
Grading: 10pts for correct answer, 5pts for partial, 2pts for trying.

f. (10 points) Based on the clock rate specified in part (b), and part (e) above, calculate the average
data rate that the memory system must support in order to keep the CPU running as fast as possible.
Average Data Rate (bytes/sec) = _______________
b ytes in stru ction s
2.7 5 * 6.7 *1 06 = 1 8,4 2 5,0 0 0b ytes / sec = 1 8.4 3m illio n b ytes / sec
Answer: in stru ction sec
Grading: 10pts for correct answer, 5pts for partial, 2pts for trying.

g. (10 points) If the memory system can handle (i.e., read/write) data at a speed of 1 byte every 80ns,
what is the maximum number of instructions per second that can be executed (assuming that all
instructions are executed equally often)?
Maximum IPS = _________________
Answer: The memory can support only up to 0.0125 bytes/ns = 12.5 million bytes/sec. However,
the CPU needs 18.43millionbytes / second with a rating of 6.7MIPS, which means the memory is
the bottleneck. So the maximum number of instructions that can be executed = 12.5 millionbytes
/sec * 1/ 2.75 instructions/byte = 4.55 million instructions per seconds = 4.55 MIPS.
Grading: 10pts for correct answer, 5pts for partial, 2pts for trying.

B. (10 points) Moore’s Law and Compound Interest.

Moore’s Law (the textbook does not attribute it to Moore in Ch. 1) is sometimes cited as
a) A 50% gain in computer performance per year (G12 = 1.5);
and sometimes as
b) A twofold gain every 18 months (G18 = 2.0).

Calculate the twenty-year (240 month) gain G240 resulting from both of these formulations. It is
sufficiently accurate to find the compound interest per month with the formula Gn = (1 + i)n, where i is
the monthly interest, and n is the number of months.
Hint: First use n=12 for (a) and n=18 for (b) to calculate (1+i). Then, n=240 to compute G240.

Answer: First, we need to find interest rate i:


S=1*(1+i)n  1+i=S1/n
For n=12, 1+i=(1.5)1/12  G240 =((1.5)1/12)240=(1.5)20=3325.26
For n=18, 1+i=(2.0)1/18  G240=((2.0)1/18)240=(2.0)40/3=10321.27
G240 based on (a) = _____3325____________

G240 based on (b) = _____10321___________


Grading: 2pts for trying, plus 3pts for each correct interest rate, plus 2pt for each correct
twenty-year gain.

ECSE-2660 Computer Architecture, Networks, & Operating Systems, Spring 2014 Page 2 of 2

You might also like