Cache Average Access Time
- $H$ is the hit rate of cache level $L_i$
- $T_i$ is the access time of level $L_i$
- $R_i$ is the burst rate per word of level $L_i$ (after startup access time)
- $B$ is the block size
$T_\text{average}$ with $L_1$ cache
Then there are two possible cases.
- We have a hit and only pay $L_1$ cache time.
- We miss and read the whole block to $L_1$
Therefore, Average Access Time $T_\text{average}$ is (Hit Time) $T_1$ + (Miss Ratio) $(1-H_1)$ × (Miss Penalty) $(T_\text{main memory} + B \times R_\text{main memory})$
Taverage=T1+(1−H1)×[Tmain memory+B×Rmain memory]$T_\text{average}$ with $L_2$ cache
- Hit at $L_1$ cache
- Hit at $L_2$ cache
- We miss and read the whole block from memory
Similarly,
Taverage=T1+(1−H1)×H2×[T2+B×R2]+(1−H1)×(1−H2)×[T2+Tmain memory+B×Rmain memory]