






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Department of Electrical Engineering and Computer Sciences Fall 2004 Instructors: Dave Patterson and John Lazzaro November 23rd, 2004
Personal Information
First and Last Name
Your Login cs152-____ ____
Lab/Discussion Section Time & Location you attend
“All the work is my own. I have no prior knowledge of the exam contents nor will I share the contents with others in CS152 who have not taken it yet .”
(Please sign)
Good luck!
Dave Patterson John Lazzaro Doug Densmore Ted Hong Brandon Ooi
Problem
Time (minutes)
Max. Points
Points Earned
In this problem, we compare two memory system designs for a classic 5-stage pipelined processor. Both memory systems have a 4 KB instruction cache.
For both data caches, cache lines hold a single word (4 bytes), and the miss penalty is 10 cycles.
a) What is the average memory access time for data retrieved by load instructions for the two memory system designs, measured in clock cycles? (6 points)
System A: AMAT = 1 + (0.110) = 2 cycles System B: AMAT = 2 + (0.0510) = 2.5 cycles.
Cache Short Answers b) Describe two clear advantages a Harvard architecture (separate instruction and data caches, as in your Lab 4 processor) has over a unified cache architecture (a single cache memory array accessed by a processor to retrieve both instructions and data) Describe one clear advantage a unified cache architecture has over the Harvard architecture. (9 points)
Harvard advantages: (1) No contention if both ports wish to read (2) Faster because each array is smaller.
Unified advantage: Cache provides better performance for a D-cache/I- cache mix other than 50/50. Coherency is also simpler and easier with a unified cache.
a) T F If false, give a counter example. All disks that are being configured with RAID-5 must be of equal size. Hard disks that have different storage capacity can not be used for installing a RAID-5 storage system. (3 points)
False. You can configure the system to use the smallest common size on all disks. (Important when replacing disks. New disks are likely to be bigger.
b) Match the RAID levels 1, 3, and 5 to the following phrases for the best match. Use each only once. (3 points) ______5___ Data and parity striped across multiple disks
______1___ Can withstand selective multiple disk failures
______3___ Requires only one disk for redundancy
c) RAID systems are either implemented in hardware with a separate RAID controller connected to the disks or in software as part of the operating system. After upgrading a server from a software RAID solution to a hardware RAID solution, the administrator notices a substantial increase in performance. Which of the following are true? (2 point each)
F Hardware solutions can support more RAID levels than software solutions, resulting in improved performance.
T Processing is now performed by the RAID controller, resulting in less system CPU usage.
number of disks? (3 points)
For small writes, RAID 4 has one parity disk which is a bottleneck since one parity and one data block must be updated. RAID 5 does not have all parity blocks on one disk so it has higher small write bandwidth
number of disks? (3 points)
small reads to not need to check parity, so small reads can be read from all disks in RAID 5. N-1 isks in RAID 4 as one raid 5 disk only has parity.
f) One simple way to get redundancy to improve reliability of data transmission is to simply triplicate each bit. Thus, each 0 becomes 000 and each 1 becomes 111.
a. How many errors can this scheme correct? (2 points)
1
b. How many errors can this scheme detect? (2 points)
1 (Hamming distance is 3, so cannot detect more than 1)
c. How can you improve the error correction / detection of this scheme while sending fewer bits? Explain in 1 or 2 sentences, giving a concrete example. (5 points)
Divide each transfer into a fixed size packet, and then add SEC/DED using a hamming code. For example, 64 bit data + 7 bit of ECC
Simply decide if the following statements are true or false. In the event that they are false please provide an explanation in the box provided. (2 points each)
You can have a hit in the TLB, a miss in the page table, and a hit in the cache for a single memory access. Explanation: False – cannot have a hit in TLB and miss in page table since all TLB entires have to have pages in memory
You can have a miss in the TLB, a hit in the page table, and a miss in the cache for a single memory access. Explanation: True.
Page faults cannot be handled by software because the overhead is too large. Explanation: False. Page faults take large cycle counts to resolve so software routines will easily finish (be amortized or hidden)
A “write through” policy is used for virtual memory systems. Explanation: False. Writing to lower levels always effectively undoes the speedup of TLBs etc. since Disk and memory are so slow.
Virtual memory space has to be bigger than the physical memory space. Explanation: False. VM is just a translation. If your virtual address is smaller than memory you can have it go to a larger physical address.
The operating system is a key component in a virtual memory system. Explanation: True
a) T F In an out-of-order architecture, a physical register may be written several times during its lifetime. If false, explain. (3 points)
False. Only 1 write allowed – this lets us execute instructions out-of-order w/o WAW, WAR hazards
b) T F In an out-of-order architecture that implements precise exceptions, exception handling occurs after the result of the instruction that causes the exception is committed to an architected register. If false, explain. (3 points)
We use the reorder buffer as a history buffer of program execution and copy it to an architected state once we know an exception or interrupt has not affected.
c) Below is the block diagram of the single-threaded Power 4. Three blocks were duplicated in order to support multi-threading in the Power 5. Circle all three. (6 points)
Legend
IF, D0 and CP
b) Rewrite the code in two different ways to more effectively take advantage of caching. Give a one sentence explanation for each. (10 points)
Based on the memory drawing given, we expected these two optimal solutions.
int total = 0; for(int x = 0; x < 128; x++) for(int y = 0; y < 128; y++) for(int z = 0; z < 128; z++) total += M[z][y][x];
int total = 0; for(int z = 0; x < 128; x++) for(int x = 0; y < 128; y++) for(int y = 0; z < 128; z++) total += M[y][x][z];
Super Pipelining c) Explain why branch mispredictions are especially costly in processors with long pipelines. Where does this cost come from? Give a concrete example. (5 points)
In a long pipeline, the operation to determine whether a branch is taken could happen fairly late in the pipeline. Mispredicted branches cause a flush of the pipeline after the branch. However, the cost of the misprediction comes from the large bubble in the pipeline which must be refilled to restore the efficiency of the CPU.
a) Given the Multicycle Processor (not pipelined) from chapter 5, we are now creating a dual-issue superscalar processor based off this. If the original multicycle processor has an optimal CPI of N, what is the optimal CPI of the superscalar processor? (3 points)
b) Consider the data hazards for both of the processors, for each of the following data hazards explain whether or not the hazard exists. If it does exit, give an explanation of how it is solved. ( points)
Multi-cycle Super-scalar Multi-cycle
None. Only one instruction is being executed at a time and completely finishes before the next one begins.
Yes. Two instruction which are issued together may depend on the first. e.g. Add $1, $0, $ Add $2, $1, $
Solved by issuing only independent instructions.
None. Yes. Instructions can save at differne times and second issued instruction write may occur after the first. Solved by FSM, force the write of one before the other.
None. No, the two issued instructions read from the register file at the same time before any has had a chance to write.
c) What changes are needed to the datapath and other components to support the dual issue multicycle processor? (5 points)
Dual port inst-memory to fetch 2 instructions.
Dual port register file to read 4 operands.
Control to handle hazards
Duplicate multicycle datapath.