3. Illustrate and find the page number with the displacement of a given program line.
Job1 is 1600 lines long
PS=200 and LNTBL=542
200/542=0.3690037 it is in line 0.
3. Illustrate and find the page number with the displacement of a given program line.
Job1 is 1600 lines long
PS=200 and LNTBL=542
200/542=0.3690037 it is in line 0.
1. Given the following information:
Table 1A
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
J4 | 850KB |
J5 | 610KB |
Memory Block | Size |
1132 | 700KB |
1003 | 720KB |
1114 | 800KB |
2310 | 750KB |
1755 | 610KB |
a. a.Use the best-fit algorithm to allocate the memory blocks to the five arriving jobs.
b. b.Use the first-fit algorithm to allocate the memory blocks to the five arriving jobs.
c. c.Use the next-fit algorithm to allocate the memory blocks to the five arriving jobs.
d. d.Use the worst-fit algorithm to allocate the memory blocks to the five arriving jobs.
AA answer:
a. Best-fit algorithm
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
(*IDLE)
Memory List
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | J1 | 700KB | BUSY | 0 |
1003 | 720KB | J2 | 500KB | BUSY | 120KB |
1114 | 800KB | | | | |
2310 | 750KB | J3 | 740KB | BUSY | 10KB |
1755 | 610KB | J5 | 610KB | BUSY | 0 |
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
Memory List
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | J1 | 700KB | BUSY | 0 |
1003 | 720KB | J2 | 500KB | BUSY | 120KB |
1114 | 800KB | J3 | 740KB | BUSY | 60KB |
2310 | 750KB | J5 | 610KB | BUSY | 140KB |
1755 | 610KB | | | | |
c. Next-fit algorithm
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
(* IDLE)
Memory List
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | J2 | 500KB | BUSY | 200KB |
1003 | 720KB | J1 | 700KB | BUSY | 20KB |
1114 | 800KB | J5 | 610KB | BUSY | 190KB |
2310 | 750KB | J3 | 740KB | BUSY | 10KB |
1755 | 610KB | | | | |
d.Worst- fit algorithm
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
*J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
a. (* IDLE)
Memory Block
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | | | | |
1003 | 720KB | J5 | 610KB | BUSY | 110KB |
1114 | 800KB | J1 | 700KB | BUSY | 100KB |
2310 | 750KB | J2 | 500KB | BUSY | 250KB |
1755 | 610KB | | | | |
2. 2.Given the following information:
Table 2A
Job Number | Memory Requested |
J1 | 30KB |
J2 | 50KB |
J3 | 30KB |
J4 | 25KB |
J5 | 610KB |
Table 2B
ORIGINAL STATE OF MAIN MEMORY |
100KB(P1) |
25KB(P2) |
25KB(P3) |
50KB(P4) |
30KB(P5) |
a.
a. a.Create a memory layout for the fixed partition
After job entry based on the given information
(Table 2A and Table 2B)
b. b.Before Job 6(30KB) and Job 7(45KB) arrives,
There are three jobs done ready for processing
which J2, J3, J4. Create an initial memory layout
for dynamic partition based on the given information
(Table 2A).Ans:
a. a.Fixed partition. J5 is idle.
AFTER JOB ENTRY |
30KB(J1) |
|
25KB(J4) |
50KB(J2) |
30KB(J3) |
a.
b.Dynamic Partition
Before New Job Entry |
3OKB(J1) |
|
25KB FREE |
50KB FREE |
30KB FREE |
After New Job Entry |
3OKB(J1) |
|
25KB FREE |
45KB(J7) |
30KB(J6) |