Memory Hierarchy Flashcards

Week 2.5 (18 cards)

1
Q

define locality of reference

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the 4 reasons that make locality make sense

A
  1. instructions other than fetch & jump are fetched sequentially
  2. iterations repeat a small number of contiguous instructions
  3. the nesting of function calls is usually not very deep
  4. data structures are usually accessed sequentially
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what are the 2 dimensions of locality

A
  1. temporal
  2. spatial
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is temporal locality

A

a programme tends to reference recently accessed memory locations again in the near future

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

draw a probability distribution of temporal locality

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is spatial locality

A

a programme tends to reference memory locations that are near one another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

draw a probability distribution of spatial locality

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are the 4 types of locality

A
  1. instruction spatial
  2. instruction temporal
  3. data spatial
  4. data termporal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what are the 3 main memory trade offs

A
  1. ^ memory speed = ^ cost per bit
  2. ^ memory size = v speed
  3. ^ memory size = v cost per bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

write out the memory hierachy

A
  1. CPU
  2. cache
  3. main-memory
  4. solid-state memory
  5. virtual memory & file/database memory
  6. office bulk memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what changes as you travel down the memory hierarchy

A
  • cheaper
  • slower
  • larger
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are the 5 measures of performance modelling

A
  1. expected access time
  2. average cost per bit
  3. average cost per bit/relative memory size
  4. access efficiency
  5. average access time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

expected access time formula

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

average cost per bit formula

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

average cost per bit/relative memory size formula

A

Cs/C2 = (C1/C2 + S2/S1)/(1 + S2/S1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

access efficiency formula

A

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

17
Q

average access time formula

A

Ts = sum of (harmonic mean(1 - hj)(tihi)