Memory Flashcards
What are the three levels in the memory hierarchy
Cache, main memory, virtual memory
Temporal locality
- locality in time
- keeps recently accessed data in higher levels of memory hierarchy
Spatial Locality
- locality in space
- when data is accessed, nearby data brought into higher levels of memory hierarchy too
Hit:
data found in that level of memory hierarchy
Miss:
data not found in that level of memory hierarchy (must go to next level)
Hit rate:
hits/#memory accesses (1 minus miss rate)
Miss rate:
misses/#memory accesses (1 minus hit rate)
Average Memory Access Time (AMAT):
average time for processor to access data. Given by:
tcache + MRcache(tMM + MRMM(tVM))
Cache:
- highest level of memory
- fast (about 1 cycle access time)
What is Capacity (C):
number of data bytes in cache
What is block size (b):
bytes of data brought into cache at once
What is number of Blocks (B):
number of blocks in cache (B = C/b)
What is Degree of associativity (N)
number of blocks in a set
How do you calculate number of sets in cache?
S = B/N
three types of cache organisation:
- Direct mapped (1 block per set)
- N-way set associative (N blocks per set)
- Fully associative (all cache blocks in one set)