www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# CS604 Assignment No. 2 Spring 2020 Due date 14-06-2020

Question No 01                                                                                15 marks

Consider the following set of processes, with the CPU burst time given in milliseconds:

Process                Burst Time

P1                                   10

P2                                   1

P3                                   2

P4                                   1

P5                                   5

The processes are arrived in the order P1, P2, P3, P4, P5, all at time 0.

1. Draw Gantt chart showing the execution of these processes using FCFS and SJF scheduling.
2. Calculate the turnaround time of each process for FCFS scheduling algorithm as per part Calculation of part A?
3. Calculate the waiting time of each process for SJF scheduling algorithm as per calculation of Part A?

Wish you very Best of Luck!

Views: 803

Attachments:

### Replies to This Discussion

CS604_Assignment_No_02_Solution_Spring_2020

CS604_Assignment_No_02_Solution_Spring_2020

# CS604 Assignment 2

CS604(Operating system)
Assignment No 02

Question # 01:

Consider the following set of processes, with the CPU burst time given in milliseconds:

Process Burst Time
P1 10
P2 1
P3 2
P4 1
P5 5

The processes are arrived in the order P1, P2, P3, P4, P5, all at time 0.

A. Draw Gantt chart showing the execution of these processes using FCFS and SJF scheduling.
B. Calculate the turnaround time of each process for FCFS scheduling algorithm as per part Calculation of part A?
C. Calculate the waiting time of each process for SJF scheduling algorithm as per calculation of Part A?

A. Draw Gantt chart showing the execution of these processes using FCFS and SJF scheduling.

As given:
Process Arrival Time CPU Burst time (Milliseconds)
P1 0 10
P2 0 1
P3 0 2
P4 0 1
P5 0 5

Gantt chart using FCFS scheduling:

P1 P2 P3 P4 P5

10 11 13 14 19

Gantt chart using SJF scheduling:

P2 P4 P3 P5 P1

0 1 2 4 9 19

B. Calculate the turnaround time of each process for FCFS scheduling algorithm as per part Calculation of part A?

Process Arrival Time(AT)(Milliseconds) CPU Burst Time(BT)
(Milliseconds) Completion Time(CT)(Milliseconds) Turnaround Time(TAT = CT-AT)(Milliseconds)
P1 0 10 10 10 – 0 = 10
P2 0 1 11 11 – 0 = 11
P3 0 2 13 13 – 0 = 13
P4 0 1 14 14 – 0 = 14
P5 0 5 19 19 – 0 = 19

C. Calculate the waiting time of each process for SJF scheduling algorithm as per calculation of Part A?

Process Arrival Time (AT) (Milliseconds) CPU Burst Time (BT)
(Milliseconds) Completion Time (CT) (Milliseconds) Turnaround Time (TAT = CT-AT) (Milliseconds) Waiting Time (WT = TAT - BT)
(Milliseconds)
P1 0 10 19 19 – 0 = 19 19 –10 = 9
P2 0 1 1 1 – 0 = 1 1 –1 = 0
P3 0 2 4 4 – 0 = 4 4 –2 = 2
P4 0 1 2 2 – 0 = 2 2 –1 = 1
P5 0 5 9 9 – 0 = 9 9 –5 = 4

1

2

3

4

5

## VIP Member Badge & Others

------------------------------------

## Latest Activity

Ammara Sabir posted a discussion

### @@@@لوگ مجھے بے حس کہتے ہیں****

10 minutes ago
Ammara Sabir liked 刀のの尺's discussion سامنے ہین ہم مگر! نظر آئین کس کو
20 minutes ago
Ammara Sabir liked 刀のの尺's discussion سامنے ہین ہم مگر! نظر آئین کس کو
20 minutes ago
Mani Siddiqui posted a status
"عین ممکن ہے کہ مجھ ہی میں کمی ہو لیکن سامنے آئے....محبت جسے راس آئی ہے"
23 minutes ago
Mani Siddiqui posted a status
"اُڑتے اُڑتے دُور اُفق میں آس کا پنچھی ڈوب گیا روتے روتے بیٹھ گئی آواز کسی سودائی کی"
24 minutes ago
Mani Siddiqui posted a status
"خوش دعوتِ یاراں بھی ہے ۔۔۔ یلغارِ عدو بھی کیا کیجیے دل کا ۔۔۔ جو کم آمیز بہت ہے"
25 minutes ago
Mani Siddiqui posted a status
"جس مصور کی نہیں بکتی کوئی بھی تصویر میری تصویر بنائے گا تو چھا جائے گا"
26 minutes ago
Mani Siddiqui posted a status
"کوٸی دشمن کو یوں نہ دیکھے گا جیسے قسمت کو دیکھتا ہوں میں"
30 minutes ago