1 / 22

# LRU Algorithm - PowerPoint PPT Presentation

LRU Algorithm. Least Recently Used. Introduction. The fact that the world is doomed with computer, people’s daily living and how the world works nowadays become more modernized. Yet, this is the external reality in this computer era.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'LRU Algorithm' - aquarius

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### LRU Algorithm

Least Recently Used

The fact that the world is doomed with computer, people’s daily living and how the world works nowadays become more modernized. Yet, this is the external reality in this computer era.

We must go deeper by fully understanding the real thing behind the direct usage of computers. The computer world is synthesized, by means of operations done inside for it to function.

There are more instances that troubles occur which we are supposed to solve in order to regulate or stabilize operations.

In order to that, there’s what we call mapping functions which we used to avoid conflict of data processed which involve different replacement algorithms.

One is Least Recently Used (LRU). It used to replace a block that has been in the cache longest with no reference to it. This will be useful to lessen the errors and cache miss.

We are assigned to make a program which executes Least Recently Used (LRU) Algorithm. It used to replace a block that has been in the cache longest with no reference to it. This will be useful to lessen the errors and data traffic.

Statement of the Problem Recently Used (LRU) Algorithm. It used to replace a block that has been in the cache longest with no reference to it. This will be useful to lessen the errors and data traffic.

The cache stores some of the data that are transferred from the main memory in order not to search again for it when the same data was again needed.

But there’s this THRASHING where a data that was just removed in the cache is again needed. So, we make use of different replacement algorithms to lessen the error.

LFU considers a counter. FIFO considers time. While LRU considers both time and counter. With these different algorithms, it is hard to know which is the most effective to lessen the errors.

Objectives considers both time and counter.

• To illustrate how Least Recently Used (LRU) Algorithm work.

• To understand the logical operations done behind the level of the computer user.

• To know and understand the significance of using LRU.

Objectives(cont) considers both time and counter.

• To know what is easier to use between LFU,LRU or FIFO.

• To prove that LRU is effective in lessening error and data traffic.

Significance of the Study considers both time and counter.

Knowing and understanding LRU allows us to use the algorithm properly in order for us to achieve the objectives and solve the statement of the problem.

We will be able to differentiate the said algorithm with the other types and for us to identify its strength and weakness in order to select the appropriate algorithm to be used.

Process other types and for us to identify its strength and weakness in order to select the appropriate algorithm to be used.

Least Recently Used (LRU) Algorithm

• When a new block is stored in the cache, LRU replaces the block that has not been used for the longest period of time.

Divide the main memory block by the number of sets. The remainder determines which set it would belongs.

b) Every time a block is stored, the time increases. But if there is a cache hit, the counter will be incremented.

c) It would compare the counter of the other blocks in that set and replaces the one with the least counter.

d) But if there are two blocks with the same counter, it will then consider the time and replaces the one with the longest time.

Example: that set and replaces the one with the least counter.

MM Blocks: 1,2,3,4,1,5,5,7,6,4

Conclusion that set and replaces the one with the least counter.

Compared to LFU and FIFO, LRU is harder to implement because it considers both time and counter. On the other hand, it is more effective than the other two because there is less thrashing during the process.

Understanding and applying the concepts of LRU Algorithm is very useful and contributed a lot for us to come up a program which executes the said algorithm.

### THANK YOU ! is very useful and contributed a lot for us to come up a program which executes the said algorithm.

Prepared by :

Balatico, Rey Steve P.

Bibit, Mae Rose

Arce, Crissel Lyka Q.