We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

# 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!

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 733

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

## Latest Activity

mahnoor omar, Maira Qurxam, Mr.Right and 24 more joined Virtual University of Pakistan
30 minutes ago
1 hour ago
Hacker updated their profile
1 hour ago
Imtiaz Waqar added a discussion to the group STA630 Research Methods

### GDB No. 1 STA630 - Research Methods

3 hours ago
Imtiaz Waqar joined +M.Tariq Malik's group

3 hours ago

### MTH202 Discrete Mathematics

4 hours ago
4 hours ago
4 hours ago
Maria joined +M.Tariq Malik's group

### EDU101 Foundations of Education

4 hours ago
Maria and SafeerZaidi are now friends
4 hours ago
SafeerZaidi liked Maria's profile
4 hours ago
Tasha Malik posted a status
"Bio 201 Assignment # 2 Solution https://youtu.be/Gowjc67WZ4c"
5 hours ago
Maria liked +M.Tariq Malik's profile
6 hours ago
Maria left a comment for +M.Tariq Malik
6 hours ago
Blessings posted a status
"Kya khbr k ab wo khan rehta hai...........................Khush rhe yar jhan rehta hai"
7 hours ago
7 hours ago
Virtual Educators Academy posted a discussion

### CS619 Final Projects (Python language) Discussions

7 hours ago
Virtual Educators Academy updated their profile
7 hours ago
☆ Tina Solangi ☆ updated their profile
8 hours ago
8 hours ago