



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The final exam for a computer architecture course, ecs 154b, held in fall 2003. The exam covers topics such as pipeline hazards, data forwarding, and page replacement strategies. Students are required to show all their work and answer questions related to these topics.
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




A. (12 points) Refer to Fig. 1. Assume in-order execution (no dynamic instruction scheduling). Which are the EARLIEST pipeline registers (1, 2, ..., 20) in the figure to be compared in order to detect each of the following hazards? In ALU operations like “add” and “sub”, assume:
There could be more than one hazard per code block below: hazard 1: sub $2, $1, $ sub $1, $3, $ add $4, $3, $ add $5, $2, $
Earliest Comparision: Check (4 == 15) or (10 == 20) hazard 2: lw $5, 10($3) add $3, $5, $ sub $2, $2, $
Earliest Comparision: Check (3 == 11) or (9 == 15) or (13 == 20) hazard 3: sub $2, $2, $ add $4, $3, $ lw $1, 20($3)
Earliest Comparision: Check (4 == 11) or (10 == 15) or (14 == 20)
Consider two possible page-replacement strategies: LRU(the least recently used page is replaced) and FIFO (the page that has been in the memory longest is replaced). The merit of a page-replacement strategy is judged by its hit ratio. Assume that, after space has been reserved for the page table, the interrupt service routines, and the operating system kernel, there is only sufficient room left in the main memory for four user-program pages. Assume also that initially virtual pages 1, 2, 3, and 4 of the user program are brought into physical memory in that order.
FIFO: start: 1 2 3 4 access 6: replace 1 => 2 3 4 6 access 3: no change => 2 3 4 6 access 2: no change => 2 3 4 6 access 8: replace 2 => 3 4 6 8 access 4: no change => 3 4 6 8
Program A consists of 1000 consecutive ADD instructions, while program B consists of a loop that executes a single ADD instruction 1000 times. You run both programs on a certain machine and find that program B consistently executes faster. Give two plausible explanations. #1: One would expect the loop to achieve a higher hit rate in the cache because it involves many fewer instruction words. #2: the loop, occupying many fewer instruction words, should all fit onto a single page. The 1000 instructions might span several pages and hence their execution may involve some page faults.
In this problem, we will compare the following three networks for a 64 processor multiprocessor. i) a 8X8 2-dimensional torus. ii) a 6-cube. ii) a radix-2, 6-stage butterfly.
Assume that a link has bandwidth 100 Mbps in one direction. Do not count the links connecting the processor to the switch in the calculations below: SHOW ALL YOUR WORK! Calculate and write down each metric for each network. Draw the pictures.
2 22 )(5) =^ $^720 (ii) 64 7X7 switches) * ( 7
2 22 )(5) =^ $^3920 (i) (192 2X2 switches)(5) = $960.