Skip to content
ENExplore Calculators

Cache Size And Associativity Calculator

Work out cache size and associativity instantly with clear inputs, formula shown and shareable results.

About Cache Size And Associativity Calculator

Cache address decomposition: offset bits from line size, index bits from set count, and the rest are tag. Raising associativity reduces sets, which moves bits from index to tag and grows the tag array — the hidden area cost of higher associativity.

Formula

Cache mapping

sets = size / (line size x ways); index bits = log2(sets); tag bits = address - index - offset

Worked example

With the default values below, Cache Size And Associativity Calculator returns Number of sets of 1,024. Change any input above and every figure here is recalculated in your browser.

Inputs used

Cache size
512 kB
Line size
64 bytes
Associativity
8 ways
Address bits
48 bits

Results

Number of sets
1,024 sets
Index bits
10 bits
Tag bits
32 bits
Tag array overhead
6.641% %

Step by step

  1. 1Values used
  2. 2Cache mapping
  3. 3Number of sets= 1,024 sets
  4. 4Index bits= 10 bits
  5. 5Tag bits= 32 bits
  6. 6Tag array overhead= 6.641 %

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 3 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why does higher associativity cost more?

Fewer sets means longer tags, and every way must be compared in parallel, so both tag array size and comparator count grow.

What associativity is typical?

8-way for L1 data, 16-way for L2 and up to 16-32 way for shared L3. Beyond that the miss-rate benefit is negligible.

Cache Size And Associativity Calculator | Calcrivo