Docsity

Test 1 with Answers | Advanced Microprocessor Systems Design | ECE 463, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
–1–
ECE 463: Advanced Microprocessor Design
ECE 521: Computer Design and Technology
Spring 2005
Test 1 with Answers
This was a 90-minute open-book test. You were to answer five of the six questions. Each
question was worth 20 points. If you answered all six questions, your five highest scores
counted.
Question 1.
(5 points each) Numbers you were to fill in are underlined below.
The Tinicomputer
Corporation manufac turers a machine with a cache that contains four block frames (lines). Main
memory consists of 16 blocks. The cache is managed according to the LRU algorithm.
Suppose a program starts out by re ferencing blocks 4, 1, 3, 9, and 2, in that order. After this
series of references is made, which blocks are in the cache, and what are the tags,* if the cache
organization is—
(a) Direct mapped? (c) 2-way set associative?
Block
frame Tag* Block number
0
1
2
3
Block
frame Tag* Block number
0
1
2
3
1
4
3
9
2
01
00 10
00
00
1
4
3
9
2
000
001
010
001
100
(b) Fully associa tive? (d) Sectored, with 2 sectors?
Block
frame Tag* Block number
0
1
2
3
Block
frame Tag* Block number
0
1
2
3 1 9
4
3
010 001
000 100
4
9
1
3
20010
0001
0011
1001
0100 2
*Please give the tag values in binary or octal.
pf3
pf4
pf5

Partial preview of the text

Download Test 1 with Answers | Advanced Microprocessor Systems Design | ECE 463 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

ECE 463: Advanced Microprocessor Design

ECE 521: Computer Design and Technology

Spring 2005

Test 1 with Answers

This was a 90-minute open-book test. You were to answer five of the six questions. Each question was worth 20 points. If you answered all six questions, your five highest scores counted.

Question 1. (5 points each) Numbers you were to fill in are underlined below. The Tinicomputer Corporation manufacturers a machine with a cache that contains four block frames (lines). Main memory consists of 16 blocks. The cache is managed according to the LRU algorithm. Suppose a program starts out by referencing blocks 4, 1, 3, 9, and 2, in that order. After this series of references is made, which blocks are in the cache, and what are the tags,*^ if the cache organization is—

(a) Direct mapped? (c) 2-way set associative?

Block frame Tag*^ Block^ number 0 1 2 3

Block frame Tag*^ Block^ number 0 1 2 3

(b) Fully associative? (d) Sectored, with 2 sectors?

Block frame Tag*^ Block^ number 0 1 2 3

Block frame Tag*^ Block^ number 0 1 2 3 1 9

*Please give the tag values in binary or octal.

Question 2. You are given the following reference string, in octal word addresses,

(^178 728 358 438 158 758 378 )

Assume the highest possible address is 77 8 , that LRU replacement is used, and that the cache is empty at the start. (5 points each) For each of the four cache organizations given below, determine—

(i) Where each block is placed in the cache. Show the block numbers that are placed in the cache, crossing a block number out when it is replaced. (ii) What value is in each tag field when the reference string is finished. (iii) What the hit ratio is. (a) A direct-mapped cache with 4 lines and a line size of 8 words. Block #s Tag 0: 1: 2: 3:

Answer:

Hit ratio: 1/

(c) A direct-mapped cache with 8 lines and a line size of 4 words. Block #s Tag 0: 1: 2: 3: 4: 5: 6: 7:

Answer:

Hit ratio: 1/

(b) A 2 - way set-associative cache with 4 lines and a line size of 8 words. Block #s Tag 0: 1: 1 7

Answer:

Hit ratio: 0

(d) A 2 - way set-associative cache with 8 lines and a line size of 4 words. Block #s Tag 0: 1: 2: 3:

Answer:

Hit ratio: 1/

Question 4. (5 points each) (a) Cache lines have been getting longer. Today's lines are often 128 or 256 bytes, whereas in the late ’90s, they were usually 32 or 64 bytes. What technology trend is causing the increase in line size? Answer: Main-memory access times are getting longer, in terms of clock cycles. So it is more important to bring in more information when there is a cache miss. To use the Sears Tower repairman analogy, if it took 4 times longer to get to the top of the building, it would make sense to bring along more tools to avoid extra trips. Compare also with page sizes, where the access penalty is thousands of cycles. Pages are much larger than cache lines. (b) Assuming that overall cache size does not change, does the trend toward larger line size require more associativity in order to translate addresses in parallel with cache access? Explain. Answer: If associativity stays the same while line size increases, the result is that there are fewer sets in the cache. This causes the index field to contract exactly as much as the block offset expands. For example, doubling the line size halves the number of line, and adds 1 bit to the block offset. If associativity remains the same, but the number of lines is halved, then the number of sets is also halved, so the index field contracts by one bit. Thus, the index field + block offset does not change in length, so if the index field did not overlap the page number before, it doesn't overlap it now. Thus, more associativity is not required to translate addresses in parallel with cache access. (c) Pages also are getting larger. Assuming that overall cache size does not change, does the trend toward larger pages demand higher associativity if addresses are to be translated in parallel with cache access? Explain. Answer: No, it does not. The page displacement expands, which means the block offset + index field can also expand without overlapping the page number. A larger index field  more sets less associativity is needed. (d) Given the increasing latency to main memory (measured in terms of processor cycles), does it make sense for L2 caches to become more or less associative? Explain. Answer: It makes sense for them to become more associative. This is because greater associativity allows a higher hit ratio, which means fewer expensive misses to main memory. As the cost of accessing main memory increases, it makes sense to devote more complex hardware to reducing the miss rate. Question 5. (5 points each) Assume you have a 450 MHz PC. You are writing a simulation program for one of your projects and it is “taking too long” to complete. Currently your simulation runs for 1000 seconds, of which 2/3 is memory access and 1/3 is CPU time. (a) How many instructions does the program consist of if the CPI (cycles per instruction) is equal to 5? Answer: CPU time = instruction count ∞ clock cycles per instruction ∞ clock-cycle time.

1000 ∞ 13 = IC instructions ∞ 5 cycles/instruction ∞ (^450 1) ∞ 106 sec./cycle

IC =^1000 ∞^

5 =^ 3 x 10^10 =^ 30 billion.

(b) How much of a speedup can be obtained by upgrading the processor to 1 GHz (1x cycles/sec)? Assume memory access time remains the same.

Answer: S = Execution time Execution timeoldnew

= (^30) ∞ 109 instructions ∞ 5 cycles/instr.1000 sec. ∞ 1 1 ∞ 109 sec./cycle + 1000^ ∞^

(^23) sec.

= (^) 816.667^1000 ≈ 1.224.

(c) Assume you can purchase faster memory for your computer (with the 450MHz processor). How many times faster must the memory be for an overall speedup of 2 to be achieved?

Answer: Soverall = 1 ( 1 – Fractionenhanced) + Speedup^ Fractionenhaenhancednced

2 = 1 ( 1 –^23 ) +

(^23) Senhanced

(^23) + 43 ∞ (^) S 1 enhanced =^1 (^43) ∞ (^) S 1 enhanced =^

Senhanced = 4 (d) An ideal (but unachievable) memory would allow all accesses to proceed at L1 cache speed, without any processor stalls. So the memory component of the execution time would vanish. In this case, still with the 450 MHz processor, what speedup could be achieved? (No greater speedup could possibly be attained by improving the memory system.) Answer: Since 1/3 of the original time is left after memory operations are done in 0 time, the speedup is (^11) 3

Question 6. Consider two competing computer workstations, X and Y. The choice between them is to be based on which does better on the following three benchmarks:

Performance expressed in instructions per unit time.

Computer X Computer Y

Warcraft 3 2 6 Matlab 4 6 Cubase VST 8 2