SlideShare a Scribd company logo
Associative Memory and set-
associative memory mapping
Ms. Snehalata Agasti
CSE department
Fully-Associative Mapping
 In direct mapping, though cache memory block is vacant still conflict misses
occurs.
 To overcome this problem Tag bit and cache-offset field is combined.
 So main memory block can be stored anywhere.
 Physical address is divided into two parts.
 Word-offset
 Tag
Tag Word-offset
Problem using filly-associative mapping
 Cache memory size= 64KB
Block size= 32B
Number of bits given for main memory addressing= 32
Find number of bits required for tag and word-offset?
 Solution: -
Block size=32B
Block offset= log225=5
Tag= 32-5=27
Tag = 27 Word-offset = 5
32
Set-associative Mapping
Draw back in direct mapping:-
 Compulsory miss occurs.
 conflict miss occurs.
 Cache memory could not be used effectively.
Draw back in fully-associative mapping:-
 Compulsory miss occurs.
 Capacity miss occurs.
 To over come the loopholes present in both mapping Set-associative mapping
technique is used.
Contd…
 Cache lines are grouped into sets.
 Particular block of main memory is mapped to particular set of cache lines.
 Within the set, block can be mapped to the free cache lines.
 To find the set number :-
set number= main memory block number % Number of sets in cache.
 Physical address is divided into three parts.
 Block-offset
 Set-offset
 Tag
Tag Set-offset Block-offset
Problem using set-associative mapping
 Cache memory size=64KB
Main memory size=4GB
Block size=32B , 4-way associative
Find tag, set-offset and word-offset?
 Solution:- Number of blocks in cache = size of cache memory / Block size
=64KB / 32B = 2KB =21 x 210 =211
Number of sets in cache = no of blocks in cache / associativity
= 2KB/4 = 211 / 24 = 29
Set offset = log229 =9
Contd…
Block size =32B
Number of bits required for word offset= log225=5
Size of main memory =4GB= 22 x 230 = 232
Number of bits required for memory addressing
= log2232 =32
Tag = 32-(set-offset + word-offset)
= 32 – (9+5) =18
Tag=18 Set-offset=9 Block-offset=5
Tag-directory size computation
 Tag-directory size = Tag x number of blocks
=18 x 211
= 36 x 210
= 36B
 Tag-directory size= (tag + number of extra bits given) x (number of blocks)
 [if in question it is given that number of dirty_bits=1 and number of modified
bit =2]
 Tag-directory size = (18 + 1+ 2) x 211
= 21 x211
= 42 x 2 10
= 42KB
Associative memory and set associative memory mapping
Ad

More Related Content

What's hot (20)

Inter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.pptInter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.ppt
NitihyaAshwinC
 
Memory management
Memory managementMemory management
Memory management
Muhammad Fayyaz
 
Mapping
MappingMapping
Mapping
Syed Ali Sherazi
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
Priyanka bisht
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
Dr. Jasmine Beulah Gnanadurai
 
instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
sheetal singh
 
CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...
Guru Nanak Technical Institutions
 
File organization
File organizationFile organization
File organization
KanchanPatil34
 
Basic blocks and control flow graphs
Basic blocks and control flow graphsBasic blocks and control flow graphs
Basic blocks and control flow graphs
Tilakpoudel2
 
Memory mapping
Memory mappingMemory mapping
Memory mapping
SnehalataAgasti
 
Code generation
Code generationCode generation
Code generation
Aparna Nayak
 
Cache mapping exercises
Cache mapping exercisesCache mapping exercises
Cache mapping exercises
sawsan slii
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
MOHIT DADU
 
Cache coherence ppt
Cache coherence pptCache coherence ppt
Cache coherence ppt
ArendraSingh2
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
Viji B
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Rabin BK
 
Memory management
Memory managementMemory management
Memory management
CHANDERPRABHU JAIN COLLEGE OF HIGHER STUDIES & SCHOOL OF LAW
 
Unit 4-input-output organization
Unit 4-input-output organizationUnit 4-input-output organization
Unit 4-input-output organization
vishal choudhary
 
Inter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.pptInter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.ppt
NitihyaAshwinC
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
Priyanka bisht
 
instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
sheetal singh
 
CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...
Guru Nanak Technical Institutions
 
Basic blocks and control flow graphs
Basic blocks and control flow graphsBasic blocks and control flow graphs
Basic blocks and control flow graphs
Tilakpoudel2
 
Cache mapping exercises
Cache mapping exercisesCache mapping exercises
Cache mapping exercises
sawsan slii
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
MOHIT DADU
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
Viji B
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Rabin BK
 
Unit 4-input-output organization
Unit 4-input-output organizationUnit 4-input-output organization
Unit 4-input-output organization
vishal choudhary
 

Similar to Associative memory and set associative memory mapping (20)

Cache recap
Cache recapCache recap
Cache recap
Young Alista
 
Cache recap
Cache recapCache recap
Cache recap
James Wong
 
Cache recap
Cache recapCache recap
Cache recap
Luis Goldster
 
Cache recap
Cache recapCache recap
Cache recap
Harry Potter
 
Cache recap
Cache recapCache recap
Cache recap
Hoang Nguyen
 
Cache recap
Cache recapCache recap
Cache recap
Fraboni Ec
 
Cache recap
Cache recapCache recap
Cache recap
Tony Nguyen
 
Memory mapping techniques and low power memory design
Memory mapping techniques and low power memory designMemory mapping techniques and low power memory design
Memory mapping techniques and low power memory design
UET Taxila
 
Cache memory
Cache memoryCache memory
Cache memory
Anand Goyal
 
Cache memory
Cache  memoryCache  memory
Cache memory
Prasenjit Dey
 
Address mapping
Address mappingAddress mapping
Address mapping
rockymani
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
abcxyz19691969
 
Lecture 6 - Address Mapping & Replacement.pptx
Lecture 6 - Address Mapping & Replacement.pptxLecture 6 - Address Mapping & Replacement.pptx
Lecture 6 - Address Mapping & Replacement.pptx
ChintuKashyap
 
C++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With AllocatorsC++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With Allocators
GlobalLogic Ukraine
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
Berkay TURAN
 
CACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITSCACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITS
AnkitPandey440
 
memory management powerpoint presentation
memory management powerpoint presentationmemory management powerpoint presentation
memory management powerpoint presentation
Nune SrinivasRao
 
memory.ppt
memory.pptmemory.ppt
memory.ppt
RohitPaul71
 
memory.ppt
memory.pptmemory.ppt
memory.ppt
ibmlenovo2021
 
12 memory hierarchy
12 memory hierarchy12 memory hierarchy
12 memory hierarchy
Abhijit Gaikwad
 
Memory mapping techniques and low power memory design
Memory mapping techniques and low power memory designMemory mapping techniques and low power memory design
Memory mapping techniques and low power memory design
UET Taxila
 
Address mapping
Address mappingAddress mapping
Address mapping
rockymani
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
abcxyz19691969
 
Lecture 6 - Address Mapping & Replacement.pptx
Lecture 6 - Address Mapping & Replacement.pptxLecture 6 - Address Mapping & Replacement.pptx
Lecture 6 - Address Mapping & Replacement.pptx
ChintuKashyap
 
C++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With AllocatorsC++ Advanced Memory Management With Allocators
C++ Advanced Memory Management With Allocators
GlobalLogic Ukraine
 
CACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITSCACHEMAPPING POLICIE AND MERITS & DEMERITS
CACHEMAPPING POLICIE AND MERITS & DEMERITS
AnkitPandey440
 
memory management powerpoint presentation
memory management powerpoint presentationmemory management powerpoint presentation
memory management powerpoint presentation
Nune SrinivasRao
 
Ad

More from SnehalataAgasti (6)

Hazards in pipeline
Hazards in pipelineHazards in pipeline
Hazards in pipeline
SnehalataAgasti
 
Cache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniquesCache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniques
SnehalataAgasti
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
SnehalataAgasti
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
SnehalataAgasti
 
BOOTH Algorithm for Multiplication
BOOTH Algorithm for MultiplicationBOOTH Algorithm for Multiplication
BOOTH Algorithm for Multiplication
SnehalataAgasti
 
Division algorithm
Division algorithmDivision algorithm
Division algorithm
SnehalataAgasti
 
Cache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniquesCache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniques
SnehalataAgasti
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
SnehalataAgasti
 
BOOTH Algorithm for Multiplication
BOOTH Algorithm for MultiplicationBOOTH Algorithm for Multiplication
BOOTH Algorithm for Multiplication
SnehalataAgasti
 
Ad

Recently uploaded (20)

Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
How to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdfHow to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdf
jamedlimmk
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Understanding Structural Loads and Load Paths
Understanding Structural Loads and Load PathsUnderstanding Structural Loads and Load Paths
Understanding Structural Loads and Load Paths
University of Kirkuk
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Redirects Unraveled: From Lost Links to Rickrolls
Redirects Unraveled: From Lost Links to RickrollsRedirects Unraveled: From Lost Links to Rickrolls
Redirects Unraveled: From Lost Links to Rickrolls
Kritika Garg
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Novel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth ControlNovel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth Control
Chris Harding
 
Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1
remoteaimms
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning ModelsMode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Mode-Wise Corridor Level Travel-Time Estimation Using Machine Learning Models
Journal of Soft Computing in Civil Engineering
 
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
How to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdfHow to Buy Snapchat Account A Step-by-Step Guide.pdf
How to Buy Snapchat Account A Step-by-Step Guide.pdf
jamedlimmk
 
Understanding Structural Loads and Load Paths
Understanding Structural Loads and Load PathsUnderstanding Structural Loads and Load Paths
Understanding Structural Loads and Load Paths
University of Kirkuk
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Redirects Unraveled: From Lost Links to Rickrolls
Redirects Unraveled: From Lost Links to RickrollsRedirects Unraveled: From Lost Links to Rickrolls
Redirects Unraveled: From Lost Links to Rickrolls
Kritika Garg
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Novel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth ControlNovel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth Control
Chris Harding
 
Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1Computer Security Fundamentals Chapter 1
Computer Security Fundamentals Chapter 1
remoteaimms
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 

Associative memory and set associative memory mapping

  • 1. Associative Memory and set- associative memory mapping Ms. Snehalata Agasti CSE department
  • 2. Fully-Associative Mapping  In direct mapping, though cache memory block is vacant still conflict misses occurs.  To overcome this problem Tag bit and cache-offset field is combined.  So main memory block can be stored anywhere.  Physical address is divided into two parts.  Word-offset  Tag Tag Word-offset
  • 3. Problem using filly-associative mapping  Cache memory size= 64KB Block size= 32B Number of bits given for main memory addressing= 32 Find number of bits required for tag and word-offset?  Solution: - Block size=32B Block offset= log225=5 Tag= 32-5=27 Tag = 27 Word-offset = 5 32
  • 4. Set-associative Mapping Draw back in direct mapping:-  Compulsory miss occurs.  conflict miss occurs.  Cache memory could not be used effectively. Draw back in fully-associative mapping:-  Compulsory miss occurs.  Capacity miss occurs.  To over come the loopholes present in both mapping Set-associative mapping technique is used.
  • 5. Contd…  Cache lines are grouped into sets.  Particular block of main memory is mapped to particular set of cache lines.  Within the set, block can be mapped to the free cache lines.  To find the set number :- set number= main memory block number % Number of sets in cache.  Physical address is divided into three parts.  Block-offset  Set-offset  Tag Tag Set-offset Block-offset
  • 6. Problem using set-associative mapping  Cache memory size=64KB Main memory size=4GB Block size=32B , 4-way associative Find tag, set-offset and word-offset?  Solution:- Number of blocks in cache = size of cache memory / Block size =64KB / 32B = 2KB =21 x 210 =211 Number of sets in cache = no of blocks in cache / associativity = 2KB/4 = 211 / 24 = 29 Set offset = log229 =9
  • 7. Contd… Block size =32B Number of bits required for word offset= log225=5 Size of main memory =4GB= 22 x 230 = 232 Number of bits required for memory addressing = log2232 =32 Tag = 32-(set-offset + word-offset) = 32 – (9+5) =18 Tag=18 Set-offset=9 Block-offset=5
  • 8. Tag-directory size computation  Tag-directory size = Tag x number of blocks =18 x 211 = 36 x 210 = 36B  Tag-directory size= (tag + number of extra bits given) x (number of blocks)  [if in question it is given that number of dirty_bits=1 and number of modified bit =2]  Tag-directory size = (18 + 1+ 2) x 211 = 21 x211 = 42 x 2 10 = 42KB
  翻译: