Professional Documents
Culture Documents
Assessment Instrument: Final Exam Assignment Due Date: 26th Nov 2020
This assessment instrument assesses the following Course Learning Outcomes (CLO):
1
Question No 1:
For the give below scenario of four CPU processes arriving at different times with
different burst time and priority.
P1 A1 B1 P1
P2 A2 B2 P2
P3 A3 B3 P3
P4 A4 B4 P4
Student ID number is S0000001686, then Arrival Time, Burst Time and Priority are
calculated using given below table
Gant charts
Gant chart using First Come First Serve (FCFS):
Using Given table:
P1 P2 P3 P4
0 11 77 165 177
1
Gant chart using Shortest Job First (SJF): -
Using Given Table:
P1 P4 P2 P3
0 11 23 89 117
2. Calculate the average waiting time for various CPU scheduling algorithm [3
Marks]
Ans:
Case1: First Come First Serve (FCFS) Scheduling algorithm
Given table:
Processor Arrival Burst Priority
s Time (A) Time (B) (P)
P1 1 11 2
P2 6 66 10
P3 8 88 7
P4 6 12 8
2
Hence, waiting time for P1 will be 0
P1 requires 11 ms for completion, hence waiting time for P2 will be 11 ms
Similarly, waiting time for process P3 will be execution time of P1 + execution time
for P2, which will be (11 + 66) ms = 77 ms.
For process P4 it will be the sum of execution times of P1, P2 and P3.
The GANTT chart above perfectly represents the waiting time for each process.
3
Question No 2:
Calculate the total head movement with detailed head movement diagram of the given
Queue for various below mentioned Disk Scheduling Algorithm
Case1: FCFS Scheduling [2 Marks]
Case2: SSTF Scheduling [2 Marks]
Case3: SCAN Scheduling [2 Marks]
ANS:
Case 1: Using FCFS
Given Queue = 110,56,150,60,180,30,90,58
Starting head = 60
Diagram
4
Now calculate total heads
Diagram
Instructions: