95%(19)18 out of 19 people found this document helpful
This preview shows page 8 - 13 out of 15 pages.
2. (2 points) Identify the number of bits for the cache index.3. (2 points) Identify the number of bits for the cache size.4. (15 points) Consider the memory address trace (similar to PA3) and indicate which access is a hit andmiss. show work.Memory addressHIT/MISSWhy is it a hit/miss?0x0000100x0000140x0000180x00001C0x0010100x1100200x1100100x1100140x1100240x0011208
/* Extra page for work */9
5. (3 points) What is spatial locality? How many hits occur due to spatial locality in the trace above?6. (3 points) What is temporal locality? How many hits occur due to temporal locality in the trace above?7. (8 points) There is a memory system with L1 cache and main memory. The L1 cache latency is 10cycles, main memory latency is 100 cycles and L1 hit rate is 95%. Assume the latency of servicingan L1 miss is equal to the latency of the main memory. Answer the following questions.•What is the total time to execute a program withXmemory accesses without a cache?•What is the total time to execute a program withXmemory accesses with a cache?10
•What is the speedup with the cache?•If you increase the hit rate to 99%, what is the speedup with a cache?11
Extra Credit PointsProblem 1: Bomblab (20 points)As with the bomblab you have to devise the input to this program. There are multiple inputs that solve thisphase namedfoo.Identify all the inputs that would defuse this phase. The functionexplodebombhas thesame behavior as in bomblab. The functionscanfis the other function used in this program. This programcan be diffused without using gdb. (10 points for each input)..LC0:.string "%d".text.globl foo.typefoo, @functionfoo:pushl%ebpmovl%esp, %ebpsubl$40, %espleal-12(%ebp), %eaxmovl%eax, 4(%esp)movl$.LC0, (%esp)callscanfmovl-12(%ebp), %eaxcmpl$3, %eaxje.L3cmpl$5, %eaxjne.L7jmp.L8.L3:leal-16(%ebp), %eaxmovl%eax, 4(%esp)movl$.LC0, (%esp)callscanfcmpl$17, -16(%ebp)je.L6callexplode_bomb.L8:leal-16(%ebp), %eaxmovl%eax, 4(%esp)movl$.LC0, (%esp)callscanfcmpl$19, -16(%ebp)je.L6.L7:callexplode_bomb.L6:leaveret12