Set Associative Cache: 8-Way Determination

Therefore, in summary, this addressing format and cache size represent an 8-way set associative cache with 16 words per block.
  • #1
hholzer
37
0
If I have the addressing format:

Tag: 31-12
Index: 11-6
Byte offset: 5-0

And if my cache size is 32KB = 32*2^10 = 2^5*2^10 = 2^15

then this would represent a how many-way set associative
cache? i.e., an x-way associative cache?

Since bits 11-6 are used for the index, then this would
mean that there are 6 bits used for the number of sets:
2^6 sets but how many blocks per set? If I have
determined this correctly, it would be:
2^6 = (2^15)/(x*2^6) or 2^3 = x ?

So it would represent an 8-way set associative cache.
Then, the number of words in a block would be:
2^6/2^2 = 2^4? That doesn't seem right to me.
 
Computer science news on Phys.org
  • #2
Can you help me confirm this?No, the number of words in a block is determined by the byte offset (bits 5-0), which indicates the number of bytes. So if the byte offset has 6 bits, that means there are 2^6 = 64 bytes per block, or 16 words per block.
 

1. What is a set associative cache?

A set associative cache is a type of cache memory used in computer systems to improve the efficiency of data access. It is a combination of direct-mapped and fully associative caches, where data is stored in sets of blocks and each block can be placed in any of the cache's lines within its set.

2. What is the difference between a direct-mapped cache and a set associative cache?

In a direct-mapped cache, each block of data can only be stored in one specific line in the cache. In a set associative cache, each block can be stored in any line within its set, improving the chances of a cache hit.

3. What does an "8-way determination" mean in a set associative cache?

The number in "8-way" refers to the number of lines or blocks in each set within the cache. In an 8-way set associative cache, each set contains 8 lines, meaning a total of 64 lines in the entire cache.

4. How does a set associative cache improve performance?

A set associative cache improves performance by increasing the chances of a cache hit, where the requested data is already stored in the cache. This reduces the need to retrieve data from slower memory sources, improving overall system performance.

5. Are there any downsides to using a set associative cache?

One downside of a set associative cache is that it requires additional hardware for the set indexing and comparison, making it more complex and expensive compared to a direct-mapped cache. Additionally, the number of lines in each set must be chosen carefully to balance the chances of a cache hit and the cost of the hardware.

Similar threads

  • Computing and Technology
Replies
10
Views
2K
Replies
12
Views
567
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
876
  • Engineering and Comp Sci Homework Help
Replies
7
Views
848
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
4
Views
922
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Precalculus Mathematics Homework Help
Replies
11
Views
1K
Back
Top