SlideShare a Scribd company logo
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 Memory
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.
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.
Cache 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.
• 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)
Cache Mapping
• There are three different types of mapping
used for the purpose of cache memory
which is as follows:
• Direct Mapping
• Associative Mapping
• Set-Associative Mapping
1. Direct Mapping
• The direct mapping technique is simple and inexpensive to
implement.
• When the CPU wants to access data from memory, it places
a address. The index field of CPU address is used to access
address.
• The tag field of CPU address is compared with the
associated tag in the word read from the cache.
• If the tag-bits of CPU address is matched with the tag-bits
of cache, then there is a hit and the required data word is
read from cache.
• If there is no match, then there is a miss and the required
data word is stored in main memory. It is then transferred
from main memory to cache memory with the new tag.
1. Direct Mapping
• Associative memories are expensive compared to random-
access memories because of the added logic associated with
each cell.
• Direct mapping uses a random-access memory for the cache.
• The CPU address of 15 bits is divided into two fields.
• The nine least significant bits constitute the index field and the
remaining six bits form the tag field.
• The number of bits in the index field is equal to the number of
address bits required to access the cache memory.
• The n-bit memory address is divided into two fields:k bits for
the index field and n-k bits for the tag field.
• The direct mapping cache organization uses the n-bit address
to access the main memory and the k-bit index to access
cache.
1. Direct Mapping
1. Direct Mapping
2. Associative Mapping
● An associative mapping usesan associative
memory.
● Thismemoryisbeing accessed usingits contents.
● Each line of cache memory will accommodate
the address (main memory) and the contentsof
that addressfrom the main memory.
● That is why this memory is also called Content
Addressable Memory(CAM). It allowseachblock
of main memoryto be stored in the cache.
• The fastest and most flexible cache organization uses an
associative memory.
• The associative memory stores both the address and
content of the memory word.
• This permits any location in cache to store any word from
main memory.
• A CPU address of 15 bits is placed in the arguement
register and the associative memory is searched for a
matching address.
• If the address is found ,the corresponding 12 bit data is
read and sent to the CPU.
• If no match occurs, the main memory is accessed for the
word.The address-data pair is then transferred to the
associative cache memory.
• If the cache is full,an address-data pair must be displaced
to make room for a pair that is needed and not presently in
the cache.
• Different replacement algorithms like FIFO is used for
this.
2. Associative Mapping
3. Set Associative Mapping
● That is the easy control of the direct mapping
cache and the more flexible mapping of the fully
associative cache.
● In set associative mapping, each cache location
can have more than one pair of tag + data items.
● That is more than one pair of tag and data are
residing at the same location of cache memory. If
one cache location is holding two pair of tag + data
items, that is called 2-wayset associativemapping.
3. Set Associative Mapping
• Set-associative mapping is an improvement over the direct mapping
organization in that each word of cache can store two or more words
of memory under the same index address.
• Each data word is stored together with its tag and the number of tag-
data items in one word of cache is said to form a set.
• An example of a set - associative cache organization for a set size
of two is shown.
• Each index address refers to two data words and their associated
tags.
• When the CPU generates memory request,the index value of the
address is used to access the cache.
• The tag field of the CPU address is then compared with both tags in
the cache to determine if a match occurs.
• The comparison logic is done by an associative search of the tags in
the set similar to an associative memory search:thus the name "set-
associative".
3. Set Associative Mapping

More Related Content

Similar to Cache Memory.pptx

Cache.pptx
Cache.pptxCache.pptx
Cache.pptx
VCETCSE
 
Cache Memory
Cache MemoryCache Memory
Cache Memory
Subid Biswas
 
cachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfcachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdf
OmGadekar2
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
SnehalataAgasti
 
COA
COACOA
CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...
Asst.prof M.Gokilavani
 
coa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxcoa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptx
Ruhul Amin
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
Kamal Acharya
 
Memory Organization.pdf
Memory Organization.pdfMemory Organization.pdf
Memory Organization.pdf
AshishPandey502
 
Cache memory
Cache memoryCache memory
Cache memory
Ganesh Rocky
 
Computer organization memory hierarchy
Computer organization memory hierarchyComputer organization memory hierarchy
Computer organization memory hierarchy
AJAL A J
 
computer architecture and organisation
computer architecture and organisationcomputer architecture and organisation
computer architecture and organisation
RamjiChaurasiya
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
Rohail Butt
 
COA notes
COA notesCOA notes
COA notes
ShrutiKushwaha29
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
SandhyaTatekalva
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
Mohd Tariq
 
Memory organization
Memory organizationMemory organization
Memory organization
ishapadhy
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
rprajat007
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and Organization
Smit Luvani
 

Similar to Cache Memory.pptx (20)

Cache.pptx
Cache.pptxCache.pptx
Cache.pptx
 
Cache Memory
Cache MemoryCache Memory
Cache Memory
 
cachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdfcachememory-210517060741 (1).pdf
cachememory-210517060741 (1).pdf
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
 
COA
COACOA
COA
 
CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...CS304PC:Computer Organization and Architecture Session 29 Memory organization...
CS304PC:Computer Organization and Architecture Session 29 Memory organization...
 
coa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptxcoa-Unit5-ppt1 (1).pptx
coa-Unit5-ppt1 (1).pptx
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Memory Organization.pdf
Memory Organization.pdfMemory Organization.pdf
Memory Organization.pdf
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer organization memory hierarchy
Computer organization memory hierarchyComputer organization memory hierarchy
Computer organization memory hierarchy
 
computer architecture and organisation
computer architecture and organisationcomputer architecture and organisation
computer architecture and organisation
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
COA notes
COA notesCOA notes
COA notes
 
Os unit 3
Os unit 3Os unit 3
Os unit 3
 
Cache memoy designed by Mohd Tariq
Cache memoy designed by Mohd TariqCache memoy designed by Mohd Tariq
Cache memoy designed by Mohd Tariq
 
Memory organization
Memory organizationMemory organization
Memory organization
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Computer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and OrganizationComputer Architecture | Computer Fundamental and Organization
Computer Architecture | Computer Fundamental and Organization
 

More from AshokRachapalli1

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
AshokRachapalli1
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...
AshokRachapalli1
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
AshokRachapalli1
 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptx
AshokRachapalli1
 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptx
AshokRachapalli1
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
AshokRachapalli1
 
lec16-memory.ppt
lec16-memory.pptlec16-memory.ppt
lec16-memory.ppt
AshokRachapalli1
 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptx
AshokRachapalli1
 
instruction format.pptx
instruction format.pptxinstruction format.pptx
instruction format.pptx
AshokRachapalli1
 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptx
AshokRachapalli1
 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptx
AshokRachapalli1
 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptx
AshokRachapalli1
 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
AshokRachapalli1
 
intro22.ppt
intro22.pptintro22.ppt
intro22.ppt
AshokRachapalli1
 
switching.pptx
switching.pptxswitching.pptx
switching.pptx
AshokRachapalli1
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
AshokRachapalli1
 

More from AshokRachapalli1 (20)

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
 
joins in dbms its describes about how joins are important and necessity in d...
joins in dbms  its describes about how joins are important and necessity in d...joins in dbms  its describes about how joins are important and necessity in d...
joins in dbms its describes about how joins are important and necessity in d...
 
6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx6.Database Languages lab-1.pptx
6.Database Languages lab-1.pptx
 
Chapter5 (1).ppt
Chapter5 (1).pptChapter5 (1).ppt
Chapter5 (1).ppt
 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptx
 
inputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptxinputoutputorganization-140722085906-phpapp01.pptx
inputoutputorganization-140722085906-phpapp01.pptx
 
NOV11 virtual memory.ppt
NOV11 virtual memory.pptNOV11 virtual memory.ppt
NOV11 virtual memory.ppt
 
lec16-memory.ppt
lec16-memory.pptlec16-memory.ppt
lec16-memory.ppt
 
lecture-17.ppt
lecture-17.pptlecture-17.ppt
lecture-17.ppt
 
arithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptxarithmeticmicrooperations-180130061637.pptx
arithmeticmicrooperations-180130061637.pptx
 
instruction format.pptx
instruction format.pptxinstruction format.pptx
instruction format.pptx
 
Computer Network Architecture.pptx
Computer Network Architecture.pptxComputer Network Architecture.pptx
Computer Network Architecture.pptx
 
Computer Network Types.pptx
Computer Network Types.pptxComputer Network Types.pptx
Computer Network Types.pptx
 
dataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptxdataencoding-150701201133-lva1-app6891.pptx
dataencoding-150701201133-lva1-app6891.pptx
 
Flow Control.pptx
Flow Control.pptxFlow Control.pptx
Flow Control.pptx
 
Chapter4.ppt
Chapter4.pptChapter4.ppt
Chapter4.ppt
 
intro22.ppt
intro22.pptintro22.ppt
intro22.ppt
 
osi.ppt
osi.pptosi.ppt
osi.ppt
 
switching.pptx
switching.pptxswitching.pptx
switching.pptx
 
Computer Organization and Architecture.pptx
Computer Organization and Architecture.pptxComputer Organization and Architecture.pptx
Computer Organization and Architecture.pptx
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 

Cache Memory.pptx

  • 1. 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.
  • 2.
  • 4. 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.
  • 5. 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.
  • 7. 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. • 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)
  • 8. Cache Mapping • There are three different types of mapping used for the purpose of cache memory which is as follows: • Direct Mapping • Associative Mapping • Set-Associative Mapping
  • 9. 1. Direct Mapping • The direct mapping technique is simple and inexpensive to implement. • When the CPU wants to access data from memory, it places a address. The index field of CPU address is used to access address. • The tag field of CPU address is compared with the associated tag in the word read from the cache. • If the tag-bits of CPU address is matched with the tag-bits of cache, then there is a hit and the required data word is read from cache. • If there is no match, then there is a miss and the required data word is stored in main memory. It is then transferred from main memory to cache memory with the new tag.
  • 10. 1. Direct Mapping • Associative memories are expensive compared to random- access memories because of the added logic associated with each cell. • Direct mapping uses a random-access memory for the cache. • The CPU address of 15 bits is divided into two fields. • The nine least significant bits constitute the index field and the remaining six bits form the tag field. • The number of bits in the index field is equal to the number of address bits required to access the cache memory. • The n-bit memory address is divided into two fields:k bits for the index field and n-k bits for the tag field. • The direct mapping cache organization uses the n-bit address to access the main memory and the k-bit index to access cache.
  • 13. 2. Associative Mapping ● An associative mapping usesan associative memory. ● Thismemoryisbeing accessed usingits contents. ● Each line of cache memory will accommodate the address (main memory) and the contentsof that addressfrom the main memory. ● That is why this memory is also called Content Addressable Memory(CAM). It allowseachblock of main memoryto be stored in the cache.
  • 14. • The fastest and most flexible cache organization uses an associative memory. • The associative memory stores both the address and content of the memory word. • This permits any location in cache to store any word from main memory. • A CPU address of 15 bits is placed in the arguement register and the associative memory is searched for a matching address. • If the address is found ,the corresponding 12 bit data is read and sent to the CPU. • If no match occurs, the main memory is accessed for the word.The address-data pair is then transferred to the associative cache memory. • If the cache is full,an address-data pair must be displaced to make room for a pair that is needed and not presently in the cache. • Different replacement algorithms like FIFO is used for this.
  • 16. 3. Set Associative Mapping ● That is the easy control of the direct mapping cache and the more flexible mapping of the fully associative cache. ● In set associative mapping, each cache location can have more than one pair of tag + data items. ● That is more than one pair of tag and data are residing at the same location of cache memory. If one cache location is holding two pair of tag + data items, that is called 2-wayset associativemapping.
  • 17. 3. Set Associative Mapping • Set-associative mapping is an improvement over the direct mapping organization in that each word of cache can store two or more words of memory under the same index address. • Each data word is stored together with its tag and the number of tag- data items in one word of cache is said to form a set. • An example of a set - associative cache organization for a set size of two is shown. • Each index address refers to two data words and their associated tags. • When the CPU generates memory request,the index value of the address is used to access the cache. • The tag field of the CPU address is then compared with both tags in the cache to determine if a match occurs. • The comparison logic is done by an associative search of the tags in the set similar to an associative memory search:thus the name "set- associative".