Docsity

Exam 3 with Solution - Computer Architecture | CSCE 212, Exams of Computer Science

Toggle sidebar
bg1
1. Assume a cache with the following characteristics:
Word size: 4 bytes
Block size: 16 words
Associativity: 4-way
Replacement policy: least-recently-used (LRU)
Total cache data capacity: 8192 bytes
a. Assume the CPU uses a 32-bit address. Show how the address is split into tag,
index, word address, and byte address.
byte address -- bits 1 down to 0
word address -- lg 16 => 4 bits, so bits 5 down to 2
8192 bytes / (4 bytes/word * 16 words/block * 4 sets) = 32 blocks/set
therefore, lg 32 = 5 index bits, so bits 10 down to 6
tag is the rest of the bits, so bits 31 down to 11
21-bit tag 5-bit index 4-bit word address 2-bit byte address
31:11 10:6 5:2 1:0
b. Show the final contents of the cache after the following series of accesses. The
addresses shown correspond to the index fields of each access. Assume the
cache is initially empty.
Note that when I said “index fields” I meant bits 31 down to 6.
2, 3, 11, 16, 21, 13, 64, 48, 19, 11, 3, 22, 4, 27, 6, 11
block set 0 set 1 set 2 set 3
0 64
1
2 2
3 3
4 4
5
6 6
7
8
9
10
11 11
12
13 13
14
15
16 16 48
17
18
19 19
20
21 21
22 22
23
24
25
26
27 27
28
29
30
31
pf3

Partial preview of the text

Download Exam 3 with Solution - Computer Architecture | CSCE 212 and more Exams Computer Science in PDF only on Docsity!

  1. Assume a cache with the following characteristics: Word size: 4 bytes Block size:Associativity: 16 words4-way Replacement policy:Total cache data capacity: least-recently-used (LRU)8192 bytes a. Assume the CPU uses a 32-bit address. Show how the address is split into tag , index , word address , and byte address. byte address -- bits 1 down to 0 word address -- lg 16 => 4 bits, so bits 5 down to 2 8192 bytes / (4 bytes/word * 16 words/block * 4 sets) = 32 blocks/settherefore, lg 32 = 5 index bits, so bits 10 down to 6 tag is the rest of the bits, so bits 31 down to 11 21-bit tag 5-bit index 4-bit word address 2-bit byte address 31:11 10:6 5:2 1: b. Show the final contents of the cache after the following series of accesses. The addresses shown correspond to the index fields of each access.cache is initially empty. Assume the Note that when I said “index fields” I meant bits 31 down to 6. 2, 3, 11, 16, 21, 13, 64, 48, 19, 11, 3, 22, 4, 27, 6, 11 block 0 set 0 64 set 1 set 2 set 3 (^12 ) (^34 ) (^56 ) (^78) 109 1112 11 1314 13 (^1516 16 ) (^1718) 1920 19 (^2122 ) (^2324) (^2526) 2728 27 (^2930) 31
  1. What is the average memory access time for the following system, which has a write- back cache: Hit penalty:Miss rate: 10 ns2% Probability that a cache line is dirty:Time required to fill a cache line: 40%100 ns Time required to write-back a cache line: 200 ns AMAT = 10 + .02 * (100 + .4(200)) = 13.6 ns
  2. List and describe three reasons for a cache miss to occur. compulsory - first time a line is accessedconflict - address maps to same line as another address being used by the program capacity - cache is not large enough to hold all the addresses used by the program
  3. Consider a virtual memory system with the following properties: 40-bit virtual byte address16 KB pages 36-bit physical byte address What is the total size of the page table for each process on this processor, assuming thatthe valid and dirty bits require a total of 2 bits and that all virtual pages are in use? 2 40-lg(16*1024)^ * (2+36) bits = 2^26 * 38 bits = 318 MB
  4. Assume a system uses odd parity. a. Assume the word 0111 is read from the disk, where the parity bit is the least significant bit. Is there an error? Yes, because there are two 1’s so the parity bit should be 0, not 1. b. Assume the word 0X10 is read from the disk, where the parity bit is the leastsignificant bit and the X is unknown. What is the unknown value? 1, since the parity indicates that there are supposed to be an even number of 1’s.
  5. A program repeatedly performs the following three-step process:
    • read in a 4 KB block of data from disk,
    • do some processing on that data, and
    • write out the result as another 4 KB block elsewhere on the disk. Each block is contiguous, located on a random track, and doesn’t span multiple tracks. The disk rotates at 10,000 RPM, has an average seek time of 8 ms, and has a transfer rate of 50 MB/sec.disk or processor, and there is no overlapping of disk operation with processing. The controller overhead is 2 ms. No other programs are using the The processing step takes 20 million clock cycles, and the clock rate is 5 GHz.overall speed of the system in blocks processed per second? What is the rotational latency = 1/10000 * (1/2) = 50 us seek time = 8 ms