To Implement CPU Scheduling Algorithms

Procedure

A. First Come First Serve or Shortest Job First:

  1. Enter the number of processes (n) you want for scheduling and click the SUBMIT button.
  2. Input the arrival time (range: 0 to 20) and burst time (range: 1 to 20), then click the SUBMIT button to add the processes to the table.
  3. Repeat the step 2 for all processes (n).
  4. Click the PLOT button to generate the Gantt chart.
  5. After the chart is created, complete the table using the following formulas:

    Completion Time = Start Time (from the chart) + Burst Time

    Turn Around Time (TAT) = Completion Time - Arrival Time

    Waiting Time (WT) = Turn around time - Burst Time

  6. To verify the entered values, click the CHECK button.
  7. Calculate the average TAT by entering the required values from the table and click the SUBMIT button.
  8. Calculate the average WT by entering the required values from the table and click the SUBMIT button.
  9. Click the PRINT button to print the page.
  10. Note: When multiple processes have the same arrival time, a tie-breaker is implemented using the process ID. The process with the lower ID is chosen to determine the execution order.

B. Round Robin:

  1. Enter the number of processes (n) you want for scheduling and click the SUBMIT button.
  2. Enter the quantum time (range: 2 to 5 units), then click the SUBMIT button.
  3. Input the arrival time (range: 0 to 20) and burst time (range: 1 to 20), then click the SUBMIT button to add the processes to the table.
  4. Repeat step 3 for all processes (n).
  5. Click the PLOT button to generate the Gantt chart.
  6. After the chart is created, complete the table using the following formulas:

    Completion Time (CT) = Refer to the Gantt chart

    Turn Around Time (TAT) = Completion Time - Arrival Time

    Waiting Time (WT) = Turn around time - Burst Time

  7. To verify the entered values, click the CHECK button.
  8. Calculate the average TAT by entering the required values from the table and click the SUBMIT button.
  9. Calculate the average WT by entering the required values from the table and click the SUBMIT button.
  10. Click the PRINT button to print the page.
  11. Note: In cases where multiple processes have the same arrival time, a tie-breaker is implemented using the process ID. The process with the lower ID is chosen to determine the execution order.

C. Priority:

  1. Enter the number of processes (n) you want for scheduling and click the SUBMIT button.
  2. Input the arrival time (range: 0 to 20), burst time (range: 1 to 20), and priority (range: 1 to 10), then click the SUBMIT button to add the processes to the table.
  3. Repeat step 2 for all processes (n).
  4. Click the PLOT button to generate the Gantt chart.
  5. After the chart is created, complete the table using the following formulas:

    Completion Time (CT) = Start Time (from the chart) + Burst Time

    Turn Around Time (TAT) = Completion Time - Arrival Time

    Waiting Time (WT) = Turn around time - Burst Time

  6. To verify the entered values, click the CHECK button.
  7. Calculate the average TAT by entering the required values from the table and click the SUBMIT button.
  8. Calculate the average WT by entering the required values from the table and click the SUBMIT button.
  9. Click the PRINT button to print the page.
  10. Note: When multiple processes have the same priority and arrival time, a final tie-breaker is implemented using the process ID, with the lower process ID chosen to determine the execution order.