0% found this document useful (0 votes)
51 views7 pages

Moralde Justine Assignment 2

The document provides information about CPU scheduling algorithms including First Come First Serve (FCFS), Shortest Job First (SJF), Non-Premptive Priority (NPP), and Shortest Remaining Time First (SRTF). It includes a table with job information such as arrival time and burst time. The document asks to provide the Gantt chart, turnaround time, and waiting time for each algorithm and job using the given data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views7 pages

Moralde Justine Assignment 2

The document provides information about CPU scheduling algorithms including First Come First Serve (FCFS), Shortest Job First (SJF), Non-Premptive Priority (NPP), and Shortest Remaining Time First (SRTF). It includes a table with job information such as arrival time and burst time. The document asks to provide the Gantt chart, turnaround time, and waiting time for each algorithm and job using the given data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Assignment – CPU Scheduling Grade:

Name:Justine L. Moralde Algorithms (Single Queue)

Based on the given data, provide the Gantt Chart and calculate the turn-around time and waiting time
of each job (include the average turn-around and average waiting time) using the following algorithms:

A. First Come First Serve FCFS D. Shortest Remaining Time First SRTF
B. Shortest Job First SJF E. Pre-emptive Priority PP
C. Non Pre-emptive Priority NPP F. Round Robin q = 5 RR q= 5

Jobs Arrival Time Burst Time Priority


A 0 11 5
B 4 5 2
C 10 4 3
D 30 9 4
E 6 15 1
F 14 13 6
G 26 11 3
H 27 2 2
I 8 3 1

1 Single Queue Set 3


Assignment – CPU Scheduling Grade:
Name:Justine L. Moralde Algorithms (Single Queue)

FIRST COME FIRST SERVE


Job Arrival Time Burst           ET          WT
s Time TT
A 0 11         11 11 0
B Job Arrival
4 Time 5 Burst        23
          TT 19     WT14
C s 10 4 Time        ET  8 4
A 0 11 11 11 0
A B E I C
18                F G H D
D B 30 4 9 5 1647 12 17 7 8
0 11 16
E C 6 10 15 4 3873 28 67 24 52
31 34 F D 14 30 13 9 7336 43 22 34 9 38 51
62 G E 26 6 11 15 3158 25 32 10 21 64 73
H F 27 14 2 13 5138 37 11 24 9
I G 8 26 3 11         14 62 36         6 25        3
FCFS: H 27 2 64 37 35
ATT = I 8 3 34              23 225/9 = 28.33
26
AWT = 182/9 = 20.22

SHORTEST JOB FIRST

A I C B F H D G E
0 11 14 18 23 36 38 47 58
73

SJF:
ATT = 193/9 = 21.44
AWT = 120/9 = 13.33

2 Single Queue Set 3


Assignment – CPU Scheduling Grade:
Name:Justine L. Moralde Algorithms (Single Queue)

NON-PREEMPTIVE PRIORITY

Job Arrival Time Burst     Priority       ET            WT


s Time TT                 
A 0 11     5       11         11    0
B 4 5     2              30     25
34
C 10 4                   30     26
3             40
D 30 9     4              30     21
60
E 6 15     1              20    5
26
F 14 13     6              59     46
73
G 26 11     3              25     14
A E I B H C51 G D F
0      H 27 2     2       36     9    7 11    
26      I 8 3     1       29       21       18 29     
34      36     40     51      60      73   

3 Single Queue Set 3


Assignment – CPU Scheduling Grade:
Name:Justine L. Moralde Algorithms (Single Queue)

NPP:
ATT = 235/9 = 26.11
AWT = 162/9 = 18

SHORTEST REMAINING TIME FIRST

Job Arrival Time Burst                WT


s Time ET TT
A 0 11 23 23 12
B 4 5 9 5 0
C 10 4 16 6 2
D 30 9 47 17 8
E 6 15 73 67 52
F 14 13 38 24 11
G 26 11 58 32 21
H 27 2 29 2 0
I 8 3 12     4     1

A B I C A F H F D G E
0   4        9        12       16     23     27   29       38     47     58      73

SRTF:
ATT = 180/9 = 20
AWT = 107/9 = 11.89

4 Single Queue Set 3


Assignment – CPU Scheduling Grade:
Name:Justine L. Moralde Algorithms (Single Queue)

Job Arrival Time Burst     Priority       ET            WT


s Time TT                 
A 0 11     5       60         60       49
B 4 5     2              23     18
27
C 10 4                   23     19
3             33
D 30 9     4              23     14
53
E 6 15     1              15    0
21
F 14 13     6              59     46
73
G 26 11     3              18   7
44
PRE- H 27 2     2       29     2    0
I 8 3     1       24       16       13
EMPTIVE PRIORITY

A B E I B H C G D A F 0     
4       
6    21      24     27      29     33      44      53       60      73   

PP:

ATT = 239/9 = 26.56

AWT = 166/9 = 18.44

5 Single Queue Set 3


Assignment – CPU Scheduling Grade:
Name:Justine L. Moralde Algorithms (Single Queue)

ROUND ROBIN Q=5


Job Arrival Time Burst     Priority       ET            WT
s Time TT                 
A 0 11     5       33         33     22
B 4 5     2          6   1
10
C 10 4                   17     13
3             27
D 30 9     4              39     30
69
E 6 15     1              54       39
60
F 14 13     6              58     45
72

A BG A 26
E I C11 F     3
A E G H    D    47 F E G    36
    
73 D F G
0 H 27 2     2       45         18       16 5
10 I 8 3     1       23       15       12 15
20 23
27 32 33 38 43 45 50 55 60 65 69 72 73

RR Q = 5:

6 Single Queue Set 3


Assignment – CPU Scheduling Grade:
Name:Justine L. Moralde Algorithms (Single Queue)

ATT = 287/9 = 31.89

AWT = 214/9 = 23.78

7 Single Queue Set 3

You might also like