Answer to Question #79215 in Assembler for Pavan

Question #79215
Consider a physical memory of size 2128 KB which is managed by buddies’ scheme. Suppose a set of four programs namely P, Q, R and S demand memory requirement of size 1030KB, 520KB, 70 KB and 130 KB respectively. What would be the size of the memory blocks allocated to these four programs? Is it fair allocation? Justify.
1
Expert's answer
2018-07-20T15:39:08-0400
In this system, memory is only allocated in units that are powers of two. So if 3 bytes are requested you get 4, and if 1030 KB are requested you get 2048 KB. This does lead to wasted space (internal fragmentation).

Program P (1030 KB). It is necessary to allocate a memory of 2048 KB (2n, n=11)
Program Q (520 KB). It is necessary to allocate a memory of 1024 KB (2 n, n=10)
Program R (70 KB). It is necessary to allocate a memory of 128 KB (2 n, n=7)
Program S (103 KB). It is necessary to allocate a memory of 256 KB (2 n, n=8)

To place P, Q, R, and S programs you need 1723 KB:
P (1030 KB)+ Q (520 KB) + R (70 KB) + S (103 KB) = 1723 KB

If the physical memory of size 2128KB is managed by buddies’ scheme, then a set of four programs, namely P, Q, R and S, requires 3456 KB:
P (2048 KB)+ Q (1024 KB) + R (128 KB) + S (256 KB) = 3456 KB

If the physical memory has a size of 2128 KB, which is managed by buddies’ scheme, then only Q, R and S programs can be placed in it. For a P program of 1030 KB, there will not be enough memory space. This is unfair.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS