Ex08
Ex08
Given a contiguous memory allocation system, suppose a process has the base and
limit registers with
the corresponding values of (18680, 1260). Calculate the physical address of the
following references:
12,-26,678, 1272
Problem 2
Suppose the page size is 1KB in a (1-level) paging system. A proces has the size of
157 KB, calculate
(page, offset) of the following logical address: 78, 1346, 8184, 126868, 183242
Problem 3
Given the page table of a process (16, 92, 3, 87). Suppose the page size is 1KB in
a (1-level) paging
system, calculate the physical address of the following reference: 124, 8672, 3246,
4782,
124 -> page = 124 / 1024 = 0, offset = 124 % 1024 = 124 -> physical address = 16 *
1024 + 124 = 16508
8672 -> page = 8672 / 1024 = 8, Invalid reference (8 is greater than the number of
pages, 3)
3246 -> page = 3246 / 1024 = 3, offset = 3246 % 1024 = 174 -> physical address = 87
* 1024 + 174 = 89262
4782 -> page = 4782 / 1024 = 4, Invalid reference (4 is greater than the number of
pages, 3)
Problem 4
Given a paging system with the page size of 2KB in a (1-level) paging system. The
address register is 32
bit. Identify the number of bits for (page, offset) in the address register.
page size = 2KB = 2048 bytes = 2^11 bytes -> 11 bits for offset
Given a paging system with the page size of 4KB in a (1-level) paging system. The
address register is 42
bit. Identify the number of bits for (page, offset) in the address register.
page size = 4KB = 4096 bytes = 2^12 bytes -> 12 bits for offset
Problem 6
Given the page table of a process in the form of (frame, valid) [(16, v), (92, i),
(3, v), (87, v)] in a (1-level)
paging system. Suppose the page size is 1KB, calculate the physical address of the
following reference:
124, 8672, 3246, 4782,
124 -> page = 124 / 1024 = 0, offset = 124 % 1024 = 124, valid -> physical address
= 16 * 1024 + 124 = 16508
8672 -> page = 8672 / 1024 = 8 -> invalid reference
3246 -> page = 3246 / 1024 = 3, offset = 3246 % 1024 = 174, valid -> physical
address = 87 * 1024 + 174 = 89262
4782 -> page = 4782 / 1024 = 4 -> invalid reference
Problem 7
Given the page table containing the page-frame mapping [16, 92, 3, 87, 723].
Suppose the page size is
1KB in a (1-level) paging system, calculate the physical address of the following
reference: 124, 8672,
3246, 4782,
124 -> page = 124 / 1024 = 0, offset = 124 % 1024 = 124 -> physical address = 16 *
1024 + 124 = 16508
8672 -> page = 8672 / 1024 = 8, invalid reference
3246 -> page = 3246 / 1024 = 3, offset = 3246 % 1024 = 174 -> physical address = 87
* 1024 + 174 = 89262
4782 -> page = 4782 / 1024 = 4, offset = 4782 % 1024 = 686 -> physical address =
723 * 1024 + 686 = 741038
Problem 8
Given the segment table of a process in the form of (base, limit) [(16000, 1200),
(18000, 4700), (28900,
200)]. Calculate the physical address of the following reference in the form of
(segment, offset): (0, 868),
(0, 124), (1, 900), (2, 86)
(0, 868) -> segment = 0, offset = 868 -> physical address = 16000 + 868 = 16868
(0, 124) -> segment = 0, offset = 124 -> physical address = 16000 + 124 = 16124
(1, 900) -> segment = 1, offset = 900 -> physical address = 18000 + 900 = 18900
(2, 86) -> segment = 2, offset = 86 -> physical address = 28900 + 86 = 28986
Problem 9
Given the segment table of a process in the form of (base, limit, valid) [(16000,
1200, v), (18000, 4700, i),
(28900, 2100, v)]. Calculate the physical address of the following reference in the
form of (segment,
offset): (0, 868), (0, 124), (1, 900), (2, 86)
(0, 868) -> segment = 0, offset = 868 , valid -> physical address = 16000 + 868 =
16868
(0, 124) -> segment = 0, offset = 124 , valid -> physical address = 16000 + 124 =
16124
(1, 900) -> segment = 1, offset = 900 , invalid -> invalid reference
(2, 86) -> segment = 2, offset = 86 , valid -> physical address = 28900 + 86 =
28986