SlideShare a Scribd company logo
Memory Organization 1 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Overview
 Memory Hierarchy
 Main Memory
 Auxiliary Memory
 Associative Memory
 Cache Memory
 Virtual Memory
 Memory Mgt Hardware
Memory Organization 2 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Cache Memory
Locality of Reference
- The references to memory at any given time interval tend to be confined
within a localized areas
- This area contains a set of information and the membership changes
gradually as time goes by
- Temporal Locality
The information which will be used in near future is likely to be in use
already( e.g. Reuse of information in loops)
- Spatial Locality
If a word is accessed, adjacent(near) words are likely accessed soon
(e.g. Related data items (arrays) are usually stored together;
instructions are executed sequentially)
Cache
- The property of Locality of Reference makes the cache memory systems work
- Cache is a fast small capacity memory that should hold those information
which are most likely to be accessed
Main memory
Cache memory
CPU
Memory Organization 3 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Performance of Cache
All the memory accesses are directed first to Cache
If the word is in Cache; Access cache to provide it to CPU
If the word is not in Cache; Bring a block (or a line) including
that word to replace a block now in Cache
- How can we know if the word that is required is there ?
- If a new block is to replace one of the old blocks, which one should we choose ?
Memory Access
Performance of Cache Memory System
Hit Ratio - % of memory accesses satisfied by Cache memory system
Te: Effective memory access time in Cache memory system
Tc: Cache access time
Tm: Main memory access time
Te = Tc + (1 - h) Tm
Example: Tc = 0.4 s, Tm = 1.2s, h = 0.85%
Te = 0.4 + (1 - 0.85) * 1.2 = 0.58s
Memory Organization 4 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Memory and Cache Mapping – (Associative Mapping)
Associative mapping
Direct mapping
Set-associative mappingAssociative Mapping
Mapping Function
Specification of correspondence between main memory blocks and cache blocks
- Any block location in Cache can store any block in memory
-> Most flexible
- Mapping Table is implemented in an associative memory
-> Fast, very Expensive
- Mapping Table
Stores both address and the content of the memory word
address (15 bits)
Argument register
Address Data
0 1 0 0 0
0 2 7 7 7
2 2 2 3 5
3 4 5 0
6 7 1 0
1 2 3 4
CAM
Memory Organization 5 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Cache Mapping – direct mapping
- Each memory block has only one place to load in Cache
- Mapping Table is made of RAM instead of CAM
- n-bit memory address consists of 2 parts; k bits of Index field and n-k bits of Tag field
- n-bit addresses are used to access main memory and k-bit Index is used to access the Cache
Addressing Relationships
Direct Mapping Cache Organization
Memory
address Memory data
00000 1 2 2 0
00777
01000
01777
02000
02777
2 3 4 0
3 4 5 0
4 5 6 0
5 6 7 0
6 7 1 0
Index
address Tag Data
000 0 0 1 2 2 0
0 2 6 7 1 0777
Cache memory
Tag(6) Index(9)
32K x 12
Main memory
Address = 15 bits
Data = 12 bits
512 x 12
Cache memory
Address = 9 bits
Data = 12 bits
00 000
77 777
000
777
Memory Organization 6 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Cache Mapping – direct mapping
Operation
- CPU generates a memory request with (TAG;INDEX)
- Access Cache using INDEX ; (tag; data)
Compare TAG and tag
- If matches -> Hit
Provide Cache[INDEX](data) to CPU
- If not match -> Miss
M[tag;INDEX] <- Cache[INDEX](data)
Cache[INDEX] <- (TAG;M[TAG; INDEX])
CPU <- Cache[INDEX](data)
Direct Mapping with block size of 8 words
000 0 1 3 4 5 0
007 0 1 6 5 7 8
010
017
770 0 2
777 0 2 6 7 1 0
Block 0
Block 1
Block 63
Tag Block Word
INDEX
Memory Organization 7 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Cache Mapping – Set Associative Mapping
Set Associative Mapping Cache with set size of two
- Each memory block has a set of locations in the Cache to load
Index Tag Data
000 0 1 3 4 5 0 0 2 5 6 7 0
Tag Data
777 0 2 6 7 1 0 0 0 2 3 4 0
Operation
- CPU generates a memory address(TAG; INDEX)
- Access Cache with INDEX, (Cache word = (tag 0, data 0); (tag 1, data 1))
- Compare TAG and tag 0 and then tag 1
- If tag i = TAG -> Hit, CPU <- data i
- If tag i  TAG -> Miss,
Replace either (tag 0, data 0) or (tag 1, data 1),
Assume (tag 0, data 0) is selected for replacement,
(Why (tag 0, data 0) instead of (tag 1, data 1) ?)
M[tag 0, INDEX] <- Cache[INDEX](data 0)
Cache[INDEX](tag 0, data 0) <- (TAG, M[TAG,INDEX]),
CPU <- Cache[INDEX](data 0)
Memory Organization 8 Lecture 42
CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT
Cache Write
Write Through
When writing into memory
If Hit, both Cache and memory is written in parallel
If Miss, Memory is written
For a read miss, missing block may be overloaded onto a cache block
Memory is always updated
-> Important when CPU and DMA I/O are both executing
Slow, due to the memory access time
Write-Back (Copy-Back)
When writing into memory
If Hit, only Cache is written
If Miss, missing block is brought to Cache and write into Cache
For a read miss, candidate block must be written back to the memory
Memory is not up-to-date, i.e., the same item in
Cache and memory may have different value

More Related Content

What's hot

Cache memory
Cache memoryCache memory
Cache memory
Anand Goyal
 
Memory management
Memory managementMemory management
Memory management
Rajni Sirohi
 
Memory management
Memory managementMemory management
Memory management
Muhammad Fayyaz
 
Deterministic Memory Abstraction and Supporting Multicore System Architecture
Deterministic Memory Abstraction and Supporting Multicore System ArchitectureDeterministic Memory Abstraction and Supporting Multicore System Architecture
Deterministic Memory Abstraction and Supporting Multicore System Architecture
Heechul Yun
 
Cache memory
Cache memoryCache memory
Cache memory
Eklavya Gupta
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
Muhammad SiRaj Munir
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
Wayne Jones Jnr
 
Cache memory
Cache memoryCache memory
Cache memory
Ahsan Ashfaq
 
Ch02 early system memory management
Ch02 early system  memory managementCh02 early system  memory management
Ch02 early system memory management
Jacob Cadeliña
 
Cache
CacheCache
Cache
Amit Roy
 
memory Interleaving and low order interleaving and high interleaving
memory Interleaving and low order interleaving and high interleavingmemory Interleaving and low order interleaving and high interleaving
memory Interleaving and low order interleaving and high interleaving
Jawwad Rafiq
 
OSCh9
OSCh9OSCh9
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
myrajendra
 
Memory Management
Memory ManagementMemory Management
Memory Management
DEDE IRYAWAN
 
Memory map
Memory mapMemory map
Memory map
aviban
 
Memory Mapping Cache
Memory Mapping CacheMemory Mapping Cache
Memory Mapping Cache
Sajith Harshana
 
Main Memory
Main MemoryMain Memory
Main Memory
Mustafa Ugur Oduncu
 
Memory management
Memory managementMemory management
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
Maitree Patel
 
Cache memory
Cache memoryCache memory
Cache memory
Shailesh Tanwar
 

What's hot (20)

Cache memory
Cache memoryCache memory
Cache memory
 
Memory management
Memory managementMemory management
Memory management
 
Memory management
Memory managementMemory management
Memory management
 
Deterministic Memory Abstraction and Supporting Multicore System Architecture
Deterministic Memory Abstraction and Supporting Multicore System ArchitectureDeterministic Memory Abstraction and Supporting Multicore System Architecture
Deterministic Memory Abstraction and Supporting Multicore System Architecture
 
Cache memory
Cache memoryCache memory
Cache memory
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Ch02 early system memory management
Ch02 early system  memory managementCh02 early system  memory management
Ch02 early system memory management
 
Cache
CacheCache
Cache
 
memory Interleaving and low order interleaving and high interleaving
memory Interleaving and low order interleaving and high interleavingmemory Interleaving and low order interleaving and high interleaving
memory Interleaving and low order interleaving and high interleaving
 
OSCh9
OSCh9OSCh9
OSCh9
 
34 single partition allocation
34 single partition allocation34 single partition allocation
34 single partition allocation
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Memory map
Memory mapMemory map
Memory map
 
Memory Mapping Cache
Memory Mapping CacheMemory Mapping Cache
Memory Mapping Cache
 
Main Memory
Main MemoryMain Memory
Main Memory
 
Memory management
Memory managementMemory management
Memory management
 
Introduction of Memory Management
Introduction of Memory Management Introduction of Memory Management
Introduction of Memory Management
 
Cache memory
Cache memoryCache memory
Cache memory
 

Viewers also liked

Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1
Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1
Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1
Hsien-Hsin Sean Lee, Ph.D.
 
Chapter 9 ap psych- Memory
Chapter 9 ap psych- MemoryChapter 9 ap psych- Memory
Chapter 9 ap psych- Memory
Dr. J's AP Psych Class
 
Drawback of Internet of Things - Battery Life
Drawback of Internet of Things - Battery LifeDrawback of Internet of Things - Battery Life
Drawback of Internet of Things - Battery Life
Adithya Jayaprakash
 
Memory Hierarchy (RAM and ROM)
Memory Hierarchy (RAM and ROM)Memory Hierarchy (RAM and ROM)
Memory Hierarchy (RAM and ROM)
sumanth ch
 
Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门
frogd
 
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Hsien-Hsin Sean Lee, Ph.D.
 
Cache memory presentation
Cache memory presentationCache memory presentation
Cache memory presentation
bravehearted1010
 

Viewers also liked (7)

Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1
Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1
Lec9 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part 1
 
Chapter 9 ap psych- Memory
Chapter 9 ap psych- MemoryChapter 9 ap psych- Memory
Chapter 9 ap psych- Memory
 
Drawback of Internet of Things - Battery Life
Drawback of Internet of Things - Battery LifeDrawback of Internet of Things - Battery Life
Drawback of Internet of Things - Battery Life
 
Memory Hierarchy (RAM and ROM)
Memory Hierarchy (RAM and ROM)Memory Hierarchy (RAM and ROM)
Memory Hierarchy (RAM and ROM)
 
Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门Cpu Cache and Memory Ordering——并发程序设计入门
Cpu Cache and Memory Ordering——并发程序设计入门
 
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
Lec10 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part2
 
Cache memory presentation
Cache memory presentationCache memory presentation
Cache memory presentation
 

Similar to Lecture 42

memory.ppt
memory.pptmemory.ppt
memory.ppt
ibmlenovo2021
 
memory.ppt
memory.pptmemory.ppt
memory.ppt
RohitPaul71
 
Memory Organizationsssssssssssssssss.ppt
Memory Organizationsssssssssssssssss.pptMemory Organizationsssssssssssssssss.ppt
Memory Organizationsssssssssssssssss.ppt
k2w9psdb96
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
abcxyz19691969
 
computer-memory
computer-memorycomputer-memory
computer-memory
Bablu Shofi
 
Apache Cassandra at Macys
Apache Cassandra at MacysApache Cassandra at Macys
Apache Cassandra at Macys
DataStax Academy
 
Chapter 8 memory-updated
Chapter 8 memory-updatedChapter 8 memory-updated
Chapter 8 memory-updated
Delowar hossain
 
Ch8
Ch8Ch8
Operating System
Operating SystemOperating System
Operating System
Subhasis Dash
 
Memory management
Memory managementMemory management
Memory management
Mohammad Sadiq
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
 
OS_Ch9
OS_Ch9OS_Ch9
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
Prashant odhavani
 
Memory management
Memory managementMemory management
Memory management
cpjcollege
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
ItechAnand1
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
RohitPaul71
 
hierarchical memory technology.pptx
hierarchical memory technology.pptxhierarchical memory technology.pptx
hierarchical memory technology.pptx
2105986
 
DLCA-UNIT-5-Memory Organization-Cache.pdf
DLCA-UNIT-5-Memory Organization-Cache.pdfDLCA-UNIT-5-Memory Organization-Cache.pdf
DLCA-UNIT-5-Memory Organization-Cache.pdf
DrKRadhikaProfessorD
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
Jeanie Delos Arcos
 
Os presentation
Os presentationOs presentation
Os presentation
zeeshanyousaf117750
 

Similar to Lecture 42 (20)

memory.ppt
memory.pptmemory.ppt
memory.ppt
 
memory.ppt
memory.pptmemory.ppt
memory.ppt
 
Memory Organizationsssssssssssssssss.ppt
Memory Organizationsssssssssssssssss.pptMemory Organizationsssssssssssssssss.ppt
Memory Organizationsssssssssssssssss.ppt
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
 
computer-memory
computer-memorycomputer-memory
computer-memory
 
Apache Cassandra at Macys
Apache Cassandra at MacysApache Cassandra at Macys
Apache Cassandra at Macys
 
Chapter 8 memory-updated
Chapter 8 memory-updatedChapter 8 memory-updated
Chapter 8 memory-updated
 
Ch8
Ch8Ch8
Ch8
 
Operating System
Operating SystemOperating System
Operating System
 
Memory management
Memory managementMemory management
Memory management
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
Memory management
Memory managementMemory management
Memory management
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 
hierarchical memory technology.pptx
hierarchical memory technology.pptxhierarchical memory technology.pptx
hierarchical memory technology.pptx
 
DLCA-UNIT-5-Memory Organization-Cache.pdf
DLCA-UNIT-5-Memory Organization-Cache.pdfDLCA-UNIT-5-Memory Organization-Cache.pdf
DLCA-UNIT-5-Memory Organization-Cache.pdf
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Os presentation
Os presentationOs presentation
Os presentation
 

More from RahulRathi94

Lecture 47
Lecture 47Lecture 47
Lecture 47
RahulRathi94
 
Lecture 46
Lecture 46Lecture 46
Lecture 46
RahulRathi94
 
Lecture 43
Lecture 43Lecture 43
Lecture 43
RahulRathi94
 
Lecture 39
Lecture 39Lecture 39
Lecture 39
RahulRathi94
 
Lecture 38
Lecture 38Lecture 38
Lecture 38
RahulRathi94
 
Lecture 37
Lecture 37Lecture 37
Lecture 37
RahulRathi94
 
Lecture 36
Lecture 36Lecture 36
Lecture 36
RahulRathi94
 
Lecture 35
Lecture 35Lecture 35
Lecture 35
RahulRathi94
 
Lecture 34
Lecture 34Lecture 34
Lecture 34
RahulRathi94
 
Lecture 28
Lecture 28Lecture 28
Lecture 28
RahulRathi94
 
Lecture 27
Lecture 27Lecture 27
Lecture 27
RahulRathi94
 
Lecture 26
Lecture 26Lecture 26
Lecture 26
RahulRathi94
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
RahulRathi94
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
RahulRathi94
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
RahulRathi94
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
RahulRathi94
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
RahulRathi94
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
RahulRathi94
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
RahulRathi94
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
RahulRathi94
 

More from RahulRathi94 (20)

Lecture 47
Lecture 47Lecture 47
Lecture 47
 
Lecture 46
Lecture 46Lecture 46
Lecture 46
 
Lecture 43
Lecture 43Lecture 43
Lecture 43
 
Lecture 39
Lecture 39Lecture 39
Lecture 39
 
Lecture 38
Lecture 38Lecture 38
Lecture 38
 
Lecture 37
Lecture 37Lecture 37
Lecture 37
 
Lecture 36
Lecture 36Lecture 36
Lecture 36
 
Lecture 35
Lecture 35Lecture 35
Lecture 35
 
Lecture 34
Lecture 34Lecture 34
Lecture 34
 
Lecture 28
Lecture 28Lecture 28
Lecture 28
 
Lecture 27
Lecture 27Lecture 27
Lecture 27
 
Lecture 26
Lecture 26Lecture 26
Lecture 26
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 

Recently uploaded

Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 

Recently uploaded (20)

Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 

Lecture 42

  • 1. Memory Organization 1 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Overview  Memory Hierarchy  Main Memory  Auxiliary Memory  Associative Memory  Cache Memory  Virtual Memory  Memory Mgt Hardware
  • 2. Memory Organization 2 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Cache Memory Locality of Reference - The references to memory at any given time interval tend to be confined within a localized areas - This area contains a set of information and the membership changes gradually as time goes by - Temporal Locality The information which will be used in near future is likely to be in use already( e.g. Reuse of information in loops) - Spatial Locality If a word is accessed, adjacent(near) words are likely accessed soon (e.g. Related data items (arrays) are usually stored together; instructions are executed sequentially) Cache - The property of Locality of Reference makes the cache memory systems work - Cache is a fast small capacity memory that should hold those information which are most likely to be accessed Main memory Cache memory CPU
  • 3. Memory Organization 3 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Performance of Cache All the memory accesses are directed first to Cache If the word is in Cache; Access cache to provide it to CPU If the word is not in Cache; Bring a block (or a line) including that word to replace a block now in Cache - How can we know if the word that is required is there ? - If a new block is to replace one of the old blocks, which one should we choose ? Memory Access Performance of Cache Memory System Hit Ratio - % of memory accesses satisfied by Cache memory system Te: Effective memory access time in Cache memory system Tc: Cache access time Tm: Main memory access time Te = Tc + (1 - h) Tm Example: Tc = 0.4 s, Tm = 1.2s, h = 0.85% Te = 0.4 + (1 - 0.85) * 1.2 = 0.58s
  • 4. Memory Organization 4 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Memory and Cache Mapping – (Associative Mapping) Associative mapping Direct mapping Set-associative mappingAssociative Mapping Mapping Function Specification of correspondence between main memory blocks and cache blocks - Any block location in Cache can store any block in memory -> Most flexible - Mapping Table is implemented in an associative memory -> Fast, very Expensive - Mapping Table Stores both address and the content of the memory word address (15 bits) Argument register Address Data 0 1 0 0 0 0 2 7 7 7 2 2 2 3 5 3 4 5 0 6 7 1 0 1 2 3 4 CAM
  • 5. Memory Organization 5 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Cache Mapping – direct mapping - Each memory block has only one place to load in Cache - Mapping Table is made of RAM instead of CAM - n-bit memory address consists of 2 parts; k bits of Index field and n-k bits of Tag field - n-bit addresses are used to access main memory and k-bit Index is used to access the Cache Addressing Relationships Direct Mapping Cache Organization Memory address Memory data 00000 1 2 2 0 00777 01000 01777 02000 02777 2 3 4 0 3 4 5 0 4 5 6 0 5 6 7 0 6 7 1 0 Index address Tag Data 000 0 0 1 2 2 0 0 2 6 7 1 0777 Cache memory Tag(6) Index(9) 32K x 12 Main memory Address = 15 bits Data = 12 bits 512 x 12 Cache memory Address = 9 bits Data = 12 bits 00 000 77 777 000 777
  • 6. Memory Organization 6 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Cache Mapping – direct mapping Operation - CPU generates a memory request with (TAG;INDEX) - Access Cache using INDEX ; (tag; data) Compare TAG and tag - If matches -> Hit Provide Cache[INDEX](data) to CPU - If not match -> Miss M[tag;INDEX] <- Cache[INDEX](data) Cache[INDEX] <- (TAG;M[TAG; INDEX]) CPU <- Cache[INDEX](data) Direct Mapping with block size of 8 words 000 0 1 3 4 5 0 007 0 1 6 5 7 8 010 017 770 0 2 777 0 2 6 7 1 0 Block 0 Block 1 Block 63 Tag Block Word INDEX
  • 7. Memory Organization 7 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Cache Mapping – Set Associative Mapping Set Associative Mapping Cache with set size of two - Each memory block has a set of locations in the Cache to load Index Tag Data 000 0 1 3 4 5 0 0 2 5 6 7 0 Tag Data 777 0 2 6 7 1 0 0 0 2 3 4 0 Operation - CPU generates a memory address(TAG; INDEX) - Access Cache with INDEX, (Cache word = (tag 0, data 0); (tag 1, data 1)) - Compare TAG and tag 0 and then tag 1 - If tag i = TAG -> Hit, CPU <- data i - If tag i  TAG -> Miss, Replace either (tag 0, data 0) or (tag 1, data 1), Assume (tag 0, data 0) is selected for replacement, (Why (tag 0, data 0) instead of (tag 1, data 1) ?) M[tag 0, INDEX] <- Cache[INDEX](data 0) Cache[INDEX](tag 0, data 0) <- (TAG, M[TAG,INDEX]), CPU <- Cache[INDEX](data 0)
  • 8. Memory Organization 8 Lecture 42 CSE 211, Computer Organization and Architecture Harjeet Kaur, CSE/IT Cache Write Write Through When writing into memory If Hit, both Cache and memory is written in parallel If Miss, Memory is written For a read miss, missing block may be overloaded onto a cache block Memory is always updated -> Important when CPU and DMA I/O are both executing Slow, due to the memory access time Write-Back (Copy-Back) When writing into memory If Hit, only Cache is written If Miss, missing block is brought to Cache and write into Cache For a read miss, candidate block must be written back to the memory Memory is not up-to-date, i.e., the same item in Cache and memory may have different value