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

A program has 4000 instructions. Some instruction contents are shown in the diag

ID: 3582624 • Letter: A

Question

A program has 4000 instructions. Some instruction contents are shown in the diagram. If this program is run on a paged machine with only 2K physical memory and 1K page size. When the program ends, the content of physical address 0000 is and the content of physical address 1000 is If the same program is run on the same paged machine with 2K physical memory, but the page size is changed to 0.5K. When the program ends, the content of physical address 0000 is and the content of physical address 1000 is

Explanation / Answer

2 k Physical memory means it can hold 256 addresses and can have 256 bytes of contents..

1 k page size means 1024 bytes/8 = 128 bytes we can have 2 pages in physical memory(128*2= 256)

for 4000 instructions , pages needed is 4000/128 (this is one page) =31 .25 as each page is 128 ,31* 128 bytes = 3968 instruction + 32 more instruction in next page = 31+1 page , ie 32 pages total.

Content of physcial address 0000 is 3969th instruction.

So for 1000 address , pages required can be = 1000/128 = 7.815 = 7 pages for 896 instructions+ 104 instruction in one more page = 8 pages total.

Content of physical adress 1000 is JMP 2000 as 7th page's 3000 address has JMP 2000 instruction.

2. )

2k Physical memory means it can hold 256 addresses and can have 256 bytes of contents..

0.5 k page size means 512/8 =64 bytes ,we can have 4 pages in physical memory.

for 4000 instructions , pages needed is 4000/64(this is one page) =62 .5 as each page is 64 byte,64bytes * 62 pages = 3968 instruction + 32 more instruction in next page = 62 +1 , ie 63 pages total.

Content of physcial address 0000 is 3969th instruction.

So for 1000 address , pages required can be = 1000/64 =15.625 = 15 * 64 instructions+ 40 instruction in one more page = 960 + 40 = 16 pages required.

Content of physical adress 1000 is JMP 2000 as 15th page's 3000 address has JMP 2000 instruction.

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