Skip to main content
deleted 17 characters in body
Source Link
pveentjer
  • 339
  • 2
  • 7

An n-way set associative cache is a cache that is chopped up in sections called sets. And each set can hold n-blocks.

So for a givenA cache-address, you can break itbe broken up up in 3 parts.

  • the offset within the block
  • the index that identifies the set
  • the tag that identifies the block in the set.

So whenWhen a request comes in, the index is calculated to identify the set. Then the tags of all blocks in the set are checked. And when a block with a matching tag is found, the right bytes are returned based on the offset.

A direct mapped cached is effectively a 1 way set associative cache.

So associativity doesn't mean the number of blocks the cache can hold, but the number of blocks a set within the cache can hold.

The big advantage of a n-way set associative cache compared to a direct mapped cache, is the latter can only have a single block for a rangeset of addresses and the former can hold multiple blocks for a rangeset of addresses.

An n-way set associative cache is a cache that is chopped up in sections called sets. And each set can hold n-blocks.

So for a given cache-address, you can break it up in 3 parts.

  • the offset within the block
  • the index that identifies the set
  • the tag that identifies the block in the set.

So when a request comes in, the index is calculated to identify the set. Then the tags of all blocks in the set are checked. And when a block with a matching tag is found, the right bytes are returned based on the offset.

A direct mapped cached is effectively a 1 way set associative cache.

So associativity doesn't mean the number of blocks the cache can hold, but the number of blocks a set within the cache can hold.

The big advantage of a n-way set associative cache compared to a direct mapped cache, is the latter can only have a single block for a range of addresses and the former can hold multiple blocks for a range of addresses.

An n-way set associative cache is a cache that is chopped up in sections called sets. And each set can hold n-blocks.

A cache-address can be broken up up in 3 parts.

  • the offset within the block
  • the index that identifies the set
  • the tag that identifies the block in the set.

When a request comes in, the index is calculated to identify the set. Then the tags of all blocks in the set are checked. And when a block with a matching tag is found, the right bytes are returned based on the offset.

A direct mapped cached is effectively a 1 way set associative cache.

So associativity doesn't mean the number of blocks the cache can hold, but the number of blocks a set within the cache can hold.

The big advantage of a n-way set associative cache compared to a direct mapped cache, is the latter can only have a single block for a set of addresses and the former can hold multiple blocks for a set of addresses.

Source Link
pveentjer
  • 339
  • 2
  • 7

An n-way set associative cache is a cache that is chopped up in sections called sets. And each set can hold n-blocks.

So for a given cache-address, you can break it up in 3 parts.

  • the offset within the block
  • the index that identifies the set
  • the tag that identifies the block in the set.

So when a request comes in, the index is calculated to identify the set. Then the tags of all blocks in the set are checked. And when a block with a matching tag is found, the right bytes are returned based on the offset.

A direct mapped cached is effectively a 1 way set associative cache.

So associativity doesn't mean the number of blocks the cache can hold, but the number of blocks a set within the cache can hold.

The big advantage of a n-way set associative cache compared to a direct mapped cache, is the latter can only have a single block for a range of addresses and the former can hold multiple blocks for a range of addresses.