What is the main goal of cache memory?
To combine the speed of small, fast memory with the size of large, slow memory.
What is a cache hit?
When the requested data is found in the cache.
What is a cache miss?
When the requested data is not in the cache and must be fetched from main memory.
What is a cache line (or block)?
The smallest unit of data transferred between cache and main memory.
What is a tag in cache memory?
The part of an address stored with data in cache to identify which main memory block it came from.
What is the Critical Word First technique?
On a miss, the requested word is fetched first and sent to the CPU before the rest of the block.
What are the three main cache mapping techniques?
Direct Mapping, Associative Mapping, and Set-Associative Mapping.
Describe Direct Mapping.
Each memory block maps to exactly one cache line.
Describe Associative Mapping.
Any memory block can go into any cache line.
Describe Set-Associative Mapping.
Cache is divided into sets; each block maps to one set and can go into any line within that set.
What is the Direct Mapping formula?
Cache Line Number = (Block Address) % (Number of Lines)
What causes cache thrashing?
Repeatedly accessing data that maps to the same cache line in direct mapping.
What are common cache replacement policies?
LRU (Least Recently Used), FIFO (First In, First Out), and LFU (Least Frequently Used).
What does LRU stand for and do?
Least Recently Used – replaces the block that hasn’t been accessed for the longest time.
What is the effect of larger cache size?
Increases performance but also increases cost.
What is the advantage of a set-associative cache?
Higher hit ratio than direct mapping with less complexity than full associative mapping.
What is a logical cache?
Cache that stores data using virtual (logical) addresses.
What is a physical cache?
Cache that stores data using main memory physical addresses.
What are spatial locality–based replacement algorithms?
BCD (Block Correlation Directed Cache) and LAC (Locality-Aware Cache).