949 views
1 votes
1 votes
A cache has hit ration 0.95, 64 byte lines , having cache hit latency of 5ns. The main memory takes 90ns to return the first word(16 bits) of a line and 10ns to return each subsequent word . The time needed when cache miss happens is _____(nsec) (Assume cache wait until the line has been fetched into cache and then re-execute the main memory operation , results cache hit . Ignore time to write line into cache once it has been fetched from main memory and to detect cache miss time needed same as cache hit time)

1 Answer

1 votes
1 votes
cache miss rate is 0.05 and cache latency is 5ns.

given 64 bytes is line size and word lenth =16 bits (2 bytes)

So eachline contains 64/2 = 32 words.

given fetching first word from memory takes 90ns and remaining 31 words take 31*10 = 310 ns

So time needed when cache miss happens is 5+90+310 =405ns

Since cache miss rate is 0.05 we get 0.05(405) = 20.25 ns

given,if we re-execute  the mainmemory operation then we wil have cache hit

So cache hit latency = 5ns is also added if we re-execute and to get a cache hit

So time needed when cache miss happens is 5+90+310 +5 = 410ns

Since cahce miss rate is 0.05 we get 0.05*410 = 20.5ns  (if re-executed otherwise 20.25ns)

correct if anything wrong.
edited by

No related questions found