1.

How Do You Calculate The Number Of Sets Given Its Way And Size In A Cache?

Answer»

A cache in the primary storage hierarchy contains cache lines that are grouped into sets. If each SET contains k lines then we say that the cache is k-way associative.

A data request has an address specifying the location of the requested data. Each cache-line sized chunk of data from the lower level can only be PLACED into one set. The set that it can be placed into depends on its address. This mapping between addresses and sets must have an easy, fast implementation. The fastest implementation involves using just a portion of the address to select the set.

When this is done, a request address is broken up into THREE parts:

  • An offset part identifies a particular location within a cache line.
  • A set part identifies the set that contains the requested data.
  • A tag part must be saved in each cache line ALONG with its data to distinguish different addresses that COULD be placed in the set.

A cache in the primary storage hierarchy contains cache lines that are grouped into sets. If each set contains k lines then we say that the cache is k-way associative.

A data request has an address specifying the location of the requested data. Each cache-line sized chunk of data from the lower level can only be placed into one set. The set that it can be placed into depends on its address. This mapping between addresses and sets must have an easy, fast implementation. The fastest implementation involves using just a portion of the address to select the set.

When this is done, a request address is broken up into three parts:



Discussion

No Comment Found