Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

CMPT 300 Introduction to Operating Systems
HW/Study Guide. Synchronization Make sure you understand the HW problems!
1 CMPT 300 Introduction to Operating Systems Virtual Memory Sample Questions.
3.3 Paging PAGE TABLE Logical memory Physical memory page frame
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
1. 1. Database address space 2. Virtual address space 3. Map table 4. Translation table 5. Swizzling and UnSwizzling 6. Pinned Blocks 2.
 Just as processes share the CPU, they also share physical memory. This section is about mechanisms for doing that sharing. EXAMPLE OF MEMORY USAGE Calculation.
Allocating Memory.
CSC 4250 Computer Architectures December 8, 2006 Chapter 5. Memory Hierarchy.
Day 20 Memory Management. Assumptions A process need not be stored as one contiguous block. The entire process must reside in main memory.
Memory Management Design & Implementation Segmentation Chapter 4.
Memory Problems Prof. Sin-Min Lee Department of Mathematics and Computer Sciences.
Answers to the VM Problems Spring First question A computer has 32 bit addresses and a virtual memory with a page size of 8 kilobytes.  How many.
1 Tuesday, July 04, 2006 "Programs expand to fill the memory available to hold them." - Modified Parkinson’s Law.
Week 7 February 17, 2004 Adrienne Noble. Important Dates Due Monday, Feb 23 Homework 7 Due Wednesday, Feb 25 Project 3 Due Friday, Feb 27 Homework 8.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Memory Management Ch.8.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 08 Main Memory (Page table questions)
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
File Systems Dr John Cowell phones off (please). Q 1 Which of the following statements about NTFS is NOT true? a) NTFS uses 64 bit addressing. b) Supports.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-8 Memory Management (2) Department of Computer Science and Software.
A sample data structure for N-level page tables. Sample Data Structure PageTable – Contains information about the tree Level – A structure describing.
Paging Example What is the data corresponding to the logical address below:
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
Chapter 91 Logical Address in Paging  Page size always chosen as a power of 2.  Example: if 16 bit addresses are used and page size = 1K, we need 10.
Homework Assignment #3 J. H. Wang Nov. 13, 2015.
Paging Paging is a memory-management scheme that permits the physical-address space of a process to be noncontiguous. Paging avoids the considerable problem.
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Silberschatz, Galvin and Gagne  Operating System Concepts Paging Logical address space of a process can be noncontiguous; process is allocated.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Chapter 9 Memory Organization. 9.1 Hierarchical Memory Systems Figure 9.1.
Operating Systems, Winter Semester 2011 Practical Session 9, Memory 1.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 33 Paging Read Ch. 9.4.
Main Memory: Paging and Segmentation CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Memory Management & Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
Memory: Page Table Structure CSSE 332 Operating Systems Rose-Hulman Institute of Technology.
Introduction to Paging. Readings r 4.3 of the text book.
Memory: Page Table Structure
CS 140 Lecture Notes: Virtual Memory
Section 8 Address Translation March 10th, 2017 Taught by Joshua Don.
COMBINED PAGING AND SEGMENTATION
HW/Study Guide.
Day 19 Memory Management.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
CSCI206 - Computer Organization & Programming
CS 140 Lecture Notes: Virtual Memory
Binary Code  
Practice Six Chapter Eight.
Paging Lecture November 2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Lecture 32 Syed Mansoor Sarwar
Operating Systems Placement Algorithm Alok Kumar Jagadev.
CS 140 Lecture Notes: Virtual Memory
Main Memory Session - 16.
Virtual Memory.
So far in memory management…
Lab 10 Paging.
Paging Memory Relocation and Fragmentation Paging
CS 140 Lecture Notes: Virtual Memory
Digital Logic Design.
Subnetting Subnetting is a method for getting the most out of the limited 32-bit IP addressing space. With any address class, subnetting provides a means.
Memory Management & Virtual Memory
Presentation transcript:

Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?

Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system? How many bits are required to address each byte within a 1024-byte page?

Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system? How many bits are required to address each byte within a 1024-byte page? 10 (2^10 = 1024). This leaves 5 bits for page number. So, How many pages are in the system?

Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system? How many bits are required to address each byte within a 1024-byte page? 10 (2^10 = 1024). This leaves 5 bits for page number. So, How many pages are in the system? 32 (2^5 = 32)

Now consider a 15-bit address space with 8 logical pages Now consider a 15-bit address space with 8 logical pages. How large are the pages?

Assuming a 15-bit address space with 8 logical pages Assuming a 15-bit address space with 8 logical pages. How large are the pages? Answer: 2^12 = 4K. It takes 3 bits to reference 8 logical pages (2^3 = 8). This leaves 12 bits for the page size and thus pages are 2^12.

Assume a 15-bit address space with a page size of 1K. Consider logical address 2049 and the following page table for some process P0. Assume a 15-bit address space with a page size of 1K. What is the physical address to which logical address 2049 will be mapped? 8 3

Assume a 15-bit address space with a page size of 1K. Consider logical address 2049 and the following page table for some process P0. Assume a 15-bit address space with a page size of 1K. What is the physical address to which logical address 2049 will be mapped? Logical Pages Step 1. Convert logical address to binary: Logical address: 000100000000001 1 2 3 4 8 3

Step2. Determine the logical page number: Logical Pages Step2. Determine the logical page number: Since there are 5-bits allocated to the logical page, the address is broken up as follows: 00010 0000000001 Logical page number offset within page 1 2 3 4 8 3

8 3 00010 00011 Step 3. Use logical page number as an index into the page table to get physical page number. Logical Address: 00010 0000000001

8 3 00010 000110000000001 Step 4. Concatenate offset with physical page frame number Logical Address 00010 0000000001

1 2 3 4 8 3 P0.1 1024 2048 3072 P0.2 4096 000110000000001 = 3073