Docsity

5 Problems Practice Exam - High Performance Computer Architecture | EEL 5708, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
EEL 5708 –Final examination
Date: Wednesday, December 7, 2005, 7:00-10:00
Name: …………………………………………………………………….
Instructions:
This exam is open book and open notes. Allotted time is 180 minutes.
Explicitly state all your assumptions.
Don’t just give answers, always try to write down the way you were thinking.
Even if you can not find a solution, write down the paths you have tried.
Manage your time wisely; try give equal time to all problems. Do not get bogged
down at one problem.
Note that the points add up to 120 (there are 20 bonus points which you can use to
improve on your midterm grades).
Problem 1 (25 points)
Consider the following C++ program fragment:
int a[1000];
int b = 1;
for (int i = 0; i != 1000; i++) {
b = b * a[i];
}
(a) Write a MIPS assembly program which corresponds to this program fragment.
(b) Unroll the loop in the program 4 times in software. Transform the program by
register renaming and instruction reordering such that the number of stalls is
minimized.
(c) Discuss the performance of the program. What is the bottleneck? Can you think of
other ways in which this code fragment can be optimized?
pf3
pf4
pf5

Partial preview of the text

Download 5 Problems Practice Exam - High Performance Computer Architecture | EEL 5708 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

EEL 5708 –Final examination

Date: Wednesday, December 7, 2005, 7:00-10: Name: ……………………………………………………………………. Instructions:  This exam is open book and open notes. Allotted time is 180 minutes.  Explicitly state all your assumptions.  Don’t just give answers, always try to write down the way you were thinking. Even if you can not find a solution, write down the paths you have tried.  Manage your time wisely; try give equal time to all problems. Do not get bogged down at one problem.  Note that the points add up to 120 (there are 20 bonus points which you can use to improve on your midterm grades). Problem 1 (25 points) Consider the following C++ program fragment: int a[1000]; int b = 1; for (int i = 0; i != 1000; i++) { b = b * a[i]; } (a) Write a MIPS assembly program which corresponds to this program fragment. (b) Unroll the loop in the program 4 times in software. Transform the program by register renaming and instruction reordering such that the number of stalls is minimized. (c) Discuss the performance of the program. What is the bottleneck? Can you think of other ways in which this code fragment can be optimized?

Suppose that a processor with a load/store architecture has a clock rate of 2.8GHz, with the ideal CPI of 1.2. The typical applications run on this processor contain a mix of 60% arithmetic and logic instructions, 20% load and store instructions and 20% conditional branches instructions. The processor accesses the memory through a separate data and instruction cache. An average 1% of the instructions produce an instruction miss, while 5% of the data accesses are cache misses. The penalty of a miss is 180 cycles. Cache hits do not produce any penalty. (a) What is the real CPI of the architecture? (b) What is the average memory access time (AMAT) of the architecture?

Consider a symmetric multiprocessing architecture machine which is using a snooping cache coherency protocol. The protocol we discussed in class is “write invalidate”, that is invalidate messages are sent to the bus whenever a cache block is overwritten. Let us now consider a write-broadcast based cache coherency protocol. (a) Draw the diagram of the cache states for this protocol. (b) Discuss the differences between the write-broadcast and the write-invalidate protocol. (c) Which one is easier to implement? (d) Which one is more efficient? Under what conditions? Discuss.

A non-uniform memory access (NUMA) multiprocessor machine has 4 processors, each with 100,000,000 bytes of memory, organized as follows: processor n has the memory locations from (n-1)100,000,000 to n(100,000,000)-1. For example processor 4 has the memory location [300,000,000…399,999,999]. The system implements a directory based cache coherency protocol as presented in the class. The caches are direct mapped, block size is 1000 and the number of blocks in each cache is 1000. Trace the evolution of the states of the caches, directory, memory locations and messages for the following sequence of events:

  1. Processor 1 reads location 200,050,
  2. Processor 2 reads location 200,050,
  3. Processor 3 reads location 200,050,
  4. Processor 1 reads location 200,050,
  5. Processor 3 writes location 200,050,
  6. Processor 3 writes location 300,050,