<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS604 Assignment 2 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Operating Systems (CS604)<br />
Assignment # 02<br />
FALL 2019	<br />
Total marks = 20</p>
<p dir="auto">Deadline Date<br />
02.12.2019</p>
<p dir="auto">Please carefully read the following instructions before attempting assignment.</p>
<p dir="auto">RULES FOR MARKING<br />
It should be clear that your assignment would not get any credit if:<br />
	The assignment is submitted after the due date.<br />
	The submitted assignment file does not open or it is corrupt.<br />
	 The submitted assignment solution is copied from any other student or from the internet.</p>
<p dir="auto">You should consult the recommended books to clarify your concepts as handouts are not sufficient.</p>
<p dir="auto">You are supposed to submit your assignment in .doc or docx format.<br />
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.</p>
<p dir="auto">Objective:<br />
•	The objective of this assignment is to provide hands on experience of:<br />
Different Process Scheduling Algorithms in Operating System</p>
<p dir="auto">NOTE</p>
<p dir="auto">No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.</p>
<p dir="auto">If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.</p>
<p dir="auto">For any query, feel free to email at:<br />
<a href="mailto:cs604@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">cs604@vu.edu.pk</a></p>
<p dir="auto">Question No 01							       4+3+3=10 marks<br />
Assume you have to apply Shortest Job First (SJF) scheduling algorithms on the set of different processes given in the table below. The CPU burst time is also given for each process. Consider that all the processes arrive in the ready queue within time 0 seconds except P2 that arrive in ready queue within time 8 seconds. You are required to show the Gantt Chart to illustrate the execution sequence of these processes and calculate the Total Waiting Time and Average Waiting Time for the given processes by using SJF algorithm.</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Process</th>
<th>CPU Burst Time (seconds)</th>
</tr>
</thead>
<tbody>
<tr>
<td>P0</td>
<td>2</td>
</tr>
<tr>
<td>P1</td>
<td>6</td>
</tr>
<tr>
<td>P2</td>
<td>1</td>
</tr>
<tr>
<td>P3</td>
<td>4</td>
</tr>
<tr>
<td>P4</td>
<td>3</td>
</tr>
<tr>
<td>P5</td>
<td>8</td>
</tr>
</tbody>
</table>
<p dir="auto">Question No 02							       4+3+3=10 marks<br />
Consider a scenario where you have to apply Round Robin scheduling algorithm on the below given set of processes with each having a quantum size=8 milliseconds. The CPU burst time and arrival time for each process is also provided in the given table. You are required to show the Gantt Chart to illustrate the execution sequence of these processes. Moreover, calculate the Average Turnaround Time and Average Waiting Time for given processes by using round robin algorithm.</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Process</th>
<th>CPU Burst Time (Milliseconds)</th>
<th>Arrival Time(Milliseconds)</th>
</tr>
</thead>
<tbody>
<tr>
<td>P0</td>
<td>15</td>
<td>0</td>
</tr>
<tr>
<td>P1</td>
<td>8</td>
<td>4</td>
</tr>
<tr>
<td>P2</td>
<td>25</td>
<td>18</td>
</tr>
<tr>
<td>P3</td>
<td>18</td>
<td>5</td>
</tr>
</tbody>
</table>
<p dir="auto">Wish you very Best of Luck!</p>
]]></description><link>https://community.secnto.com//topic/580/cs604-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 19:59:34 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/580.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Nov 2019 12:38:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS604 Assignment 2 Solution and Discussion on Tue, 14 Jan 2020 06:43:26 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Solution:</strong><br />
<strong>Q. 1 Answer</strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>P0</th>
<th>P4</th>
<th>P3</th>
<th>P2</th>
<th>P1</th>
<th>P5</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>2</td>
<td>5</td>
<td>9</td>
<td>10</td>
<td>16</td>
<td>24</td>
</tr>
</tbody>
</table>
<p dir="auto">Total Waiting Time = 0+2+5+1+10+16 = 34 Seconds<br />
Average Waiting Time = 34/6 = 5.66 Seconds</p>
<p dir="auto"><strong>Q.2 Answer:</strong><br />
<strong>Solution 1:</strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>P0</th>
<th>P1</th>
<th>P3</th>
<th>P0</th>
<th>P2</th>
<th>P3</th>
<th>P2</th>
<th>P3</th>
<th>P2</th>
<th>P2</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>8</td>
<td>16</td>
<td>24</td>
<td>31</td>
<td>39</td>
<td>47</td>
<td>55</td>
<td>57</td>
<td>65</td>
<td>66</td>
</tr>
</tbody>
</table>
<p dir="auto">Turnaround time= Exit Time- Arrival Time</p>
<p dir="auto">Turnaround time for P0 = 31-0 =    31<br />
P1 = 16-4 = 	12<br />
P2 = 66-18 = 	48<br />
P3 = 57- 5= 	52</p>
<p dir="auto">Total Turnaround Time = 39+12+48+52 = 143<br />
Average Turnaround Time = 143 / 4 =35.75 millisecond</p>
<p dir="auto">Waiting Time= Turnaround Time- Burst Time</p>
<p dir="auto">Waiting time for 	P0 = 31-15 =	16<br />
P1 = 12-8 = 	4<br />
P2 = 48-25 = 	23<br />
P3 = 52-18 = 	34</p>
<p dir="auto">Total Waiting Time = 16+4+23+34 =77<br />
Average Waiting Time = 77 / 4 =19.25 millisecond</p>
<p dir="auto"><strong>Solution 2:</strong></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>P0</th>
<th>P1</th>
<th>P3</th>
<th>P2</th>
<th>P0</th>
<th>P3</th>
<th>P2</th>
<th>P3</th>
<th>P2</th>
<th>P2</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>8</td>
<td>16</td>
<td>24</td>
<td>31</td>
<td>39</td>
<td>47</td>
<td>55</td>
<td>57</td>
<td>65</td>
<td>66</td>
</tr>
</tbody>
</table>
<p dir="auto">Turnaround time= Exit Time- Arrival Time</p>
<p dir="auto">Turnaround time for    P0 = 39-0 = 	39<br />
P1 = 16-4 = 	12<br />
P2 = 66-18 = 	48<br />
P3 = 57- 5= 	52</p>
<p dir="auto">Total Turnaround Time = 39+12+48+52 = 151<br />
Average Turnaround Time = 151 / 4 =37.75 millisecond</p>
<p dir="auto">Waiting Time= Turnaround Time- Burst Time</p>
<p dir="auto">Waiting time for 	P0 = 39-15 =	24<br />
P1 = 12-8= 	4<br />
P2 = 48-25= 	23<br />
P3 = 52-18 = 	34</p>
<p dir="auto">Total Waiting Time = 24+0+5+29 = 85<br />
Average Waiting Time = 85 / 4 =21.25 millisecond</p>
]]></description><link>https://community.secnto.com//post/2646</link><guid isPermaLink="true">https://community.secnto.com//post/2646</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 14 Jan 2020 06:43:26 GMT</pubDate></item><item><title><![CDATA[Reply to CS604 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 14:15:40 GMT]]></title><description><![CDATA[<p dir="auto"><img src="https://i.imgur.com/32YEfs8.png" alt="0429f234-04e3-4c2d-b2a3-b5f590720cf9-image.png" class=" img-fluid img-markdown" /> <img src="https://i.imgur.com/Fv15umj.png" alt="fdaaf11a-d7a3-483c-b74f-9d4a2687728f-image.png" class=" img-fluid img-markdown" /> <img src="https://i.imgur.com/dAbeNGX.png" alt="68a890ce-9849-4b2c-a0fc-3e9122331e66-image.png" class=" img-fluid img-markdown" /> <img src="https://i.imgur.com/BiG7vmX.png" alt="56e21ff7-ed12-4b61-84cd-95d559e11d8e-image.png" class=" img-fluid img-markdown" /> <img src="https://i.imgur.com/j3IRhxd.png" alt="dcb7df31-c25a-4afd-9c6a-88e3768de039-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.secnto.com//post/2153</link><guid isPermaLink="true">https://community.secnto.com//post/2153</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 14:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to CS604 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 14:13:54 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/xFBvNppLmiU" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/xFBvNppLmiU</a></p>
]]></description><link>https://community.secnto.com//post/2152</link><guid isPermaLink="true">https://community.secnto.com//post/2152</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 14:13:54 GMT</pubDate></item><item><title><![CDATA[Reply to CS604 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 14:13:34 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/-jFGYDfWkXI" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/-jFGYDfWkXI</a></p>
]]></description><link>https://community.secnto.com//post/2151</link><guid isPermaLink="true">https://community.secnto.com//post/2151</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 14:13:34 GMT</pubDate></item><item><title><![CDATA[Reply to CS604 Assignment 2 Solution and Discussion on Tue, 03 Dec 2019 14:13:18 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/pYO-FAg-TpQ" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/pYO-FAg-TpQ</a></p>
]]></description><link>https://community.secnto.com//post/2150</link><guid isPermaLink="true">https://community.secnto.com//post/2150</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 03 Dec 2019 14:13:18 GMT</pubDate></item><item><title><![CDATA[Reply to CS604 Assignment 2 Solution and Discussion on Fri, 29 Nov 2019 11:31:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/zareen" aria-label="Profile: zareen">@<bdi>zareen</bdi></a> said in <a href="/post/1568">CS604 Assignment 2 Solution and Discussion</a>:</p>
<blockquote>
<p dir="auto">Assume you have to apply Shortest Job First (SJF) scheduling algorithms on the set of different processes given in the table below. The CPU burst time is also given for each process. Consider that all the processes arrive in the ready queue within time 0 seconds except P2 that arrive in ready queue within time 8 seconds. You are required to show the Gantt Chart to illustrate the execution sequence of these processes and calculate the Total Waiting Time and Average Waiting Time for the given processes by using SJF algorithm.</p>
</blockquote>
<p dir="auto"><img src="https://i.imgur.com/biyLIkV.png" alt="21575eba-4d3f-4d83-af20-c7706510fd8d-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.secnto.com//post/2021</link><guid isPermaLink="true">https://community.secnto.com//post/2021</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Fri, 29 Nov 2019 11:31:22 GMT</pubDate></item></channel></rss>