in CO and Architecture retagged by
418 views
5 votes
5 votes
Which of the following is the best justification for using the middle bits of an address as the set index into a cache rather than the most significant bits?
  1. Indexing with the most significant bits would necessitate a smaller cache than is possible with middle-bit indexing, resulting in generally worse cache performance.
  2. It is impossible to design a system that uses the most significant bits of an address as the set index.
  3. The process of determining whether a cache access will result in a hit or a miss is faster using middle-bit indexing.
  4. A program with good spatial locality is likely to make more efficient use of the cache with middle-bit indexing than with high-bit indexing.
in CO and Architecture retagged by
418 views

1 comment

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$
All India Mock Test 2 - Solutions Part 1

0
0

1 Answer

1 vote
1 vote

Sets are a basic restriction on where data from main memory can exist in the cache. If the set bits were the highest-order bits, then large consecutive ranges in the main memory would map to the same cache set, causing many conflicts and evictions. This would give poor cache performance due to all the misses.

The number of sets, times the block size (times the number of lines), tells you how many consecutive addresses from main memory you can store at one time.

On the other hand, the tag bits represent a "pressure valve" or "degree of freedom" that lets you store data from wildly different addresses in main memory together in the same cache.

In other words, low-order bits tend to change a lot when you are traversing an array or taking advantage of data locality. High-order bits tend to stay the same for those operations. You want to take advantage of different low-order bits to store a working set with good locality in a cache at the same time, to get a bunch of cache hits together.

2 Comments

using higher order bits can’t take advantage of temporal locality of reference but it will difinitely advantage of spatial locality of reference.@amitarp818 can you check once ?

0
0
second point is ok but can’t agree with the first points that much.
0
0
Answer:

Related questions