Caches: Calculate the Number of Tag Bits

Date: 2014-11-05 |

DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)

Tag bits are left over bits you need to store with the block of data in order to differentiate that block from other blocks of data that could be stored in the same place.  You will always need tag bits with each block.

**Example: **Continuing from where the previous examples left off (click the links in the answer), we are given an 8-way set-associative cache, with 4 byte blocks, 1 kb total data, and addresses of 32 bits.

tag bits = 32 – # index bits# offset bits = 32 – 5 – 2 = 25 tag bits for each block

Want more like this?

The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.