- Back to Home »
- Solutions »
- CS604 Assignment no 4 Fall 2012 Solution
Posted by : Anonymous
Friday, 4 January 2013
Part (a)
Process Arrival Time Burst Time
A 1.0 9
B 1.4 5
C 2.0 2
Gantt Chart:
Idle PC PB PA
Turnaround Times:
TA=18-1=17
TB=9-1.4=7.6
TC=4-2=2
Tavg=(17+7.6+2)/3
Tavg=8.667
So the average turnaround time comes out to be 8.667 time units.
Part (b)
Gantt Chart:
Idle PB PC PA
Waiting Times:
Waiting Time=Finish Time-CPU Burst Time-Arrival Time
for PA=17.5-9-1=7.5
for PB=6.5-5-1.4=0.1
for PC=8.5-2-2=4.5
0 2 4 9 18
0 1.5 6.5 8.5 17.5Average Waiting Time=(8+2.6+0)/3=4.034
Part (c)
Process Arrival Time Burst Time
A 1.0 9
B 1.4 5
C 2.0 2
D 3.0 1
Gantt Chart:
Idle PA PD PC PB PA
Waiting Times:
Waiting Time=Finish Time-CPU Burst Time-Arrival Time
for PA=18-9-1=8
PB=11-5-1.4=4.6
PC=6-2-2=2
PD=4-1-3=0
Average Waiting Time=(8+4.6+2+0)/4=3.65
Part (d)
Process Arrival Time Burst Time
A 1.0 9
B 1.4 5
C 2.0 2
Gantt Chart:
Idle PA PB Pc PA PB PA PB PA
0 1 3 4 6 11 18
0 3 5 7 9 11 13 15 16 19Quantum for round robin is 2
Waiting Times:
Waiting Time=Exit Time-CPU Burst Time-Arrival Time
for PA=19-9-1=9
PB=16-5-1.4=9.6
PC=9-2-2=5
Average Waiting Time=(9+9.6+5)/3
Average Waiting Time=7.86667