0% found this document useful (0 votes)
365 views

Cs 2301 Unit 6 Programming Assignment Final

This document discusses memory and paging concepts related to an operating systems assignment. It answers 6 questions about virtual address translation in a system with a 4GB virtual address space, 1GB physical memory using 1MB pages. The questions cover topics like the number of virtual/physical pages, offset/page number bit sizes, and translating a virtual address to a physical address using the given page table entries.

Uploaded by

Bryan Phone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
365 views

Cs 2301 Unit 6 Programming Assignment Final

This document discusses memory and paging concepts related to an operating systems assignment. It answers 6 questions about virtual address translation in a system with a 4GB virtual address space, 1GB physical memory using 1MB pages. The questions cover topics like the number of virtual/physical pages, offset/page number bit sizes, and translating a virtual address to a physical address using the given page table entries.

Uploaded by

Bryan Phone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

UNIVERSITY OF THE PEOPLE

CS 2301 OPERATING SYSTEMS 1

PROGRAMMING ASSIGNMENT UNIT 6

ANASTASIOS TSOURNOS
Introduction

This paper will explore memory and paging-related concepts. All questions will be
answered and a logical explanation behind the answers will be provided to enhance the
learning experience. I utilized three sources for my research and learning and I hope you find
these sources worth taking a look at for more detailed insights.

Suppose that a system has a 32-bit (4GB) virtual address space. It has 1GB of physical
memory, and uses 1MB pages. 

1. How many virtual pages are there in the address space?

4,096.

Since 1GB has 1,024 MB pages, it implies 4GB has 1,024 times 4 which is equals to 4,096
virtual pages.

2. How many physical pages are there in the address space?

1,024

A GB has 1,024 pages and since we have 1GB physical memory, our address space has 1,024
physical pages in the address space.

3. How many bits are there in the offset?

20.

According to Hamilton (2001), figuring out the power associated with the page size is the
first logical step. We have 1MB pages and 1MB is equal to 2^20. The power here is 20 and is
the number of bits that are in the offset.

4. How many bits are there in the virtual page number?

12
Given that the we have a 32-bit address size and we have established that the page offset is
20, we’re left with 12 bits for the virtual address, i.e., 32 minus 20 which is equal to 12.

5. How many bits are there in the physical page number?

10

First, we find the power associated with the physical memory. With 1GB physical memory
and it is a power of 2., it translates to 2^30, i.e., the number of bits on each physical page. So,
we minus the page offset (20) from the physical address size (30) which leaves us with 10
bits in the physical page number.

6. Some entries of the page table are shown below (all values are in hex, and all
entries shown are valid). Translate virtual address 0x410423 to a physical
address, using the translations in this page table. 

Entry Number
Value  
0 1F
1 3C
2 55
3 9C
4 DD
5 EE
6 99
... ...
20 2F
21 4C
22 65
23 AC
24 ED
25 FE
26 100
... ...
40 11F
41 13C
42 155
43 19C
44 1DD
45 1EE
46 199
... .

0xDD10423.

Given that the system uses 12 bits, we first have to convert the hexadecimal virtual address to
a 32-bit binary value which gives: 00000000010000010000010000100011. Since we use the
first 12 bits to establish the page number, we convert 000000000100 to a decimal which gives
us 4. Using the provided table 4 translates to DD. The physical address of 0x410423 is
therefore 0xDD10423

Conclusion

The assignment was definitely worth the effort involved as it has helped me
internalize invaluable paging knowledge. With each milestone comes a better understanding
of memory as well. I now have a better understanding of the logic behind bare numbers and
letters as in the instance of virtual address conversion. I definitely have lots of food for
thought and a basis for more exercise and research to springboard my learning experience
even further.

References

(n.d.). Retrieved May 16, 2021, from


http://www2.cs.uregina.ca/~hamilton/courses/330/notes/memory/paging.html

Hagoort, N., Niels Hagoort Niels Hagoort is a Technical Marketing Architect and VCDX
#212 working for VMware in the Cloud Platform Business Unit. In his role, Plankers, B.,
Malur, K., Sahu, A., & West, M. (2020, March 04). How is Virtual Memory Translated to
Physical Memory? Retrieved May 16, 2021, from
https://blogs.vmware.com/vsphere/2020/03/how-is-virtual-memory-translated-to-physical-
memory.html

Paging in Operating System. (2019, August 16). Retrieved May 16, 2021, from
https://www.geeksforgeeks.org/paging-in-operating-system/

You might also like