CS 3853 Computer Architecture Recitation 8 Answers
Quiz 5a
- The number of blocks is 64K/32 = 2K. Number of sets is 2K/4 = 512 = 29, so 9 bits are needed.
- 22/1000 = .022.
- 22/1250 = .0176
Quiz 5b
- The number of blocks is 32K/128 = 256. Number of sets is 256/8= 32 = 25, so 5 bits are needed.
- 31/1000 = .031.
- 31/1200 = .02583
Problems
- The block offset is now 8 bits and the tag + index will be 42 bits.
Each answer below except the last has the index and tag one fewer than before.
- index: 7 bits, tag: 35 bits
- index: 6 bits, tag: 36 bits
- index: 5 bits, tag: 37 bits
- index: 0 bits, tag: 42 bits
-
- 5, since 32 = 25
- 10, since the number of blocks is 32K/32 = 210
- Need the address size for this. If 32 bits: 32 - 10 - 5 = 17
-
- 5, since 32 = 25
- 9, since the number of sets is (32K/32)/2 = 29
- Need the address size for this. If 32 bits: 32 - 9 - 5 = 18
-
- 5, since 32 = 25
- 8, since the number of sets is (32K/32)/4 = 28
- Need the address size for this. If 32 bits: 32 - 8 - 5 = 19
-
- 5, since 32 = 25
- 0, since the number of sets is 1 = 20
- Need the address size for this. If 32 bits: 32 - 5 = 27
- Memory access time = hit time + miss rate × miss penalty = 1 + .1 × 50 = 6 ns.
- The L2 cache will have the above miss penalty and an average access time is 5 + .1 × 50 = 10 ns.
This becomes the miss penalty of the L1 cache, so its average access time is 1 + .1 × 10 = 2 ns.
-
average access time = hit time + miss ratio × miss penalty
The average memory access time is the average access time of the L1 cache.
The miss penalty of the L1 cache is the average access time of the L2 cache.
The miss penalty of the L2 cache is the average access time of the L3 cache.
The miss penalty of the L3 cache is the access time of main memory.
The L3 hit time is 10 ns, miss ratio is .03 and the miss penalty is 50 ns.
The L3 average access time is 10 ns + .03 × 50 = 11.5 ns.
The L2 hit time 5 ns, miss ratio is .05 and the miss penalty is 11.5 ns
The L2 avergae access time is 5 ns + .05 × 11.5 ns = 5.575 ns
The L1 hit time is 1 ns, miss ratio is .1, and mis penalty is 5.575 ns.
The L1 average access time is 1 ns + .1 × 5.575 ns = 1.5575 ns.
The average access time is 1.5575 ns.