To speed up memory access, caching is typically used. A memory cache is a small
ID: 3786895 • Letter: T
Question
To speed up memory access, caching is typically used. A memory cache is a small but fast memory where data recently accessed is kept in anticipation of future references. When an access is made, if the data is in the cache, then it is returned quickly. This is called a cache hit, otherwise main memory is accessed and the access is said to be a cache miss. For the purposes of this problem, assume that the latency of the main memory is five times the latency of the cache (i.e., if an access to the cache takes one unit of time, then access to main memory would take 5 units of time). Now, consider two possible optimizations for a memory system. The first will cut the latency of the main memory by 50%, whereas the second would cut the latency of the cache by 20%. Read the section in your notes on Amdahl Law, and answer the following questions.
(a) If the cache hit rate is 95% what speedup is achieved under each one of the two optimizations under consideration (separately)?
(b) Under what condition on the cache hit rate would you select each one of the two optimization under consideration (separately)?
(c) What speedup is achieved if both optimizations are adopted. Your answer should be a function of the hit rate, which you should take as a variable h.
Explanation / Answer
(a) Suppose previously time taken to access cache is t , then time taken to access memory will be 5t.
prev time = 0.95*t + 0.05*5t = 1.2t
Now after optimization in first case:
new time = 0.95*t + 0.05*2.5t =1.075 t
speedup = prev time/new time = 1.2 /1.075 = 1.116
Now after optimization in second case:
new time = 0.95*0.8t + 0.05*5t =1.01 t
speedup = prev time/new time = 1.2 /1.01 = 1.18
(c) New time will become:
= 0.95*0.8t + 0.05*2.5t = 0.885
speedup = prev time/new time = 1.2 /0.885 = 1.35
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.