Chapter 5 Flashcards
Cache Memory
Define
Block
Minimum unit of transfer between cache and main memory
Define
Frame
To distinguish between the data transferred and the chunk of physical memory.
Define
Line
A portion of cache memory capable of holding one block, so-called because it is usually drawn as a horizontal object
Define
Tag
A portion of a cache line that is used for addressing purposes
Define
Line size
The number of data bytes, or block size, contained in a line
List
Elements of Cache design
Cache address (logical, physical)
Cache size
Mapping function (direct, fully associative, set associative)
Replacement algorithm
Write policy
Line size
Number of caches (single or two level, unified or split)
Define
Virtual memory
Facility that allows programs to address memory from a virtual pov, without regard to the amount of main memory physically available. When used, the address fields of machine instructions contain virtual addresses. For reads and writes from main memory, a hardware memory management unit (MMU) translates each virtual address into a physical address in main memory
Some thoughts about
Cache Size
Preferable to be small enough that overall avg cost per bit is close to that of main memory alone, but large enough that overall avg access time is close to that of cache alone
Speed decreases with size, more gates needed. Limited by amount of space on board and chip.
Optimal size depends on nature of workload
Define
Direct mapped
cache access method
Organization: sequence of m lines
Mapping: each block of main memory maps to one unique line of cache
Access: Line portion of address used to access cache line; tag portion used to check for hit on that line.
Define
Fully Associative
cache access methods
Organization: sequence of m lines
Mapping: each block of main memory can map to any line of cache
Access: tag portion of address used to check every line for hit on that line
Define
Set Associative
Organization: sequence of m lines organized as v sets of k lines each
Mapping: each block of main memory maps to one unique cache set
Access: Line portion of address used to access cache set; tag portion used to check every line in that set for hit on that line.
Compromise with strengths of direct and fully associative.
Define
Content-addressable memory
CAM
Also known as Associative storage
Is constructed of static RAM (SRAM) cells, but more expensive and less storage than regular SRAM
Designed such that when a bit string is supplied, the CAM searches its entire memory in parallel for a match. If found, returns address and sometimes data. Only takes one clock cycle
Define need for
Replacement Algorithms
When new block is brought into cache, one of the existing blocks must be replaced. Direct, don’t get a choice. For high speed, algorithm must be implemented in hardware.
List
Most common replacement algorithms
Least recently used (LRU)- most effective
FIFO
Least frequently used (LFU)
Define
Two cases to consider with write policy
If the block has not been altered then it may be overwritten with a new block without first writing out the old block.
If at least one write operation has been performed on a word in that line, main memory must be updatedby writing line of cache to block of memory before bringing new block