In: Computer Science
Given a system with 2T bytes of address space per process, 1T bytes of physical memory, and pages of size 32M bytes. How many entries are there in a linear page table?
Select one:
a. 64K
b. 32K
c. 32M
d. 1T
Given a system with 8G bytes of address space per process, 2M bytes of physical memory, and pages of size 2K bytes. How bits are needed to specify the virtual page number?
Select one:
a. 22
b. 10
c. 33
d. 21
Given a system with 512M bytes of address space per process, 4T bytes of physical memory, and pages of size 8K bytes. How rows are there in a linear page table?
Select one:
a. 4T
b. 512M
c. 64K
d. 1G
Solution:
(1)
Given,
=>Logical address space size = 2 TB
=>Physcial address space size = 1 TB
=>Page size = 32 MB
The answer will be an option,
(a) 64 K
Explanation:
Logical address:
Page number | Page offset |
16 bits 25 bits
Calculating number of bits for page offset:
=>Number of bits for page offset = log2(page size in bytes)
=>Number of bits for page offset = log2(32 MB)
=>Number of bits for page offset = log2(32*2^20 B) as 1 MB = 2^20 B
=>Number of bits for page offset = log2(2^25)
=>Number of bits for page offset = 25 bits
Calculating number of bits for page number:
=>Number of bits for page number = log2(logical address space size in bytes) - page offset bits
=>Number of bits for page number = log2(2TB) - 25
=>Number of bits for page number = log2(2*2^40 B) - 25 as 1 TB = 2^40 B
=>Number of bits for page number = 41 - 25
=>Number of bits for page number = 16 bits
Calculating number of entries in linear page table:
=>Number of entries in linear page table = page table size/entry size
=>Number of entries in linear page table = number of pages*frame number bits/frame number bits
=>Number of entries in linear page table = number of pages
=>Number of entries in linear page table = 2^page number bits
=>Number of entries in linear page table = 2^16 entries
=>Number of entries in linear page table = 64 K
=>Hence option (a) is correct and other options are incorrect.
(2)
Given,
=>Logical address space size = 8 GB
=>Physical address space size = 2 MB
=>Page size = 2 KB
The answer will be an option,
(a) 22
Explanation:
Logical address:
Page number | Page offset |
22 bits 11 bits
Calculating number of bits for page offset:
=>Number of bits for page offset = log2(page size in bytes)
=>Number of bits for page offset = log2(2 KB)
=>Number of bits for page offset = log2(2*2^10 B) as 1 KB = 2^10 B
=>Number of bits for page offset = log2(2^11)
=>Number of bits for page offset = 11 bits
Calculating number of bits for page number:
=>Number of bits for page number = log2(logical address space size in bytes) - page offset bits
=>Number of bits for page number = log2(8 GB) - 11
=>Number of bits for page number = log2(8*2^30 B) - 11 as 1 GB = 2^30 B
=>Number of bits for page number = 33 - 11
=>Number of bits for page number = 22 bits
=>Hence option (a) is correct and other options are incorrect.
(3)
Given,
=>Logical address space size = 512 MB
=>Physical address space size = 4 TB
=>Page size = 8 KB
The answer will be an option,
(c) 64 K
Explanation:
Logical address:
Page number | Page offset |
16 bits 13 bits
Calculating number of bits for page offset:
=>Number of bits for page offset = log2(page size in bytes)
=>Number of bits for page offset = log2(8 KB)
=>Number of bits for page offset = log2(8*2^10 B) as 1 KB = 2^10 B
=>Number of bits for page offset = log2(2^13)
=>Number of bits for page offset = 13 bits
Calculating number of bits for page number:
=>Number of bits for page number = log2(logical address space size in bytes) - page offset bits
=>Number of bits for page number = log2(512 MB) - 25
=>Number of bits for page number = log2(512*2^20 B) - 25 as 1 MB = 2^20 B
=>Number of bits for page number = 29 - 13
=>Number of bits for page number = 16 bits
Calculating number of rows in linear page table:
=>Number of rows in linear page table = linear page table size/entry size
=>Number of rows in linear page table = number of pages*frame number bits/frame number bits
=>Number of rows in linear page table = number of pages
=>Number of rows in linear page table = 2^page number bits
=>Number of rows in linear page table = 2^16 rows
=>Number of rows in linear page table = 64 K
=>Hence option (c) is correct and other options are incorrect.
I have explained each and every part with the help of statements attached to it.