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?

Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Gaditek
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqMohd Tariq
 
Unit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationUnit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationBalaji Vignesh
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memoryDeepak John
 
Multiprocessor
MultiprocessorMultiprocessor
MultiprocessorNeel Patel
 
04 cache memory.ppt 1
04 cache memory.ppt 104 cache memory.ppt 1
04 cache memory.ppt 1Anwal Mirza
 
Computer architecture cache memory
Computer architecture cache memoryComputer architecture cache memory
Computer architecture cache memoryMazin Alwaaly
 
Memory Organization | Computer Fundamental and Organization
Memory Organization | Computer Fundamental and OrganizationMemory Organization | Computer Fundamental and Organization
Memory Organization | Computer Fundamental and OrganizationSmit Luvani
 
Arithmatic pipline
Arithmatic piplineArithmatic pipline
Arithmatic piplineA. Shamel
 

Was ist angesagt? (20)

Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
 
Unit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationUnit IV Memory and I/O Organization
Unit IV Memory and I/O Organization
 
Computer organization memory
Computer organization memoryComputer organization memory
Computer organization memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Multiprocessor
MultiprocessorMultiprocessor
Multiprocessor
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
04 cache memory.ppt 1
04 cache memory.ppt 104 cache memory.ppt 1
04 cache memory.ppt 1
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer architecture cache memory
Computer architecture cache memoryComputer architecture cache memory
Computer architecture cache memory
 
Memory Organization | Computer Fundamental and Organization
Memory Organization | Computer Fundamental and OrganizationMemory Organization | Computer Fundamental and Organization
Memory Organization | Computer Fundamental and Organization
 
Mapping
MappingMapping
Mapping
 
Arithmatic pipline
Arithmatic piplineArithmatic pipline
Arithmatic pipline
 
Memory Addressing
Memory AddressingMemory Addressing
Memory Addressing
 
Distributed system
Distributed systemDistributed system
Distributed system
 

Ähnlich wie Cache Memory.pptx

cachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfcachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfOmGadekar2
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache designRohail Butt
 
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
 
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
 
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
 

Ä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
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
 
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
 

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

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

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
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
 
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
 

Kürzlich hochgeladen (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
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
 
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
 

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.