In: Computer Science
Given a system with 512G bytes of address space per process, 2G bytes of physical memory, and pages of size 2K bytes. How bits are needed to specify the offset?
Select one:
a. 39
b. 28
c. 11
d. 20
Given a system with 4M bytes of address space per process, 8M bytes of physical memory, pages of size 8K bytes, and page table entries of 4 bytes. How many entries can fit in one page?
Select one:
a. 8K
b. 2K
c. 4
d. 1K
Solution:
(1)
Given,
=>Logical address space size = 512 GB
=>Physical address space size = 2 GB
=>Page size = 2 KB
The answer will be an option,
(c) 11
Explanation:
Logical address:
Page number | Page offset |
11 bits
Physical address:
Frame number | Frame offset |
11 bits
Calculating number of bits for offset:
=>We know that frame size = page size and number of bits required for page offset and frame offset will be equal.
=>Number of bits required for page offset = log2(page size in bytes)
=>Number of bits required for page offset = log2(2 KB)
=>Number of bits required for page offset = log2(2*2^10 B) as 1 KB = 2^10 B
=>Number of bits required for page offset = log2(2^11)
=>Number of bits required for page offset = 11 bits
=>Number of bits required for frame offset = 11 bits
=>Hence option (c) is correct and other options are incorrect.
(2)
Given,
=>Logical address space size = 4 MB
=>Physical address space size = 8 MB
=>Page size = 8 KB
=>Page entry size = 4 bytes
The answer will be an option,
(b) 2k
Explanation:
Calculating number of entries in 1 page:
=>Number of entries in one page = page size/entry size
=>Number of entries in one page = 8 KB/4 B
=>Number of entries in one page = 8*2^10 B/4 B as 1 KB = 2^10 B
=>Number of entries in one page = 2^13 B/2^2 B
=>Number of entries in one page = 2^11
=>Number of entries in one page = 2*2^10
=>Number of entries in one page = 2 K as 1 K = 2^10
=>Hence option (b) is correct and other options are incorrect.
I have explained each and every part with the help of statements attached to it.