SlideShare a Scribd company logo
1 of 30
Cache Memory
E048-Shailesh Tanwar
E061-Yash Nair
E017-Shairal Neema
E019-Aashita Nyati
Agenda
 Memory Hierarchy
 What is Cache Memory
 Working of Cache
 Structure of Cache
 Cache Write Policies
 Levels of Cache
 Cache Organization
 Mapping techniques
 Replacement algorithms
Memory Hierarchy –
Diagram
Decreasing cost per bitIncreasing capacityIncreasing access timeDecreasing frequency of
access of the memory by
the processor
What is Cache Memory?
 Cache memory is used in order to achieve higher performance of CPU by
allowing the CPU to access data at faster speed.
 It is placed closest to the processor in the computer assembly.
 It is way too costly.
 It is also a type of memory but keeping in mind the cost factor it cannot be
used as a primary memory.
AN INSIGHT INTO THE WORKING OF CACHE
Structure of the Cache memory
Contains address of actual
data fetched from Main Memory
Contains actual data fetched
From the Main Memory
Cache write policies
When we write ,should we write to cache or memory?
 Write through cache – write to both cache and main memory.
Cache and memory are always consistent.
 Write back cache – write only to cache and set a “dirty bit”. When
the block gets replaced from the cache ,write it out to memory.
Levels of Cache
Fastest Fast
Less Fast
Slow
Cache Organization
Address
Address
buffer
Control Control
Data
Data
buffer
System bus
Mapping Techniques
Direct mapping
Associative mapping
Set associative mapping
Direct mapping
Simplest technique
In this , each block of main memory is mapped into
only one possible cache line .
i = j modulo m
where , i= cache memory
j= main memory
m=no. of lines in the cache
Address length = (s + w) bits
Number of addressable units = 2^(s+w) words or
bytes
Block size = line size = 2w words or bytes
Number of blocks in main memory = 2^(s+
w)/2^w = 2s
Number of lines in cache = m = 2^r
Size of tag = (s – r) bits
ASSOCIATIVE MAPPING
It overcomes the disadvantage of direct
mapping.
It permits each main memory block to be
loaded into any line of the cache .
Address length = (s + w) bits
Number of addressable units = 2^(s+w)
words or bytes
Block size = line size = 2^w words or bytes
Number of blocks in main memory =
2^(s+ w)/2^w = 2^s
Number of lines in cache = undetermined
Size of tag = s bits
SET ASSOCIATIVE MAPPING
 The relationship which is followed here is
m= v*k
i= j modulo v
Where ,
i= cache set no.
j= main memory
m= no. of lines in the cache
v= no. of set
k= no. of lines in each set
This is called k-way set associative mapping .
Address length = (s + w) bits
Number of addressable units = 2s+w words
or bytes
Block size = line size = 2^w words or bytes
Number of blocks in main memory = 2^s
Number of lines in set = k
Number of sets = v = 2d
Number of lines in cache = kv = k * 2d
Size of tag = (s – d) bits
Replacement algorithms
Discard itemsAdd new ones
Cache Memory
Cache Full…
Replacement algorithms
 Optimizing instructions.
 To manage cache information on computer.
 In direct mapping.
Each block only maps to one cache block .
 Associative and set associative mapping.
 Least recently used(LRU)
 First in first out(FIFO)
 Least frequently used(LFU)
 Random
Replacement algorithms
Least Recently used
 The most effective.
 Keeps track of which block used when.
 Discards the least recently used blocks first.
USE bit
0
USE bit
1
2 3 4 2 1 3 7
1 2 3 4 5 6 7
2 2 2 2 2 2 7
3 3 3 1 1 1
4 4 4 3 3
EXAMPLE
Page hit
1
Page fault
3
7
First In First Out
 The simplest algorithm.
 Bad performance.
 First entering block, is discarded first.
 Replaces the block that has been in cache the longest.
2 3 4 2 1 3 7
1 2 3 4 5 6 7
2 2 2 2 1 1 1
3 3 3 3 3 3
4 4 4 4 7
EXAMPLE
Page hit Page hit
1
7 Page fault
Least Frequently Used
 Counts how often a block is needed.
 Every block has one counter of its own which is initially
set to 0.
 As the block is referenced, the counter is incremented.
 Replaces the lowest reference frequency block.
2 3 4 2 1 3 7
1 2 3 4 5 6 7
2 2 2 2 2 2 2
3 3 3 3 1 1
4 4 4 4 3
EXAMPLE
Page hit
1 7
Page fault
I I I II I I I
3
Random
 Randomly selects a block.
 Discards it to make space.
 Does not keep track of access history.
 This eliminates the overhead cost of tracking page
references.
Thank You

More Related Content

What's hot

What's hot (20)

cache memory
cache memorycache memory
cache memory
 
cache memory
 cache memory cache memory
cache memory
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coa
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 
04 cache memory.ppt 1
04 cache memory.ppt 104 cache memory.ppt 1
04 cache memory.ppt 1
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Computer architecture cache memory
Computer architecture cache memoryComputer architecture cache memory
Computer architecture cache memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Set associative mapping
Set associative mappingSet associative mapping
Set associative mapping
 
Pci,usb,scsi bus
Pci,usb,scsi busPci,usb,scsi bus
Pci,usb,scsi bus
 
Computer architecture and organization
Computer architecture and organizationComputer architecture and organization
Computer architecture and organization
 
Accessing I/O Devices
Accessing I/O DevicesAccessing I/O Devices
Accessing I/O Devices
 
Interleaved memory
Interleaved memoryInterleaved memory
Interleaved memory
 
Cache memory principles
Cache memory principlesCache memory principles
Cache memory principles
 
Cache memory
Cache memoryCache memory
Cache memory
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
 

Similar to An Insight into the Working of Cache Memory

CACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITSCACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITSAnkitPandey440
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxabcxyz19691969
 
High Performance Computer Architecture
High Performance Computer ArchitectureHigh Performance Computer Architecture
High Performance Computer ArchitectureSubhasis Dash
 
9.1-CSE3421-multicolumn-cache.pdf
9.1-CSE3421-multicolumn-cache.pdf9.1-CSE3421-multicolumn-cache.pdf
9.1-CSE3421-multicolumn-cache.pdfrishav957243
 
Cache.pptx
Cache.pptxCache.pptx
Cache.pptxVCETCSE
 
ECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docxECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docxtidwellveronique
 
ECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docxECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docxtidwellveronique
 

Similar to An Insight into the Working of Cache Memory (20)

CACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITSCACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITS
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
 
High Performance Computer Architecture
High Performance Computer ArchitectureHigh Performance Computer Architecture
High Performance Computer Architecture
 
9.1-CSE3421-multicolumn-cache.pdf
9.1-CSE3421-multicolumn-cache.pdf9.1-CSE3421-multicolumn-cache.pdf
9.1-CSE3421-multicolumn-cache.pdf
 
module3.ppt
module3.pptmodule3.ppt
module3.ppt
 
memory.ppt
memory.pptmemory.ppt
memory.ppt
 
memory.ppt
memory.pptmemory.ppt
memory.ppt
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache recap
Cache recapCache recap
Cache recap
 
Cache.pptx
Cache.pptxCache.pptx
Cache.pptx
 
ECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docxECECS 472572 Final Exam ProjectRemember to check the errat.docx
ECECS 472572 Final Exam ProjectRemember to check the errat.docx
 
ECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docxECECS 472572 Final Exam ProjectRemember to check the err.docx
ECECS 472572 Final Exam ProjectRemember to check the err.docx
 

Recently uploaded

NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...Amil Baba Dawood bangali
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsDILIPKUMARMONDAL6
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 

Recently uploaded (20)

NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
The SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teamsThe SRE Report 2024 - Great Findings for the teams
The SRE Report 2024 - Great Findings for the teams
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 

An Insight into the Working of Cache Memory

  • 1. Cache Memory E048-Shailesh Tanwar E061-Yash Nair E017-Shairal Neema E019-Aashita Nyati
  • 2. Agenda  Memory Hierarchy  What is Cache Memory  Working of Cache  Structure of Cache  Cache Write Policies  Levels of Cache  Cache Organization  Mapping techniques  Replacement algorithms
  • 3. Memory Hierarchy – Diagram Decreasing cost per bitIncreasing capacityIncreasing access timeDecreasing frequency of access of the memory by the processor
  • 4. What is Cache Memory?  Cache memory is used in order to achieve higher performance of CPU by allowing the CPU to access data at faster speed.  It is placed closest to the processor in the computer assembly.  It is way too costly.  It is also a type of memory but keeping in mind the cost factor it cannot be used as a primary memory.
  • 5. AN INSIGHT INTO THE WORKING OF CACHE
  • 6. Structure of the Cache memory Contains address of actual data fetched from Main Memory Contains actual data fetched From the Main Memory
  • 7. Cache write policies When we write ,should we write to cache or memory?  Write through cache – write to both cache and main memory. Cache and memory are always consistent.  Write back cache – write only to cache and set a “dirty bit”. When the block gets replaced from the cache ,write it out to memory.
  • 8. Levels of Cache Fastest Fast Less Fast Slow
  • 10. Mapping Techniques Direct mapping Associative mapping Set associative mapping
  • 11. Direct mapping Simplest technique In this , each block of main memory is mapped into only one possible cache line . i = j modulo m where , i= cache memory j= main memory m=no. of lines in the cache
  • 12.
  • 13. Address length = (s + w) bits Number of addressable units = 2^(s+w) words or bytes Block size = line size = 2w words or bytes Number of blocks in main memory = 2^(s+ w)/2^w = 2s Number of lines in cache = m = 2^r Size of tag = (s – r) bits
  • 14. ASSOCIATIVE MAPPING It overcomes the disadvantage of direct mapping. It permits each main memory block to be loaded into any line of the cache .
  • 15.
  • 16. Address length = (s + w) bits Number of addressable units = 2^(s+w) words or bytes Block size = line size = 2^w words or bytes Number of blocks in main memory = 2^(s+ w)/2^w = 2^s Number of lines in cache = undetermined Size of tag = s bits
  • 17. SET ASSOCIATIVE MAPPING  The relationship which is followed here is m= v*k i= j modulo v Where , i= cache set no. j= main memory m= no. of lines in the cache v= no. of set k= no. of lines in each set This is called k-way set associative mapping .
  • 18.
  • 19. Address length = (s + w) bits Number of addressable units = 2s+w words or bytes Block size = line size = 2^w words or bytes Number of blocks in main memory = 2^s Number of lines in set = k Number of sets = v = 2d Number of lines in cache = kv = k * 2d Size of tag = (s – d) bits
  • 20. Replacement algorithms Discard itemsAdd new ones Cache Memory Cache Full…
  • 21. Replacement algorithms  Optimizing instructions.  To manage cache information on computer.  In direct mapping. Each block only maps to one cache block .  Associative and set associative mapping.
  • 22.  Least recently used(LRU)  First in first out(FIFO)  Least frequently used(LFU)  Random Replacement algorithms
  • 23. Least Recently used  The most effective.  Keeps track of which block used when.  Discards the least recently used blocks first. USE bit 0 USE bit 1
  • 24. 2 3 4 2 1 3 7 1 2 3 4 5 6 7 2 2 2 2 2 2 7 3 3 3 1 1 1 4 4 4 3 3 EXAMPLE Page hit 1 Page fault 3 7
  • 25. First In First Out  The simplest algorithm.  Bad performance.  First entering block, is discarded first.  Replaces the block that has been in cache the longest.
  • 26. 2 3 4 2 1 3 7 1 2 3 4 5 6 7 2 2 2 2 1 1 1 3 3 3 3 3 3 4 4 4 4 7 EXAMPLE Page hit Page hit 1 7 Page fault
  • 27. Least Frequently Used  Counts how often a block is needed.  Every block has one counter of its own which is initially set to 0.  As the block is referenced, the counter is incremented.  Replaces the lowest reference frequency block.
  • 28. 2 3 4 2 1 3 7 1 2 3 4 5 6 7 2 2 2 2 2 2 2 3 3 3 3 1 1 4 4 4 4 3 EXAMPLE Page hit 1 7 Page fault I I I II I I I 3
  • 29. Random  Randomly selects a block.  Discards it to make space.  Does not keep track of access history.  This eliminates the overhead cost of tracking page references.

Editor's Notes

  1. The CPU initially looks in the Cache for the data it needs If the data is there, it will retrieve it and process it If the data is not there, then the CPU accesses the system memory and then puts a copy of the new data in the cache before processing it Next time if the CPU needs to access the same data again, it will just retrieve the data from the Cache instead of going through the whole loading process again The legit question of Why use Cache when we have RAM?
  2. Each line is assigned a USE bit .It is changed to 1 when a line is referenced.