SlideShare una empresa de Scribd logo
1 de 28
Memory Hierarchy
Design
Group Members
 Ammarah Khalid (12-CS-01)
 Farwa Abdul Hanan (12-CS-13)
 Zainab Khalid (12-CS-33)
 Aniqa Javed (12-CS-34)
Introduction
 Programmers want unlimited amounts of memory with low
latency
 Fast memory technology is more expensive per bit than
slower memory
 Solution: organize memory system into a hierarchy
Memory Hierarchy
 The memory hierarchy is a concept used for storing & discussing
performance issues in computer architectural design
 The goal is to provide a memory system with cost per byte almost as low
as the cheapest level of memory and speed almost as fast as the fastest
level
Memory Hierarchy Design
Main Memory
Disk Storage
Back Storage
Cache
Registers
Back Storage
• Offline memory
• Used for Backup
Back Storage
Disk Storage
• Online memory
• Secondary Storage
Disk Storage
Back Storage
Main Memory
• Primary Memory
• Instructions resides in
main memory
Main Memory
Disk Storage
Back Storage
Cache
• High speed memory
• Costly but Fast
• Store CPU executed
output
Main Memory
Disk Storage
Back Storage
Cache
Registers
• Part of CPU
• Temporary memory
Main Memory
Disk Storage
Back Storage
Cache
Registers
Principle of locality
 Principle of locality, also known as the, locality of reference
 it is a term for the phenomenon in which the same values, or related storage
locations, are frequently accessed.
Memory Hierarchy Basics
Memory Performance Gap
Memory Hierarchy Basics
 When a word is not found in the cache
 The word must be fetched from the memory and placed in the cache before
continuing
 Each cache block includes a tag to see which memory address it corresponds to.
 Most popular scheme is set associative, where a set is a group of blocks in the
cache
 Then place block into cache in any location within its set, determined by address
(block address) MOD (number of sets)
Memory Hierarchy Basics
 n sets => n-way set associative
 Direct-mapped cache => one block per set
 Fully associative => one set
 Writing to cache: two strategies
 Write-through
A write-through cache updates the item in the cache and writes through to update main
memory
 Write-back
A write-back cache only updates the copy in the cache. When the block is about to be replaced,
it is copied back to memory
 Both write strategies can use a write buffer to allow the cache to proceed as soon as the
data is placed in the buffer
Memory Hierarchy Basics
 Miss rate
 Fraction of cache access that result in a miss
 Causes of misses
 Compulsory
 First reference to a block
 Compulsory misses are those that occur even if you had an infinite cache.
 Capacity
 Capacity misses (in addition to compulsory misses) will occur because of blocks being discarded and
later retrieved.
 Conflict
 Conflict misses (in addition to compulsory and capacity misses) will occur because a block may be
discarded and later retrieved if conflicting blocks map to its set.
Memory Hierarchy Basics
where Hit time is the time to hit in the cache and Miss penalty is the time to
replace the block from memory (that is, the cost of a miss).
Average memory access time is still an indirect measure of performance
although it is a better measure than miss rate, it is not a substitute for execution time
Cache Optimization
Basic Cache Optimizations
 Larger block size to reduce miss rate
 Increase the block size so that more and more data from frequently
used addresses can be stored
 Drawbacks – Miss Penalty
 Bigger caches to reduce miss rate
 Increase the cache size
 Drawbacks - potentially longer hit time of the larger cache memory
and higher cost and power.
Continue…
 Higher associativity to reduce miss rate
 Increasing associativity to reduce conflict misses
 Cost of increased hit time
 Multilevel caches to reduce miss penalty
 Adding another level of cache between cache and memory
 First level – to match the fast clock cycle in order to keep pace with
the increasing clock rate of the processor
 Second level – large enough to capture many accesses that would go
to main memory
Continue…
 To avoid read after write hazards give priority to read misses
over writes to reduce miss penalty and check the contents of
the write buffer if no data conflicts then let the memory to
read
 Avoiding address translation during indexing of the cache to
reduce hit time
Address translation
Virtual Memory
 Virtual memory is a feature of an operating system (OS) that allows a computer
to compensate for shortages of physical memory by temporarily transferring
pages of data from random access memory (RAM) to disk storage. It contains
virtual addresses
Translation Lookaside Buffer (TLB)
 The translation lookaside buffer (TLB) is a cache for page table entries. It works
in much the same way as the data cache: it stores recently accessed page table
entries.
The END

Más contenido relacionado

La actualidad más candente

Introduction to storage
Introduction to storageIntroduction to storage
Introduction to storage
sagaroceanic11
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
Employee
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
askme
 
History of storage devices
History of storage devicesHistory of storage devices
History of storage devices
dan13ljg
 

La actualidad más candente (20)

04 cache memory.ppt 1
04 cache memory.ppt 104 cache memory.ppt 1
04 cache memory.ppt 1
 
Introduction to storage
Introduction to storageIntroduction to storage
Introduction to storage
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache memory
Cache memoryCache memory
Cache memory
 
Storage
StorageStorage
Storage
 
Memory organization
Memory organizationMemory organization
Memory organization
 
multiprocessors and multicomputers
 multiprocessors and multicomputers multiprocessors and multicomputers
multiprocessors and multicomputers
 
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Computer memory
Computer memoryComputer memory
Computer memory
 
Advanced computer architecture
Advanced computer architectureAdvanced computer architecture
Advanced computer architecture
 
Elements of cache design
Elements of cache designElements of cache design
Elements of cache design
 
Cache coherence
Cache coherenceCache coherence
Cache coherence
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Memory management
Memory managementMemory management
Memory management
 
Cache Memory
Cache MemoryCache Memory
Cache Memory
 
History of storage devices
History of storage devicesHistory of storage devices
History of storage devices
 
The CPU and Memory and Major Components
The CPU and Memory and  Major ComponentsThe CPU and Memory and  Major Components
The CPU and Memory and Major Components
 
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
 

Destacado

Cache optimization
Cache optimizationCache optimization
Cache optimization
Kavi Kathir
 
Cache Optimization with Akamai
Cache Optimization with AkamaiCache Optimization with Akamai
Cache Optimization with Akamai
Blake Crosby
 
Memory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureMemory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer Architechture
Shweta Ghate
 
Dynamic Prefetching & Cache Optimizations
Dynamic Prefetching & Cache OptimizationsDynamic Prefetching & Cache Optimizations
Dynamic Prefetching & Cache Optimizations
Takefumi MIYOSHI
 

Destacado (20)

Cache optimization
Cache optimizationCache optimization
Cache optimization
 
Cache Optimization with Akamai
Cache Optimization with AkamaiCache Optimization with Akamai
Cache Optimization with Akamai
 
Memory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureMemory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer Architechture
 
Dynamic Prefetching & Cache Optimizations
Dynamic Prefetching & Cache OptimizationsDynamic Prefetching & Cache Optimizations
Dynamic Prefetching & Cache Optimizations
 
Cache memory
Cache memoryCache memory
Cache memory
 
Cache Design for an Alpha Microprocessor
Cache Design for an Alpha MicroprocessorCache Design for an Alpha Microprocessor
Cache Design for an Alpha Microprocessor
 
Applications of Image Processing
Applications of Image ProcessingApplications of Image Processing
Applications of Image Processing
 
Prefix and suffix of open gl
Prefix and suffix of open glPrefix and suffix of open gl
Prefix and suffix of open gl
 
Scaling
ScalingScaling
Scaling
 
Linear combination of vector
Linear combination of vectorLinear combination of vector
Linear combination of vector
 
Cohen sutherland algorithm
Cohen sutherland algorithmCohen sutherland algorithm
Cohen sutherland algorithm
 
Raster images (assignment)
Raster images (assignment)Raster images (assignment)
Raster images (assignment)
 
Manual of JAVA (more than Half)
Manual of JAVA (more than Half)Manual of JAVA (more than Half)
Manual of JAVA (more than Half)
 
JAVA Manual remaining
JAVA Manual remainingJAVA Manual remaining
JAVA Manual remaining
 
Digital logic and design's Lab 4 nand
Digital logic and design's Lab 4 nandDigital logic and design's Lab 4 nand
Digital logic and design's Lab 4 nand
 
Summary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
Summary of Simultaneous Multithreading: Maximizing On-Chip ParallelismSummary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
Summary of Simultaneous Multithreading: Maximizing On-Chip Parallelism
 
Digital logic and design's Lab 3
Digital logic and design's Lab 3Digital logic and design's Lab 3
Digital logic and design's Lab 3
 
Javadocx j option pane
Javadocx j option paneJavadocx j option pane
Javadocx j option pane
 
Лекция 4. Оптимизация доступа к памяти (Memory access optimization, cache opt...
Лекция 4. Оптимизация доступа к памяти (Memory access optimization, cache opt...Лекция 4. Оптимизация доступа к памяти (Memory access optimization, cache opt...
Лекция 4. Оптимизация доступа к памяти (Memory access optimization, cache opt...
 
Templates
TemplatesTemplates
Templates
 

Similar a Memory Hierarchy Design, Basics, Cache Optimization, Address Translation

memorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptxmemorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptx
shahdivyanshu1002
 
Computer Memory Hierarchy Computer Architecture
Computer Memory Hierarchy Computer ArchitectureComputer Memory Hierarchy Computer Architecture
Computer Memory Hierarchy Computer Architecture
Haris456
 

Similar a Memory Hierarchy Design, Basics, Cache Optimization, Address Translation (20)

CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
 
computer-memory
computer-memorycomputer-memory
computer-memory
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Unit I Memory technology and optimization
Unit I Memory technology and optimizationUnit I Memory technology and optimization
Unit I Memory technology and optimization
 
memorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptxmemorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptx
 
Computer Memory Hierarchy Computer Architecture
Computer Memory Hierarchy Computer ArchitectureComputer Memory Hierarchy Computer Architecture
Computer Memory Hierarchy Computer Architecture
 
Ch8
Ch8Ch8
Ch8
 
Chapter 5 b
Chapter 5  bChapter 5  b
Chapter 5 b
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Chapter 5 c
Chapter 5 cChapter 5 c
Chapter 5 c
 
Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coa
 
Cache memory ...
Cache memory ...Cache memory ...
Cache memory ...
 
Chapter 5 a
Chapter 5 aChapter 5 a
Chapter 5 a
 
hierarchical memory technology.pptx
hierarchical memory technology.pptxhierarchical memory technology.pptx
hierarchical memory technology.pptx
 
CH08.pdf
CH08.pdfCH08.pdf
CH08.pdf
 
Cpu caching concepts mr mahesh
Cpu caching concepts mr maheshCpu caching concepts mr mahesh
Cpu caching concepts mr mahesh
 
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
 

Más de Farwa Ansari

Más de Farwa Ansari (17)

Energy Harvesting Techniques in Wireless Sensor Networks – A Survey
Energy Harvesting Techniques in Wireless Sensor Networks – A SurveyEnergy Harvesting Techniques in Wireless Sensor Networks – A Survey
Energy Harvesting Techniques in Wireless Sensor Networks – A Survey
 
Micro-services architecture
Micro-services architectureMicro-services architecture
Micro-services architecture
 
Software Design Patterns - An Overview
Software Design Patterns - An OverviewSoftware Design Patterns - An Overview
Software Design Patterns - An Overview
 
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...Optimizing the memory management of a virtual machine monitor on a NUMA syste...
Optimizing the memory management of a virtual machine monitor on a NUMA syste...
 
Fault Tolerance Typed Assembly Language - A graphical overview
Fault Tolerance Typed Assembly Language - A graphical overviewFault Tolerance Typed Assembly Language - A graphical overview
Fault Tolerance Typed Assembly Language - A graphical overview
 
Comparative Analysis of Face Recognition Methodologies and Techniques
Comparative Analysis of Face Recognition Methodologies and TechniquesComparative Analysis of Face Recognition Methodologies and Techniques
Comparative Analysis of Face Recognition Methodologies and Techniques
 
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
Chapter 5: Names, Bindings and Scopes (review Questions and Problem Set)
 
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
Chapter 4: Lexical & Syntax Analysis (Programming Exercises)
 
Business plan of a software house
Business plan of a software houseBusiness plan of a software house
Business plan of a software house
 
Mission statement and Vision statement of 3 Different Companies
Mission statement and Vision statement of 3 Different CompaniesMission statement and Vision statement of 3 Different Companies
Mission statement and Vision statement of 3 Different Companies
 
Graphic display devices
Graphic display devicesGraphic display devices
Graphic display devices
 
Implementation & Challenges of IPv6
Implementation & Challenges of IPv6Implementation & Challenges of IPv6
Implementation & Challenges of IPv6
 
IPv6 Implementation challenges
IPv6 Implementation challengesIPv6 Implementation challenges
IPv6 Implementation challenges
 
Tomasulo Algorithm
Tomasulo AlgorithmTomasulo Algorithm
Tomasulo Algorithm
 
DLDLab 8 half adder
DLDLab 8 half adderDLDLab 8 half adder
DLDLab 8 half adder
 
Dld (lab 1 & 2)
Dld (lab 1 & 2)Dld (lab 1 & 2)
Dld (lab 1 & 2)
 
Hacking and Hackers
Hacking and HackersHacking and Hackers
Hacking and Hackers
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
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
QucHHunhnh
 

Último (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
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
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Memory Hierarchy Design, Basics, Cache Optimization, Address Translation

  • 1.
  • 3. Group Members  Ammarah Khalid (12-CS-01)  Farwa Abdul Hanan (12-CS-13)  Zainab Khalid (12-CS-33)  Aniqa Javed (12-CS-34)
  • 4. Introduction  Programmers want unlimited amounts of memory with low latency  Fast memory technology is more expensive per bit than slower memory  Solution: organize memory system into a hierarchy
  • 5. Memory Hierarchy  The memory hierarchy is a concept used for storing & discussing performance issues in computer architectural design  The goal is to provide a memory system with cost per byte almost as low as the cheapest level of memory and speed almost as fast as the fastest level
  • 6. Memory Hierarchy Design Main Memory Disk Storage Back Storage Cache Registers
  • 7. Back Storage • Offline memory • Used for Backup Back Storage
  • 8. Disk Storage • Online memory • Secondary Storage Disk Storage Back Storage
  • 9. Main Memory • Primary Memory • Instructions resides in main memory Main Memory Disk Storage Back Storage
  • 10. Cache • High speed memory • Costly but Fast • Store CPU executed output Main Memory Disk Storage Back Storage Cache
  • 11. Registers • Part of CPU • Temporary memory Main Memory Disk Storage Back Storage Cache Registers
  • 12. Principle of locality  Principle of locality, also known as the, locality of reference  it is a term for the phenomenon in which the same values, or related storage locations, are frequently accessed.
  • 15. Memory Hierarchy Basics  When a word is not found in the cache  The word must be fetched from the memory and placed in the cache before continuing  Each cache block includes a tag to see which memory address it corresponds to.  Most popular scheme is set associative, where a set is a group of blocks in the cache  Then place block into cache in any location within its set, determined by address (block address) MOD (number of sets)
  • 16. Memory Hierarchy Basics  n sets => n-way set associative  Direct-mapped cache => one block per set  Fully associative => one set  Writing to cache: two strategies  Write-through A write-through cache updates the item in the cache and writes through to update main memory  Write-back A write-back cache only updates the copy in the cache. When the block is about to be replaced, it is copied back to memory  Both write strategies can use a write buffer to allow the cache to proceed as soon as the data is placed in the buffer
  • 17. Memory Hierarchy Basics  Miss rate  Fraction of cache access that result in a miss  Causes of misses  Compulsory  First reference to a block  Compulsory misses are those that occur even if you had an infinite cache.  Capacity  Capacity misses (in addition to compulsory misses) will occur because of blocks being discarded and later retrieved.  Conflict  Conflict misses (in addition to compulsory and capacity misses) will occur because a block may be discarded and later retrieved if conflicting blocks map to its set.
  • 18. Memory Hierarchy Basics where Hit time is the time to hit in the cache and Miss penalty is the time to replace the block from memory (that is, the cost of a miss). Average memory access time is still an indirect measure of performance although it is a better measure than miss rate, it is not a substitute for execution time
  • 20. Basic Cache Optimizations  Larger block size to reduce miss rate  Increase the block size so that more and more data from frequently used addresses can be stored  Drawbacks – Miss Penalty  Bigger caches to reduce miss rate  Increase the cache size  Drawbacks - potentially longer hit time of the larger cache memory and higher cost and power.
  • 21. Continue…  Higher associativity to reduce miss rate  Increasing associativity to reduce conflict misses  Cost of increased hit time  Multilevel caches to reduce miss penalty  Adding another level of cache between cache and memory  First level – to match the fast clock cycle in order to keep pace with the increasing clock rate of the processor  Second level – large enough to capture many accesses that would go to main memory
  • 22. Continue…  To avoid read after write hazards give priority to read misses over writes to reduce miss penalty and check the contents of the write buffer if no data conflicts then let the memory to read  Avoiding address translation during indexing of the cache to reduce hit time
  • 24. Virtual Memory  Virtual memory is a feature of an operating system (OS) that allows a computer to compensate for shortages of physical memory by temporarily transferring pages of data from random access memory (RAM) to disk storage. It contains virtual addresses
  • 25. Translation Lookaside Buffer (TLB)  The translation lookaside buffer (TLB) is a cache for page table entries. It works in much the same way as the data cache: it stores recently accessed page table entries.
  • 26.
  • 27.