The question is from: Operating Systems (8th Ed.), Chapter 7, Problem 13P. Pleas
ID: 3807840 • Letter: T
Question
The question is from: Operating Systems (8th Ed.), Chapter 7, Problem 13P.
Please answer the question in steps.
Write the binary translation of the logical address 0001010010111010 under the following hypothetical memory management schemes, and explain your answer: a. a paging system with a 256-address page size, using a page table in which the frame number b. a segmentation system with a 1 K-address maximum segment size, using a segment table in which bases happen to be regularly placed at real addresses: 22 + 4,096 + segment #Explanation / Answer
a)
Given logical address is 0001 0100 1011 1010 (16 bits).
Page size is = 256 address
= 256 * size of 1 address
= 256 * 16 bits
= 256 * 2 Bytes
= 512 Bytes
Hence Page size is = 512 Bytes.
= 29 Bytes
Hence offset is = 9 bits.
Here page number bits is = Total address bits - offset bits
= 16 - 9
= 7
Hence page number bits is = 7.
Here from the address the 1st 7 bits is = 0001010
= 10 = page number
Here frame number is 4 times smaller than page number hence number
of bits requried to represent a frame is = 5 bits , below is the explanation
with 7 bits maximum number is 127 and when it is divided by 4 we will get
31 for which we need 5 bits to represent.
So frame number is = page number / 4 = 10 / 4 = 2
= 00010 (when represented in 5 bit binary)
from the address the last 9 bits is = 010111010 = offset
So the logical address translation to physical address is = frame number + offset
= 00010 010111010
Hence the physical address after translation is = 00010010111010.
(b)
Given logical address is 0001 0100 1011 1010 (16 bits).
Segment size is = 1K address
= 1K * size of 1 address
= 1K * 16 bits
= 1K * 2 Bytes
= 2 KB
Hence Segment size is = 2 KB.
= 211 Bytes
Hence offset is = 11 bits.
Here segment number bits is = Total address bits - offset bits
= 16 - 11
= 5
Hence segment number bits is = 5.
Here from the address the 1st 5 bits is = 00010
= 2 = segment number
Here the real address is = 22 + 4096 + segment #
= 22 + 4096 + 2
= 4120
Hence the real address is = 4120.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.