SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Was ist angesagt?

Memory organization
Memory organizationMemory organization
Memory organizationDhaval Bagal
 
Cache Memory
Cache MemoryCache Memory
Cache Memory sathish sak
 
cache memory
 cache memory cache memory
cache memoryNAHID HASAN
 
Linux Kernel Cryptographic API and Use Cases
Linux Kernel Cryptographic API and Use CasesLinux Kernel Cryptographic API and Use Cases
Linux Kernel Cryptographic API and Use CasesKernel TLV
 
08 virtual memory
08 virtual memory08 virtual memory
08 virtual memoryKamal Singh
 
40 demand paging
40 demand paging40 demand paging
40 demand pagingmyrajendra
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control UnitKamal Acharya
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniquespusp220
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache designRohail Butt
 
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC 02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC IEEE SSCS AlexSC
 
Chapter 1 - introduction - parallel computing
Chapter  1 - introduction - parallel computingChapter  1 - introduction - parallel computing
Chapter 1 - introduction - parallel computingHeman Pathak
 
Storage Area Networks Unit 3 Notes
Storage Area Networks Unit 3 NotesStorage Area Networks Unit 3 Notes
Storage Area Networks Unit 3 NotesSudarshan Dhondaley
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memoryDeepak John
 
Cache coherence
Cache coherenceCache coherence
Cache coherencePriyam Pandey
 
Memory Organization
Memory OrganizationMemory Organization
Memory OrganizationKamal Acharya
 
Associative memory
Associative memoryAssociative memory
Associative memoryNancyBeaulah_R
 
Shared Memory Multi Processor
Shared Memory Multi ProcessorShared Memory Multi Processor
Shared Memory Multi Processorbabuece
 
Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...
Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...
Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...VMware Tanzu
 

Was ist angesagt? (20)

Memory organization
Memory organizationMemory organization
Memory organization
 
Cache Memory
Cache MemoryCache Memory
Cache Memory
 
cache memory
 cache memory cache memory
cache memory
 
Linux Kernel Cryptographic API and Use Cases
Linux Kernel Cryptographic API and Use CasesLinux Kernel Cryptographic API and Use Cases
Linux Kernel Cryptographic API and Use Cases
 
08 virtual memory
08 virtual memory08 virtual memory
08 virtual memory
 
40 demand paging
40 demand paging40 demand paging
40 demand paging
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control Unit
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
 
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC 02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
02 : ARM Cortex M4 Specs || IEEE SSCS AlexSC
 
Chapter 1 - introduction - parallel computing
Chapter  1 - introduction - parallel computingChapter  1 - introduction - parallel computing
Chapter 1 - introduction - parallel computing
 
Cache memory
Cache memoryCache memory
Cache memory
 
Storage Area Networks Unit 3 Notes
Storage Area Networks Unit 3 NotesStorage Area Networks Unit 3 Notes
Storage Area Networks Unit 3 Notes
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memory
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Storage
StorageStorage
Storage
 
Associative memory
Associative memoryAssociative memory
Associative memory
 
Shared Memory Multi Processor
Shared Memory Multi ProcessorShared Memory Multi Processor
Shared Memory Multi Processor
 
Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...
Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...
Achieve Extreme Simplicity and Superior Price/Performance with Greenplum Buil...
 

Ă„hnlich wie 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 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
 
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
 
Memory allocation for real time operating system
Memory allocation for real time operating systemMemory allocation for real time operating system
Memory allocation for real time operating systemAsma'a Lafi
 
coa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxcoa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxRuhul Amin
 

Ă„hnlich wie 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
 
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
 
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
 
Memory allocation for real time operating system
Memory allocation for real time operating systemMemory allocation for real time operating system
Memory allocation for real time operating system
 
coa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxcoa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptx
 

Mehr von 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
 

Mehr von 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
 

KĂĽrzlich hochgeladen

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
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
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

KĂĽrzlich hochgeladen (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
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 🔝✔️✔️
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
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🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
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
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

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.