Memory Flashcards

1
Q

What are the three levels in the memory hierarchy

A

Cache, main memory, virtual memory

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

Temporal locality

A
  • locality in time

- keeps recently accessed data in higher levels of memory hierarchy

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

Spatial Locality

A
  • locality in space

- when data is accessed, nearby data brought into higher levels of memory hierarchy too

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

Hit:

A

data found in that level of memory hierarchy

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

Miss:

A

data not found in that level of memory hierarchy (must go to next level)

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

Hit rate:

A

hits/#memory accesses (1 minus miss rate)

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

Miss rate:

A

misses/#memory accesses (1 minus hit rate)

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

Average Memory Access Time (AMAT):

A

average time for processor to access data. Given by:

tcache + MRcache(tMM + MRMM(tVM))

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

Cache:

A
  • highest level of memory

- fast (about 1 cycle access time)

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

What is Capacity (C):

A

number of data bytes in cache

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

What is block size (b):

A

bytes of data brought into cache at once

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

What is number of Blocks (B):

A

number of blocks in cache (B = C/b)

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

What is Degree of associativity (N)

A

number of blocks in a set

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

How do you calculate number of sets in cache?

A

S = B/N

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

three types of cache organisation:

A
  • Direct mapped (1 block per set)
  • N-way set associative (N blocks per set)
  • Fully associative (all cache blocks in one set)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do larger blocks in direct mapped cache improve performance?

A

reduce compulsory misses though spatial locality

17
Q

How does associativity improved cache performance?

A

reduces conflict misses

18
Q

What are the different types of misses?

A
  • compulsory: first time data accessed
  • capacity: cache too small to hold all data of interest
  • conflict: data of interest maps to same location in cache
19
Q

Miss penalty:

A

time it takes to retrieve a block from lower level of hierarchy

20
Q

How are capacity misses reduced?

A

LRU replacement: least recently used block in a set is evicted

21
Q

What is page size? (VM)

A

amount of memory transferred from hard disk to DRAM at once

22
Q

What is address translation? (VM)

A

determining physical address from virtual address

23
Q

What is page table? (VM)

A

lookup table used to translate virtual addresses to physical addresses

24
Q

What are page table challenes?(VM)

A
  • page table is large
  • load/store requires 2 main memory accesses
  • this cuts performance in half`
25
Q

What is a TLB and how does it work?

A
  • Table Lookaside Buffer is a small cache of most recent translations
  • speeds up address translation by reducing # of memory accesses for most loads/stores from 2 to 1
  • small: accessed in <1 cycle
  • fully associative
  • > 99% hit rate
  • however it can’t store many entries (16 - 512)
26
Q

How is memory protected in virtual memory?

A

Each process/program has its own page table with a unique virtual to physical page mapping. Each process can use the entire virtual address space.