Lecture 4 - Cache 3
Lecture 4 - Cache 3
Microprocessor Architecture
Basic Cache Operation, cont.:
replacement policies, write policies
cache
cache
cache
D
cache
cache D
The block size is only 4 bytes. In the figure below, each byte of a block is shown as a small rectangle with a value inside. For
example, the third byte of block X has the value 99 and all other bytes have the value 0.
INITIAL STATE: Suppose block X was brought into both the L1 and L2 caches but subsequent activity caused block X to be
evicted from the L1 cache. Therefore, initially, block X is not in the L1 cache and block X is in the L2 cache.
Mem. Hier. #1 Mem. Hier. #2 Mem. Hier. #3
X: 0 0 99 0 X: 0 0 99 0 X: 0 0 99 0
X: 0 0 99 0 X: 0 0 99 0 X: 0 0 99 0
Suppose the processor issues a write request to the third byte of block X, changing its value from 99 to 55. For each memory
hierarchy:
• Show where copies of block X exist, after the write is performed.
• Show the values of all bytes within block X wherever block X exists, after the write is performed.
X: 0 0 55 0
X:
dirty 0 0 55 0