0% found this document useful (0 votes)
54 views13 pages

Replacement Algo

The document discusses cache memory replacement algorithms. It explains that cache memory is faster than main memory but has limited space, so when the cache is full, replacement algorithms are used to determine which data to remove. The main types of algorithms discussed are LRU, LFU, FIFO, and random replacement. LRU tracks usage history and removes the least recently used item, FIFO removes the oldest item, and LFU removes the least frequently used item.

Uploaded by

Tejaswi Surya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views13 pages

Replacement Algo

The document discusses cache memory replacement algorithms. It explains that cache memory is faster than main memory but has limited space, so when the cache is full, replacement algorithms are used to determine which data to remove. The main types of algorithms discussed are LRU, LFU, FIFO, and random replacement. LRU tracks usage history and removes the least recently used item, FIFO removes the oldest item, and LFU removes the least frequently used item.

Uploaded by

Tejaswi Surya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Index:

1) Replacement Algorithms

2) Basics of Replacement Algorithms


Types of Replacement Algorithms
Details of Replacement Algorithms

3) LRU,LFU,FIFO,Random
Replacement Algorithms
Need of Replacement algorithms ?

.Cache memory is much faster than main memory, but it is also much smaller.
In order to take advantage of the speed of the cache memory, it is necessary to
store frequently accessed data in the cache.

• Cache memory has limited space, so when the cache becomes full, data that
is not frequently accessed must be removed to make space for new data. This is
where the replacement algorithm comes in.

• The replacement algorithm decides which data to remove from the cache
when new data needs to be stored. This decision is important because it can
have a significant impact on the performance of the microprocessor.
Advantages of Replacement Algorithm:

1.Minimizes cache misses: The primary goal of a replacement algorithm is to minimize the
number of cache misses. A good replacement algorithm should be able to predict which data is
most likely to be accessed in the future and keep that data in the cache memory to reduce the
number of cache misses.

2.Maximizes cache hits: A good replacement algorithm should also be able to maximize the
number of cache hits. This means that the algorithm should be able to identify which data is
frequently accessed and keep that data in the cache memory as much as possible.

3.Fast and efficient: The replacement algorithm should be fast and efficient so that it doesn't
slow down the microprocessor. This is particularly important for microprocessors that need to
process data in real-time or in time-sensitive applications.

4.Adaptive: The replacement algorithm should be able to adapt to changes in the data being
processed. For example, if the data being processed changes frequently, the algorithm should
be able to adjust its predictions and keep the most relevant data in the cache memory.
WHY CACHE MEMORY IS USED
Basics of Replacement Algorithms

Replacement algorithms are used to determine which


data to discard from a cache when it is full and a
new item needs to be added. The basic idea is to
remove the least useful or least recently used data in
order to make room for the new data.
Types of Replacement Algorithms

1.LRU
2.LFU
3.FIFO
4.RANDOM
Details of Replacement Algorithms

1.Least Recently Used (LRU): This algorithm keeps track of the usage
history of each item and removes the least recently used item when space
is needed.

2.First-In-First-Out (FIFO): This algorithm removes the oldest item from


the cache or buffer when space is needed.
3.Least Frequently Used (LFU): This algorithm
removes the item that has been accessed the least
number of times when space is needed.

4.Random Replacement: This algorithm randomly


selects an item to remove from the cache or buffer
when space is needed.
FIFO - (FIRST IN FIRST OUT)
LRU-( LEAST RECENTLY USED)
LFU-(LEAST FREQUENTLY USED)
RANDOM-
RANDOM CAN USE ANY OF THE ABOVE 3 ALGORITHM

~SYRLE14
~SYRLE15
~SYRLE16

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy