Question 1:
Let as consider a female Shabnam working in a beauty parlor. Shabnam use to do make only. In beauty parlor there are two rooms. One room is called make up room and the second room is called rest room. Rest room is used for waiting and the Make up room is used for make up. In make up room Shabnam do make of a female client (only one at a time) and in the rest room female clients keep waiting for their turns. Beauty parlor has n number of sofas in rest room. And the make up room contains the sofa for Shabnam. When there will be no female client to be served then Shabnam will start sleeping on her sofa. But if a female client enters beauty parlor and she finds that no sofa is empty i.e. they are all occupied then female client will leave the beauty parlor. However, if a female client enters beauty parlor and she finds that Shabnam is doing a make up of any other female client then she will sit on one of the available sofa in beauty parlor. However, if a female client enters beauty parlor and she finds that Shabnam is sleeping then female client will wake up Shabnam.

You need to write a C program or Pseudo code that uses semaphores, wait and signal operations to SYNCHRONIZE Shabnam and female client.
Question 2:
Q. Let us consider a page size of 16 bytes and process address space of 32 pages and physical address space of 64 frames. Calculate the following.
a) Number of bits needed for ‘p’.
b) Number of bits needed for ‘f’.
c) Number of bits needed for ‘d’.
d) Size of logical address i.e. Number of bits needed to uniquely identify a page in this address space of 16
pages.
e) Logical address in bits for (18, 10). Where ‘p’ and ‘d’ are 18 and 10 respectively.

Sponsored Links