2 2 points Identify the number of bits for the cache index 3 2 points Identify

2 2 points identify the number of bits for the cache

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 and miss. show work. Memory address HIT/MISS Why is it a hit/miss? 0x000010 0x000014 0x000018 0x00001C 0x001010 0x110020 0x110010 0x110014 0x110024 0x001120 8
Image of page 8
/* Extra page for work */ 9
Image of page 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 10 cycles, main memory latency is 100 cycles and L1 hit rate is 95%. Assume the latency of servicing an L1 miss is equal to the latency of the main memory. Answer the following questions. What is the total time to execute a program with X memory accesses without a cache? What is the total time to execute a program with X memory accesses with a cache? 10
Image of page 10
What is the speedup with the cache? If you increase the hit rate to 99%, what is the speedup with a cache? 11
Image of page 11
Extra Credit Points Problem 1: Bomblab (20 points) As with the bomblab you have to devise the input to this program. There are multiple inputs that solve this phase named foo . Identify all the inputs that would defuse this phase . The function explode bomb has the same behavior as in bomblab. The function scanf is the other function used in this program. This program can be diffused without using gdb. (10 points for each input). .LC0: .string "%d" .text .globl foo .type foo, @function foo: pushl %ebp movl %esp, %ebp subl $40, %esp leal -12(%ebp), %eax movl %eax, 4(%esp) movl $.LC0, (%esp) call scanf movl -12(%ebp), %eax cmpl $3, %eax je .L3 cmpl $5, %eax jne .L7 jmp .L8 .L3: leal -16(%ebp), %eax movl %eax, 4(%esp) movl $.LC0, (%esp) call scanf cmpl $17, -16(%ebp) je .L6 call explode_bomb .L8: leal -16(%ebp), %eax movl %eax, 4(%esp) movl $.LC0, (%esp) call scanf cmpl $19, -16(%ebp) je .L6 .L7: call explode_bomb .L6: leave ret 12
Image of page 12

Want to read all 15 pages?

Image of page 13

Want to read all 15 pages?

You've reached the end of your free preview.

Want to read all 15 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture