SlideShare a Scribd company logo
Addressing methods & machine program sequencing:
Memory locations
The Role of Memory Locations in Program ExecutionMemory Location.pptx
Memory Hierarchy
Key Characteristic of Computer Memory
system
The Role of Memory Locations in Program ExecutionMemory Location.pptx
Main Memory
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
Memory address Map
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
Associative Memory
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
Read Operation
Write Operation
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
Mapping Techniques
 1. Direct Mapping
 Each main memory block maps to only one specific cache line.
 Simple and fast but can lead to more conflicts.
 2. Associative Mapping (Fully Associative)
 Any block of main memory can go to any line in the cache.
 Very flexible but slower due to searching entire cache.
 3. Set-Associative Mapping
 Cache is divided into sets, and each set has multiple lines (ways).
 A block maps to a specific set but can go into any line within that set.
 Compromise between direct and associative mapping.
Comparison Table:
Feature Direct Mapping
Associative
Mapping
Set-Associative
Mapping
Flexibility Low High Medium
Speed Fast Slow Moderate
Hardware Cost Low High Medium
Conflict Misses High Low Low to Medium
Cache Initialization
Virtual Memory
Address Space and memory Space
How It Works
• The CPU generates a virtual address (used by the program).
• The Memory Management Unit (MMU) translates this into a physical address.
• If the data is in RAM it's accessed directly.
→
• If not in RAM it's in
→ secondary storage (e.g., hard disk or SSD), and the
system:
• Loads the data into RAM
• May remove some existing data from RAM to make space
• This process is called paging or swapping
Demand Paging Is Used
• Only the "active" or "frequently used" parts of a program are loaded into
RAM.
• The rest are stored in the page file / swap space on the disk (SSD or HDD).
• When needed, inactive parts (pages) are brought into RAM.
• If RAM is full, some unused pages are swapped out.
 This is called demand paging.
The Role of Memory Locations in Program ExecutionMemory Location.pptx
The Role of Memory Locations in Program ExecutionMemory Location.pptx
 Virtual Address Register (20 bits)
 The CPU generates a virtual address whenever a program accesses memory.
 This virtual address is stored in the Virtual Address Register.
 It is 20 bits wide, meaning the program can use up to 220=1,048,5762^{20} =
1,048,576220=1,048,576 memory locations (1 MB addressable space).
Memory Mapping Table
•This is the core of the translation system.
•It takes the virtual address as input and looks up the corresponding physical
address.
•You can think of it like a dictionary:
Virtual Address Physical Address
→
 Memory Table Buffer Register
 After translation, the result (physical address) is temporarily stored in this
buffer.
 This register acts as a bridge between the mapping table and the main
memory hardware.4.
 Main Memory Address Register (15 bits)
 It receives the 15-bit physical address from the buffer.
 Since it is 15 bits, it can access up to 215=32,7682 15 =32,768 locations 32
→
KB of physical memory.
 This shows that even if we have a large virtual space (1 MB), the actual
physical space is smaller (32 KB).
 Main Memory
 This is the physical memory (RAM) where data or instructions are stored.
 The address in the Main Memory Address Register is used to locate the
required word in memory.6.
 Main Memory Buffer Register
 Once the data is accessed from main memory, it is temporarily held in this
register before being sent to the CPU or I/O device.
CPU generates a 20-bit virtual address
The address goes into the memory mapping table.
The table converts it into a 15-bit physical address.
This address is stored in the main memory address
register.
Main memory is accessed at this physical address.
The data is fetched and placed in the main memory
buffer register.
 Advantages of Virtual Memory
 Efficient use of physical memory
 Enables multi-tasking
 Protects memory between processes
 Lets large programs run even on small RAM systems
 Disadvantages
 May cause slower performance if paging happens frequently (called thrashing)
 Requires additional hardware (MMU)

More Related Content

PPT
memory management and Virtual Memory.ppt
PPT
Cache replacement policies,cache miss,writingtechniques
DOCX
virtual memory
PPTX
Memory Management
PPTX
Computer organizatin.Chapter Seven.pptxs
PPTX
jdsbfvkjsdbfvbasibgvyisbvilawbvslaksbvlawbvrab
PPTX
Computer architecture virtual memory
PPTX
HW29kkkkkkkkkkkkkkkkkkkmmmmkkmmkkk454.pptx
memory management and Virtual Memory.ppt
Cache replacement policies,cache miss,writingtechniques
virtual memory
Memory Management
Computer organizatin.Chapter Seven.pptxs
jdsbfvkjsdbfvbasibgvyisbvilawbvslaksbvlawbvrab
Computer architecture virtual memory
HW29kkkkkkkkkkkkkkkkkkkmmmmkkmmkkk454.pptx

Similar to The Role of Memory Locations in Program ExecutionMemory Location.pptx (20)

PPTX
Paging +Algorithem+Segmentation+memory management
PPTX
Unit 5-lecture-2
PDF
lecture-2-3_Memory.pdf,describing memory
PPTX
5.6 Basic computer structure microprocessors
PPT
Memory+management
ODP
Unix Memory Management - Operating Systems
PPT
Ch9 OS
 
PPT
PPT
unit-4 class (2).ppt,Memory managements part-1
PPTX
Memory Managment(OS).pptx
PPT
Chapter 8 - Main Memory
PPT
Memory management
PDF
Operating system Memory management
PPT
Memory comp
DOCX
virtual memory - Computer operating system
PPTX
Memory Management in System Designing.pptx
PPTX
Unit 5Memory management.pptx
PPT
Virtual memory
Paging +Algorithem+Segmentation+memory management
Unit 5-lecture-2
lecture-2-3_Memory.pdf,describing memory
5.6 Basic computer structure microprocessors
Memory+management
Unix Memory Management - Operating Systems
Ch9 OS
 
unit-4 class (2).ppt,Memory managements part-1
Memory Managment(OS).pptx
Chapter 8 - Main Memory
Memory management
Operating system Memory management
Memory comp
virtual memory - Computer operating system
Memory Management in System Designing.pptx
Unit 5Memory management.pptx
Virtual memory
Ad

Recently uploaded (20)

PPTX
Current and future trends in Computer Vision.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPTX
additive manufacturing of ss316l using mig welding
PPT
Project quality management in manufacturing
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Geodesy 1.pptx...............................................
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
PPT on Performance Review to get promotions
PPT
Mechanical Engineering MATERIALS Selection
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
Current and future trends in Computer Vision.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
573137875-Attendance-Management-System-original
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Fundamentals of safety and accident prevention -final (1).pptx
additive manufacturing of ss316l using mig welding
Project quality management in manufacturing
Internet of Things (IOT) - A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
Geodesy 1.pptx...............................................
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT on Performance Review to get promotions
Mechanical Engineering MATERIALS Selection
Model Code of Practice - Construction Work - 21102022 .pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
R24 SURVEYING LAB MANUAL for civil enggi
Ad

The Role of Memory Locations in Program ExecutionMemory Location.pptx

  • 1. Addressing methods & machine program sequencing: Memory locations
  • 4. Key Characteristic of Computer Memory system
  • 27.  1. Direct Mapping  Each main memory block maps to only one specific cache line.  Simple and fast but can lead to more conflicts.  2. Associative Mapping (Fully Associative)  Any block of main memory can go to any line in the cache.  Very flexible but slower due to searching entire cache.  3. Set-Associative Mapping  Cache is divided into sets, and each set has multiple lines (ways).  A block maps to a specific set but can go into any line within that set.  Compromise between direct and associative mapping.
  • 28. Comparison Table: Feature Direct Mapping Associative Mapping Set-Associative Mapping Flexibility Low High Medium Speed Fast Slow Moderate Hardware Cost Low High Medium Conflict Misses High Low Low to Medium
  • 31. Address Space and memory Space
  • 32. How It Works • The CPU generates a virtual address (used by the program). • The Memory Management Unit (MMU) translates this into a physical address. • If the data is in RAM it's accessed directly. → • If not in RAM it's in → secondary storage (e.g., hard disk or SSD), and the system: • Loads the data into RAM • May remove some existing data from RAM to make space • This process is called paging or swapping
  • 33. Demand Paging Is Used • Only the "active" or "frequently used" parts of a program are loaded into RAM. • The rest are stored in the page file / swap space on the disk (SSD or HDD). • When needed, inactive parts (pages) are brought into RAM. • If RAM is full, some unused pages are swapped out.  This is called demand paging.
  • 36.  Virtual Address Register (20 bits)  The CPU generates a virtual address whenever a program accesses memory.  This virtual address is stored in the Virtual Address Register.  It is 20 bits wide, meaning the program can use up to 220=1,048,5762^{20} = 1,048,576220=1,048,576 memory locations (1 MB addressable space). Memory Mapping Table •This is the core of the translation system. •It takes the virtual address as input and looks up the corresponding physical address. •You can think of it like a dictionary: Virtual Address Physical Address →
  • 37.  Memory Table Buffer Register  After translation, the result (physical address) is temporarily stored in this buffer.  This register acts as a bridge between the mapping table and the main memory hardware.4.  Main Memory Address Register (15 bits)  It receives the 15-bit physical address from the buffer.  Since it is 15 bits, it can access up to 215=32,7682 15 =32,768 locations 32 → KB of physical memory.  This shows that even if we have a large virtual space (1 MB), the actual physical space is smaller (32 KB).
  • 38.  Main Memory  This is the physical memory (RAM) where data or instructions are stored.  The address in the Main Memory Address Register is used to locate the required word in memory.6.  Main Memory Buffer Register  Once the data is accessed from main memory, it is temporarily held in this register before being sent to the CPU or I/O device.
  • 39. CPU generates a 20-bit virtual address The address goes into the memory mapping table. The table converts it into a 15-bit physical address. This address is stored in the main memory address register. Main memory is accessed at this physical address. The data is fetched and placed in the main memory buffer register.
  • 40.  Advantages of Virtual Memory  Efficient use of physical memory  Enables multi-tasking  Protects memory between processes  Lets large programs run even on small RAM systems  Disadvantages  May cause slower performance if paging happens frequently (called thrashing)  Requires additional hardware (MMU)