Formula for Cache Performance

  1. Average Access Time for Cache

    The average access time for the cache, denoted as $T_{\text{av}}$, is given by:

    $$ T_{\text{av}} = (R_\text{hit} \cdot T_{\text{hit}}) + (R_\text{miss} \cdot T_{\text{miss}}) $$

  2. Block Replacement Time

    The block replacement time can be expressed as:

    $$ T_{\text{br}} = (T_{\text{addr}} + T_{\text{bt}})(L + BRR) $$

  3. Block Transfer Time

    The block transfer time $T_{\text{bt}}$ can be determined by:

    $$ T_{\text{bt}} = \text{\# of words} \cdot t_{\text{bus}} $$

    where $t_{\text{bus}}$ is the bus clock cycle. If main memory is based on DDR-SDRAM, the block transfer time is divided by $2$.

    $$ T_{\text{bt}} = \text{\# of words} \cdot\frac{t_{\text{bus}}}{2} $$

  4. Unit Conversion

    1. Bit ($\text{b}$)

      $$ 1\;\text{b} = 2^0\;\text{b} $$

    2. Byte ($\text{B}$)

      $$ 1\;\text{B} = 8\;\text{b} = 2^3\;\text{b} $$

      • $1\;\text{KB} = 1024\;\text{B} = 2^{10}\;\text{B} = 2^{13}\;\text{b}$
      • $1\;\text{MB} = 1024\;\text{KB} = 2^{20}\;\text{B} = 2^{23}\;\text{b}$
      • $1\;\text{GB} = 1024\;\text{MB} = 2^{30}\;\text{B} = 2^{33}\;\text{b}$

Midterm Practices

For the following sample midterm, I will go over them and provided my own explanations as to how to go about solving them and how the following equations are derived.

Sample Midterm 1