Docsity

Midterm Exam 2 | Computer Architecture | CS 3853, Exams of Computer Architecture and Organization

Toggle sidebar
bg1
Seat Number Name
CS 3853 Midterm Exam 2 — Spring 2013
This is a closed book exam. You may use a calculator, as long as it is not capable of accessing a network. No cell phones.
This is a 75-minute exam. The questions are divided into 2 parts. The first part is worth 80 points. Everyone should be able to finish
Part 1. Part 2 is worth 20 points. If you cannot do the questions are Part 1 quickly, you may not have time to finish Part 2.
Put your answers in the space provided. You must show your work to get credit. If you cannot fit your answers in the space provided,
use the back of the last page or ask for an additional sheet of paper. You will be given a page of diagrams to refer to for this exam. You
must turn in the diagram sheet with your exam.
Part 1: 80 points
1) (4 points) Suppose that a cache has a hit time of 1 cycle, a hit ratio of 92% and a miss penalty of 7 cycles. What is the average
access time in cycles? Put a box around your final answer.
2) (5 points) Suppose we have a standard MIPS 5-stage pipeline which has a CPI of 1 when all memory accesses are cache hits.
A unified cache is used with a hit rate of 95% and a miss penalty of 21 cycles. Loads and stores are 32% of all instructions.
What is the CPI when cache misses are taken into account? Put a box around your final answer.
3) (5 points) What is the most important reason for using separate caches for instructions and data? Explain.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Midterm Exam 2 | Computer Architecture | CS 3853 and more Exams Computer Architecture and Organization in PDF only on Docsity!

Seat Number Name

CS 3853 Midterm Exam 2 — Spring 2013

This is a closed book exam. You may use a calculator, as long as it is not capable of accessing a network. No cell phones. This is a 75-minute exam. The questions are divided into 2 parts. The first part is worth 80 points. Everyone should be able to finish Part 1. Part 2 is worth 20 points. If you cannot do the questions are Part 1 quickly, you may not have time to finish Part 2. Put your answers in the space provided. You must show your work to get credit. If you cannot fit your answers in the space provided, use the back of the last page or ask for an additional sheet of paper. You will be given a page of diagrams to refer to for this exam. You must turn in the diagram sheet with your exam.

Part 1: 80 points

  1. (4 points) Suppose that a cache has a hit time of 1 cycle, a hit ratio of 92% and a miss penalty of 7 cycles. What is the average access time in cycles? Put a box around your final answer.

  2. (5 points) Suppose we have a standard MIPS 5-stage pipeline which has a CPI of 1 when all memory accesses are cache hits. A unified cache is used with a hit rate of 95% and a miss penalty of 21 cycles. Loads and stores are 32% of all instructions. What is the CPI when cache misses are taken into account? Put a box around your final answer.

  3. (5 points) What is the most important reason for using separate caches for instructions and data? Explain.

  1. (4 points) A 64K cache has a block size of 64 bytes. Assume addresses are 32 bits. Draw a diagram of an address showing the names and sizes of the fields if the cache is: a) direct mapped

b) 2-way set associative

c) 4-way set associative

d) fully associative

  1. (2 points) For problem 4, find the block address and offset in hexadecimal for the address 0x17b456. Note: The answer is the same for all four parts of problem 4.

  2. (8 points) For the byte at address given in problem 5, describe in words how you would determine whether the byte is in the cache. Be specific by calculating, block, set, and offset numbers in hexadecimal that indicate where to look and what to look for. a)

b)

c)

d)

  1. (6 points) A memory system uses three caches. The caches have hit rates and times given. Main memory has an access time of 60 ns. For a memory access, first the L1 cache is checked. If there is a miss, the L2 cache is checked. If there is a miss in the L2 cache, the L3 cache is checked. Finally, a miss in the L3 caches causes an access to main memory. What is he effective memory access time? Show your work and put a box around your final answer.

Cache hit rate hit time L1 .85 1 ns. L2 .92 7 ns. L3 .95 15 ns.

  1. (8 points) This problem is about virtual memory. a) What is a page table? How is a page table used to translate a virtual addresses to a physical addresses?

b) What is a TLB? What is it used for? Why is it necessary? What is typically stored in a TLB entry?

  1. (6 points) A virtual memory system has a 64-bit virtual address, a 40-bit physical address, a page size of 16K, and a TLB with 64 entries. How many total bits are required for the TLB if the TLB is: a) direct mapped b) 2-way set associative c) fully associative Show your work, label you answers and put boxes around them.

  2. (13 points) The diagram shows the memory organization of a processor with a TLB and 2 levels of cache. The number of bits in each field is labeled with a lower case letter, a through r. For each blank field in the table below, fill in the value, or write ND, for “not determined by the information given.” Assume the following: Virtual addresses are 64 bits Physical addresses are 47 bits The page size is 64K The TLB has 32 entries and is direct mapped The L1 cache is 2-way set associative with a block size of 64 bytes. The L2 cache is 4MB and 4-way set associative the L1 and L2 caches use the same block size a b c d e f g h i j k l m n o p q r

  1. (10 points) This problem relates to a virtual memory system with an L1 cache. a) Describe in words what is meant by: i) physically indexed vs. virtually indexed ii) physically tagged vs. virtually tagged b) Which kind of indexing and tagging is used by the L1 cache in the diagram for problem 12? c) What is the advantage of having a virtually indexed/physically tagged cache over a physically indexed/physically tagged cache? d) Explain how having a virtually indexed/physically tagged cache limits the size of an L1 cache.

Seat Number Name