Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider a computer that uses 16-bit addresses, ranging from 0 to 64K. The compu

ID: 3705226 • Letter: C

Question

Consider a computer that uses 16-bit addresses, ranging from 0 to 64K. The computer only has 32 KB of physical memory. Thus, programs can be written that use up to 64 KB of memory, but the programs cannot be loaded into memory in their entirety and run. A complete copy of a program's core image, up to 64 KB, must be present on the disk to allow pieces to be brought in as needed. a.) Assume the computer is using 4K pages. Of the 16-bits that hold an address, how many of them will be used for the page number and how many bits for the offset? b.) For each of the following decimal virtual addresses, compute the virtual page number and offset for a 4-KB page: 20000, 32768, 54000, 60000. turnin: c.) Repeat part a.) assuming 8K pages are being used. turnin: d.) Repeat part b.) assuming 8K pages are being used.

Explanation / Answer

part a: as we know that virtual address is a combination of

page number +offset within the page=no of bits in virtual address

page number + offset within the page=16 //16 bits address is given

since page size is 4k=4096=2^12 so 12 bits are required for offset

page number + 12=16

no. of bits for page number =16-12

so 4 bits will be used for page number

part b:  20000 in binary is equal to

0100111000100000

since least 12 bits are reserved for offset within the page and 4 most significant bits are for page number

so 12 least significant digits are 111000100000 and in decimal it is equal to 3616

and most significant 4 bits are 0100 which in decimal is 4

so page number is 4 and offset within the page is 3616

next one is 32768

in binary it is 1000000000000000

again from the same logic above

page number is 8 and offeset is 0

next one is 54000

from same logic page number is 13

offset within the page is 752

next one is 60000

page number =14

offset within the page=2656

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote