Term
A computer has 4 GiB of RAM with a page size of 8KiB. Processes have 1 GiB address spaces:
- How many bits are used for physical addresses?
- How many bits are used for logical addresses?
- How many bits are used for logical page numbers?
|
|
Definition
- 2^2 * 2^30 = 2^32. So 32-bit physical addresses
- 2^30. 30-bit logical addresses
- (2^30)/(2^13) = 2^17. So 17 bits are used for logical page numbers
|
|
|
Term
Logical addresses are 44-bit, and a process can have up to 2^27 pages. What is the page size? |
|
Definition
2^44 / 2^27 = 2^17 bytes = 128 KiB in a page |
|
|
Term
On my copmuter the page size is 16 KiB, and my process' address space is 4GiB. How many bits are used for the page number in a logical address? |
|
Definition
2^32 / 2^14 = 2^18 pages. So 18-bit pages. |
|
|
Term
A computer has 32-bit physical addresses. The logical page number of a logical address is 14-bit. A process can have up to a 2GiB address space. Let’s consider a process with currently a 1GiB address space (i.e., it can get up to another 1GiB during execution).
- What is the page size
- How many entries are there in the process; page table?
|
|
Definition
- How many bytes in 2GiB (the max address space): 231
Therefore: 31-bit logical addresses
Therefore: 31 - 14 = 17-bit offsets
Therefore: 2^17 bytes in a page
Therefore: 128KiB pages
- The process has a 1GiB = 230-byte address space
Number of pages in the address space: 2^30 / 2^17 = 2^13
Therefore: there are 2^13 entries in the page table (one entry per page)
|
|
|
Term
Logical addresses are 40-bit, and a process can use at most 1/4 of the physical RAM.
- How big is the RAM?
- A process has at most 2^22 pages on this system. How many bits are used for the “offset” part of logical addresses?
|
|
Definition
- With 40-bit logical addresses, an address space is at most 240 bytes. So the RAM is 4 times as big: 242 bytes which is 4TiB
- Since we have 2^22 pages, 22 bits are used for the page number. Therefore 40 - 22 = 18 bits are used for the offset
|
|
|