InterviewSolution
| 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:
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: |
|