SlideShare a Scribd company logo
1 of 14
Cache
Memory
Cache Memory is a special very high-speed memory.
The cache is a smaller and faster memory that stores copies of the data
from frequently used main memory locations.
There are various different independent caches in a CPU, which store
instructions and data.
The most important use of cache memory is that it is used to reduce the
average time to access data from the main memory.
Cache Memory
Principles
Characteristics of Cache
Memory
•Cache memory is an extremely fast memory type that acts as a buffer between RAM
and the CPU.
•Cache Memory holds frequently requested data and instructions so that they are
immediately available to the CPU when needed.
•Cache memory is costlier than main memory or disk memory but more economical
than CPU registers.
•Cache Memory is used to speed up and synchronize with a high-speed CPU.
Levels of Memory
•Level 1 or Register: It is a type of memory in which data is stored and accepted
that are immediately stored in the CPU. The most commonly used register is
Accumulator, Program counter, Address Register, etc.
•Level 2 or Cache memory: It is the fastest memory that has faster access time
where data is temporarily stored for faster access.
•Level 3 or Main Memory: It is the memory on which the computer works
currently. It is small in size and once power is off data no longer stays in this memory.
•Level 4 or Secondary Memory: It is external memory that is not as fast as the
main memory but data stays permanently in this memory.
Cache Performance
When the processor needs to read or write a location in the main memory, it first
checks for a corresponding entry in the cache.
•If the processor finds that the memory location is in the cache, a Cache Hit has
occurred and data is read from the cache.
•If the processor does not find the memory location in the cache, a cache miss has
occurred. For a cache miss, the cache allocates a new entry and copies in data from the
main memory, then the request is fulfilled from the contents of the cache.
The performance of cache memory is frequently measured in terms of a quantity
called Hit ratio.
Cache Performance
Hit Ratio(H) = hit / (hit + miss) = no. of hits/total accesses Miss
Ratio = miss / (hit + miss) = no. of miss/total accesses = 1 - hit ratio(H)
We can improve Cache performance using higher cache block size, and higher associativity, reduce miss
rate, reduce miss penalty, and reduce the time to hit in the cache.
Elements Of Cache Design
There are a few basic design elements that serve to classify and differentiate cache architectures. They
are listed down:
1.Cache Addresses
2.Cache Size
3.Mapping Function
4.Replacement Algorithm
5.Write Policy
6.Line Size
7.Number of caches
1-Cache Addresses
When virtual addresses are used, the cache can be placed between the processor and
the MMU or between the MMU and main memory.
A logical cache, also known as a virtual cache, stores data using virtual addresses. The
processor accesses the cache directly, without going through the MMU.
2-Cache Size
The size of the cache should be small enough so that the overall average cost per bit is
close to that
of main memory alone and large enough so that the overall average access time is
close to that of
the cache alone.
3-Mapping Function:
As there are fewer cache lines than main memory blocks, an algorithm is needed for
mapping main memory blocks into cache lines. Further, a means is needed for
determining which main memory block currently occupies a cache line. The choice of
the mapping function dictates how the cache is organized. Three techniques can be
used: direct, associative, and set associative.
•DIRECT MAPPING: The simplest technique, known as direct mapping, maps each
block of main memory into only one possible cache line.
•The direct mapping technique is simple and inexpensive to implement.
•ASSOCIATIVE MAPPING: Associative mapping overcomes the disadvantage of
direct mapping by permitting each main memory block to be loaded into any line of
the cache
•SET-ASSOCIATIVE MAPPING: Set-associative mapping is a compromise that
exhibits the strengths of both the direct and associative approaches. With set-
4-Replacement Algorithms:
Once the cache has been filled, when a new block is brought into the cache, one of the
existing blocks must be replaced.
For direct mapping, there is only one possible line for any particular block, and no
choice is possible.
For the associative and set associative techniques, a replacement algorithm is needed.
To achieve high speed, such an algorithm must be implemented in hardware.
Least Recently Used (LRU), Least Frequently Used(LFU), First In First Out (FIFO) are
some replacement algorithms.
5-Write Policy
•When a block that is resident in the cache is to be replaced, there are two cases to
consider. If the old block in the cache has not been altered, then it may be overwritten
with a new block without first writing out the old block.
•If at least one write operation has been performed on a word in that line of the cache,
then main memory must be updated by writing the line of cache out to the block of
memory before bringing in the new block.
•The simplest policy is called write through. Using this technique, all write operations are
made to main memory as well as to the cache, ensuring that main memory is always valid.
•An alternative technique, known as write back, minimizes memory writes. With write back,
updates are made only in the cache.
•When an update occurs, a dirty bit, or use bit, associated with the line is set. Then, when a
block is replaced, it is written back to main memory if and only if the dirty bit is set.
6-Line Size
•Another design element is the line size. When a block of data is retrieved and placed
in the cache, not only the desired word but also some number of adjacent words is
retrieved. Basically, as the block size increases, more useful data are brought into the
cache. The hit ratio will begin to decrease, however, as the block becomes even bigger
and the probability of using the newly fetched information becomes less than the
probability of reusing the information that has to be replaced.
•The relationship between block size and hit ratio is complex, depending on the
locality characteristics of a particular program, and no definitive optimum value is
found as of yet.
7-Number of Caches
When caches were originally introduced, the typical system had a single cache. More
recently, the use of multiple caches has become an important aspect. There are two
design issues surrounding number of caches.
•MULTILEVEL CACHES: Most contemporary designs include both on-chip and
external caches. The simplest such organization is known as a two-level cache, with the
internal cache designated as level 1 (L1) and the external cache designated as level 2
(L2). There can also be 3 or more levels of cache. This helps in reducing main memory
accesses.
•UNIFIED VERSUS SPLIT CACHES: Earlier on-chip cache designs consisted of a
single cache used to store references to both data and instructions. This is the unified
approach. More recently, it has become common to split the cache into two: one
dedicated to instructions and one dedicated to data. These two caches both exist at
the same level. This is the split cache. Using a unified cache or a split cache is another
design issue.

More Related Content

What's hot

Cache memory
Cache memoryCache memory
Cache memoryGanesh Rocky
 
Unit 4 memory system
Unit 4   memory systemUnit 4   memory system
Unit 4 memory systemchidabdu
 
Cache memory
Cache memoryCache memory
Cache memorychauhankapil
 
Csc1401 lecture05 - cache memory
Csc1401   lecture05 - cache memoryCsc1401   lecture05 - cache memory
Csc1401 lecture05 - cache memoryIIUM
 
Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architectureArpan Baishya
 
CACHE MEMORY
CACHE MEMORYCACHE MEMORY
CACHE MEMORYVENNILAV6
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208Ameer Mehmood
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementationkavitha2009
 
Memory map
Memory mapMemory map
Memory mapaviban
 
Cache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniquesCache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniquesSnehalataAgasti
 
Cache memory
Cache memory Cache memory
Cache memory Zalal Udeen
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache designRohail Butt
 
Lecture 6.1
Lecture  6.1Lecture  6.1
Lecture 6.1Mr SMAK
 
Cache coherence
Cache coherenceCache coherence
Cache coherenceEmployee
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architectureMaulik Togadiya
 
File replication
File replicationFile replication
File replicationKlawal13
 

What's hot (20)

Cache memory
Cache memoryCache memory
Cache memory
 
Unit 4 memory system
Unit 4   memory systemUnit 4   memory system
Unit 4 memory system
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Csc1401 lecture05 - cache memory
Csc1401   lecture05 - cache memoryCsc1401   lecture05 - cache memory
Csc1401 lecture05 - cache memory
 
Multiprocessor architecture
Multiprocessor architectureMultiprocessor architecture
Multiprocessor architecture
 
CACHE MEMORY
CACHE MEMORYCACHE MEMORY
CACHE MEMORY
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208
 
Basic MIPS implementation
Basic MIPS implementationBasic MIPS implementation
Basic MIPS implementation
 
Memory map
Memory mapMemory map
Memory map
 
Cache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniquesCache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniques
 
Cache memory
Cache memory Cache memory
Cache memory
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
 
Lecture 6.1
Lecture  6.1Lecture  6.1
Lecture 6.1
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
 
File replication
File replicationFile replication
File replication
 

Similar to Cache Memory.pptx

Cache Memory
Cache MemoryCache Memory
Cache MemorySubid Biswas
 
cachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfcachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfOmGadekar2
 
Cache simulator
Cache simulatorCache simulator
Cache simulatorSuraj Saini
 
cache memory and types of cache memory,
cache memory  and types of cache memory,cache memory  and types of cache memory,
cache memory and types of cache memory,ashima967262
 
Introduction to memory management
Introduction to memory managementIntroduction to memory management
Introduction to memory managementSweety Singhal
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 
lecture-2-3_Memory.pdf,describing memory
lecture-2-3_Memory.pdf,describing memorylecture-2-3_Memory.pdf,describing memory
lecture-2-3_Memory.pdf,describing memoryfloraaluoch3
 
UNIT IV.pptx
UNIT IV.pptxUNIT IV.pptx
UNIT IV.pptxYogapriyaJ1
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache frameworkMohammed Fazuluddin
 
Cache memory and virtual memory
Cache memory and virtual memoryCache memory and virtual memory
Cache memory and virtual memoryPrakharBansal29
 
Auxiliary, Cache and Virtual memory.pptx
Auxiliary, Cache and Virtual memory.pptxAuxiliary, Cache and Virtual memory.pptx
Auxiliary, Cache and Virtual memory.pptxRamakrishna Reddy Bijjam
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeLalfakawmaKh
 
Computer System Architecture Lecture Note 8.2 Cache Memory
Computer System Architecture Lecture Note 8.2 Cache MemoryComputer System Architecture Lecture Note 8.2 Cache Memory
Computer System Architecture Lecture Note 8.2 Cache MemoryBudditha Hettige
 
computer architecture and organisation
computer architecture and organisationcomputer architecture and organisation
computer architecture and organisationRamjiChaurasiya
 

Similar to Cache Memory.pptx (20)

Cache Memory
Cache MemoryCache Memory
Cache Memory
 
cachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfcachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdf
 
Cache simulator
Cache simulatorCache simulator
Cache simulator
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
cache memory and types of cache memory,
cache memory  and types of cache memory,cache memory  and types of cache memory,
cache memory and types of cache memory,
 
Introduction to memory management
Introduction to memory managementIntroduction to memory management
Introduction to memory management
 
COA notes
COA notesCOA notes
COA notes
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 
lecture-2-3_Memory.pdf,describing memory
lecture-2-3_Memory.pdf,describing memorylecture-2-3_Memory.pdf,describing memory
lecture-2-3_Memory.pdf,describing memory
 
UNIT IV.pptx
UNIT IV.pptxUNIT IV.pptx
UNIT IV.pptx
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache framework
 
Cache memory and virtual memory
Cache memory and virtual memoryCache memory and virtual memory
Cache memory and virtual memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Auxiliary, Cache and Virtual memory.pptx
Auxiliary, Cache and Virtual memory.pptxAuxiliary, Cache and Virtual memory.pptx
Auxiliary, Cache and Virtual memory.pptx
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Advanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and TypeAdvanced computer architechture -Memory Hierarchies and its Properties and Type
Advanced computer architechture -Memory Hierarchies and its Properties and Type
 
Computer System Architecture Lecture Note 8.2 Cache Memory
Computer System Architecture Lecture Note 8.2 Cache MemoryComputer System Architecture Lecture Note 8.2 Cache Memory
Computer System Architecture Lecture Note 8.2 Cache Memory
 
computer architecture and organisation
computer architecture and organisationcomputer architecture and organisation
computer architecture and organisation
 

More from ssusere16bd9

OSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).pptOSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).pptssusere16bd9
 
OSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptxOSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptxssusere16bd9
 
Agents and environment.pptx
Agents and environment.pptxAgents and environment.pptx
Agents and environment.pptxssusere16bd9
 
Data Communication-1.ppt
Data Communication-1.pptData Communication-1.ppt
Data Communication-1.pptssusere16bd9
 
COMPUTER ARCHITECTURE-2.pptx
COMPUTER ARCHITECTURE-2.pptxCOMPUTER ARCHITECTURE-2.pptx
COMPUTER ARCHITECTURE-2.pptxssusere16bd9
 
jyatesproject4-111025223823-phpapp02.pptx
jyatesproject4-111025223823-phpapp02.pptxjyatesproject4-111025223823-phpapp02.pptx
jyatesproject4-111025223823-phpapp02.pptxssusere16bd9
 
What is SRS & REP.pptx
What is SRS & REP.pptxWhat is SRS & REP.pptx
What is SRS & REP.pptxssusere16bd9
 
semantic web.pptx
semantic web.pptxsemantic web.pptx
semantic web.pptxssusere16bd9
 
business communication.pptx
business communication.pptxbusiness communication.pptx
business communication.pptxssusere16bd9
 
xml and xhtml.pptx
xml and xhtml.pptxxml and xhtml.pptx
xml and xhtml.pptxssusere16bd9
 
cloudcomputing5-141224231751-conversion-gate02-1.pptx
cloudcomputing5-141224231751-conversion-gate02-1.pptxcloudcomputing5-141224231751-conversion-gate02-1.pptx
cloudcomputing5-141224231751-conversion-gate02-1.pptxssusere16bd9
 
presentation.pptx
presentation.pptxpresentation.pptx
presentation.pptxssusere16bd9
 
SE PRESENTATION (1).pptx
SE PRESENTATION (1).pptxSE PRESENTATION (1).pptx
SE PRESENTATION (1).pptxssusere16bd9
 
What is SRS & REP.pptx
What is SRS & REP.pptxWhat is SRS & REP.pptx
What is SRS & REP.pptxssusere16bd9
 
How social Norms is Understood as Deviant Behavior-rauf.pptx
How social Norms is Understood as Deviant Behavior-rauf.pptxHow social Norms is Understood as Deviant Behavior-rauf.pptx
How social Norms is Understood as Deviant Behavior-rauf.pptxssusere16bd9
 
SE Lecture 1.ppt
SE Lecture 1.pptSE Lecture 1.ppt
SE Lecture 1.pptssusere16bd9
 
SE Lecture 2.ppt
SE Lecture 2.pptSE Lecture 2.ppt
SE Lecture 2.pptssusere16bd9
 
SE Lecture 1.ppt
SE Lecture 1.pptSE Lecture 1.ppt
SE Lecture 1.pptssusere16bd9
 
SE Lecture 3.ppt
SE Lecture 3.pptSE Lecture 3.ppt
SE Lecture 3.pptssusere16bd9
 

More from ssusere16bd9 (20)

OSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).pptOSLec 4& 5(Processesinoperatingsystem).ppt
OSLec 4& 5(Processesinoperatingsystem).ppt
 
OSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptxOSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptx
 
Agents and environment.pptx
Agents and environment.pptxAgents and environment.pptx
Agents and environment.pptx
 
Data Communication-1.ppt
Data Communication-1.pptData Communication-1.ppt
Data Communication-1.ppt
 
COMPUTER ARCHITECTURE-2.pptx
COMPUTER ARCHITECTURE-2.pptxCOMPUTER ARCHITECTURE-2.pptx
COMPUTER ARCHITECTURE-2.pptx
 
jyatesproject4-111025223823-phpapp02.pptx
jyatesproject4-111025223823-phpapp02.pptxjyatesproject4-111025223823-phpapp02.pptx
jyatesproject4-111025223823-phpapp02.pptx
 
What is SRS & REP.pptx
What is SRS & REP.pptxWhat is SRS & REP.pptx
What is SRS & REP.pptx
 
semantic web.pptx
semantic web.pptxsemantic web.pptx
semantic web.pptx
 
business communication.pptx
business communication.pptxbusiness communication.pptx
business communication.pptx
 
xml and xhtml.pptx
xml and xhtml.pptxxml and xhtml.pptx
xml and xhtml.pptx
 
cloudcomputing5-141224231751-conversion-gate02-1.pptx
cloudcomputing5-141224231751-conversion-gate02-1.pptxcloudcomputing5-141224231751-conversion-gate02-1.pptx
cloudcomputing5-141224231751-conversion-gate02-1.pptx
 
presentation.pptx
presentation.pptxpresentation.pptx
presentation.pptx
 
SE PRESENTATION (1).pptx
SE PRESENTATION (1).pptxSE PRESENTATION (1).pptx
SE PRESENTATION (1).pptx
 
CBSE.pptx
CBSE.pptxCBSE.pptx
CBSE.pptx
 
What is SRS & REP.pptx
What is SRS & REP.pptxWhat is SRS & REP.pptx
What is SRS & REP.pptx
 
How social Norms is Understood as Deviant Behavior-rauf.pptx
How social Norms is Understood as Deviant Behavior-rauf.pptxHow social Norms is Understood as Deviant Behavior-rauf.pptx
How social Norms is Understood as Deviant Behavior-rauf.pptx
 
SE Lecture 1.ppt
SE Lecture 1.pptSE Lecture 1.ppt
SE Lecture 1.ppt
 
SE Lecture 2.ppt
SE Lecture 2.pptSE Lecture 2.ppt
SE Lecture 2.ppt
 
SE Lecture 1.ppt
SE Lecture 1.pptSE Lecture 1.ppt
SE Lecture 1.ppt
 
SE Lecture 3.ppt
SE Lecture 3.pptSE Lecture 3.ppt
SE Lecture 3.ppt
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 

Cache Memory.pptx

  • 2. Cache Memory is a special very high-speed memory. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various different independent caches in a CPU, which store instructions and data. The most important use of cache memory is that it is used to reduce the average time to access data from the main memory. Cache Memory Principles
  • 3. Characteristics of Cache Memory •Cache memory is an extremely fast memory type that acts as a buffer between RAM and the CPU. •Cache Memory holds frequently requested data and instructions so that they are immediately available to the CPU when needed. •Cache memory is costlier than main memory or disk memory but more economical than CPU registers. •Cache Memory is used to speed up and synchronize with a high-speed CPU.
  • 4. Levels of Memory •Level 1 or Register: It is a type of memory in which data is stored and accepted that are immediately stored in the CPU. The most commonly used register is Accumulator, Program counter, Address Register, etc. •Level 2 or Cache memory: It is the fastest memory that has faster access time where data is temporarily stored for faster access. •Level 3 or Main Memory: It is the memory on which the computer works currently. It is small in size and once power is off data no longer stays in this memory. •Level 4 or Secondary Memory: It is external memory that is not as fast as the main memory but data stays permanently in this memory.
  • 5. Cache Performance When the processor needs to read or write a location in the main memory, it first checks for a corresponding entry in the cache. •If the processor finds that the memory location is in the cache, a Cache Hit has occurred and data is read from the cache. •If the processor does not find the memory location in the cache, a cache miss has occurred. For a cache miss, the cache allocates a new entry and copies in data from the main memory, then the request is fulfilled from the contents of the cache. The performance of cache memory is frequently measured in terms of a quantity called Hit ratio.
  • 6. Cache Performance Hit Ratio(H) = hit / (hit + miss) = no. of hits/total accesses Miss Ratio = miss / (hit + miss) = no. of miss/total accesses = 1 - hit ratio(H) We can improve Cache performance using higher cache block size, and higher associativity, reduce miss rate, reduce miss penalty, and reduce the time to hit in the cache.
  • 7. Elements Of Cache Design There are a few basic design elements that serve to classify and differentiate cache architectures. They are listed down: 1.Cache Addresses 2.Cache Size 3.Mapping Function 4.Replacement Algorithm 5.Write Policy 6.Line Size 7.Number of caches
  • 8. 1-Cache Addresses When virtual addresses are used, the cache can be placed between the processor and the MMU or between the MMU and main memory. A logical cache, also known as a virtual cache, stores data using virtual addresses. The processor accesses the cache directly, without going through the MMU.
  • 9. 2-Cache Size The size of the cache should be small enough so that the overall average cost per bit is close to that of main memory alone and large enough so that the overall average access time is close to that of the cache alone.
  • 10. 3-Mapping Function: As there are fewer cache lines than main memory blocks, an algorithm is needed for mapping main memory blocks into cache lines. Further, a means is needed for determining which main memory block currently occupies a cache line. The choice of the mapping function dictates how the cache is organized. Three techniques can be used: direct, associative, and set associative. •DIRECT MAPPING: The simplest technique, known as direct mapping, maps each block of main memory into only one possible cache line. •The direct mapping technique is simple and inexpensive to implement. •ASSOCIATIVE MAPPING: Associative mapping overcomes the disadvantage of direct mapping by permitting each main memory block to be loaded into any line of the cache •SET-ASSOCIATIVE MAPPING: Set-associative mapping is a compromise that exhibits the strengths of both the direct and associative approaches. With set-
  • 11. 4-Replacement Algorithms: Once the cache has been filled, when a new block is brought into the cache, one of the existing blocks must be replaced. For direct mapping, there is only one possible line for any particular block, and no choice is possible. For the associative and set associative techniques, a replacement algorithm is needed. To achieve high speed, such an algorithm must be implemented in hardware. Least Recently Used (LRU), Least Frequently Used(LFU), First In First Out (FIFO) are some replacement algorithms.
  • 12. 5-Write Policy •When a block that is resident in the cache is to be replaced, there are two cases to consider. If the old block in the cache has not been altered, then it may be overwritten with a new block without first writing out the old block. •If at least one write operation has been performed on a word in that line of the cache, then main memory must be updated by writing the line of cache out to the block of memory before bringing in the new block. •The simplest policy is called write through. Using this technique, all write operations are made to main memory as well as to the cache, ensuring that main memory is always valid. •An alternative technique, known as write back, minimizes memory writes. With write back, updates are made only in the cache. •When an update occurs, a dirty bit, or use bit, associated with the line is set. Then, when a block is replaced, it is written back to main memory if and only if the dirty bit is set.
  • 13. 6-Line Size •Another design element is the line size. When a block of data is retrieved and placed in the cache, not only the desired word but also some number of adjacent words is retrieved. Basically, as the block size increases, more useful data are brought into the cache. The hit ratio will begin to decrease, however, as the block becomes even bigger and the probability of using the newly fetched information becomes less than the probability of reusing the information that has to be replaced. •The relationship between block size and hit ratio is complex, depending on the locality characteristics of a particular program, and no definitive optimum value is found as of yet.
  • 14. 7-Number of Caches When caches were originally introduced, the typical system had a single cache. More recently, the use of multiple caches has become an important aspect. There are two design issues surrounding number of caches. •MULTILEVEL CACHES: Most contemporary designs include both on-chip and external caches. The simplest such organization is known as a two-level cache, with the internal cache designated as level 1 (L1) and the external cache designated as level 2 (L2). There can also be 3 or more levels of cache. This helps in reducing main memory accesses. •UNIFIED VERSUS SPLIT CACHES: Earlier on-chip cache designs consisted of a single cache used to store references to both data and instructions. This is the unified approach. More recently, it has become common to split the cache into two: one dedicated to instructions and one dedicated to data. These two caches both exist at the same level. This is the split cache. Using a unified cache or a split cache is another design issue.