Memory Hierarchy Flashcards
Week 2.5 (18 cards)
define locality of reference
a processor’s memory access tent to cluster - i.e tend to access the same set of memory locations repeatedly over a short period of times
what are the 4 reasons that make locality make sense
- instructions other than fetch & jump are fetched sequentially
- iterations repeat a small number of contiguous instructions
- the nesting of function calls is usually not very deep
- data structures are usually accessed sequentially
what are the 2 dimensions of locality
- temporal
- spatial
what is temporal locality
a programme tends to reference recently accessed memory locations again in the near future
draw a probability distribution of temporal locality
what is spatial locality
a programme tends to reference memory locations that are near one another
draw a probability distribution of spatial locality
what are the 4 types of locality
- instruction spatial
- instruction temporal
- data spatial
- data termporal
what are the 3 main memory trade offs
- ^ memory speed = ^ cost per bit
- ^ memory size = v speed
- ^ memory size = v cost per bit
write out the memory hierachy
- CPU
- cache
- main-memory
- solid-state memory
- virtual memory & file/database memory
- office bulk memory
what changes as you travel down the memory hierarchy
- cheaper
- slower
- larger
what are the 5 measures of performance modelling
- expected access time
- average cost per bit
- average cost per bit/relative memory size
- access efficiency
- average access time
expected access time formula
ts = h.t + (1 - h)(t1 + t2)
= t1 + (1 - h).t2
where:
- h = M1 hit ratio
- t1 = access time of M1
- t2 = access time of M2
average cost per bit formula
Cs = (C1.S1 + C2.S2)/(S1 + S2)
where:
- Cs = average cost per bit
- C1 average cost per bit of M1
- C2 = average cost per bit of M2
- S1 = size of M1
- S2 = size of M2
average cost per bit/relative memory size formula
Cs/C2 = (C1/C2 + S2/S1)/(1 + S2/S1)
access efficiency formula
T1/Ts = T1/(T1 + (1 - H).T2/T1
= 1/(1 + (1 - H).T2/T1)
where:
- T1 = access time of M1
- T2 = access time of M2
average access time formula
Ts = sum of (harmonic mean(1 - hj)(tihi)