You are on page 1of 7

REPLACEMENT Vidhyavani A

ALGORITHM
WHAT IS REPLACEMENT
ALGORITHM?
Is an algorithm used to manage cache of information stored on
the computer

There is a steady rate of information being exchanged between


the main memory and the cache memory

In order to make this exchange as efficient as possible we use


replacement algorithms
TYPES OF REPLACEMENT
ALGORITHMS

FIFO
LRU
MRU
Random
FIRST IN FIRST OUT (FIFO)

Block 3
Replacement order
Replaces the blocks in the order
Insertion order

they were added


Block 2
• So Block 1 will be replaced first
Block1
LEAST RECENTLY USED (LRU)

Discards the least used block first


• In this implementation, ‘age bits’ are used
to keep track of cache lines and when a
cache line is accessed all ‘age bits’ are
updated and the least recently used is
replaced
MOST RECENTLY USED (MRU)

Discards the most recently used block first


• In this implementation, ‘age bits’ are used
to keep track of cache lines and when a
cache line is accessed all ‘age bits’ are
updated and the most recently used is
replaced
RANDOM REPLACEMENT

Randomly selects a candidate


item and discards it to make
space when necessary.
• This algorithm does not require keeping
any information about the access
history.
• Benefits: Simple and Efficient

You might also like