0% found this document useful (0 votes)
9 views2 pages

Round Robin Algorithm Exercise

This document presents an example of a Round Robin algorithm for 4 sensors (A, B, C, D) with different arrival and execution times. A quantum of 2 time units is assigned. The tables and calculations are shown to schedule the execution of each sensor according to their arrival and the quantum, and to determine the total time, waste, and average penalty.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Round Robin Algorithm Exercise

This document presents an example of a Round Robin algorithm for 4 sensors (A, B, C, D) with different arrival and execution times. A quantum of 2 time units is assigned. The tables and calculations are shown to schedule the execution of each sensor according to their arrival and the quantum, and to determine the total time, waste, and average penalty.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EXERCISE: ROUND ROBIN ALGORITHM

In a system there are 4 sensors, each capturing a signal, which are: A, with
a arrival time of 1 and an execution time of 4. B, with an arrival time of
2 and a runtime of 3. C, with an arrival time of 4 and a time of
Execution of 4; and D, with a arrival time of 6 and an execution time of 2.
Resolve using Round Robin with a Quantum of 2.

Solution:

Quantum = 2

(1)

Sensor Llegada Ejecución Inicio Finalización T. Penalty Waste


System o
A 1 4 1 12 11 7 2.75
B 2 3 3 10 8 5 2.66
C 4 4 5 14 10 6 2.5
D 6 2 7 9 3 1 1.5
Average: 8 4.75 2.35

(2)

Arrival // A B C D
Unit 0 1 2 3 4 5 6 7 8 9 10 11 12 13
Execute // A A B B C C D D B A A C C
How much 1 2 1 2 1 2 1 2 1 1 2 1 2
m

(3)

READY A B C D A C

Explanation:

At first, we considered the arrival time and the execution time of each.
resource, representing each sensor in the table (2), where in the first row we identify
the arrival time of each Sensor Signal, arranged by the values in the table and
following the time units of the second row.

Jesús Miguel Almao. IEC-183-00075


Then, as we take the signals, we interpret their execution in the
third column, following the units of time and at the same time the permissions of
Quantum, which is shown in the fourth column.
Once finished, we focus on those signals that met the Interval of 2 of
Quantum, which we will place in table (3).
Once this is obtained, we place the start and end times of each signal.
to finally calculate the time of the System, the Waste and the penalty, in addition
to calculate their averages.

Clarifications:

-The process B that continues at 9 is not added to the Ready columns because it has not
fulfilled with the entire interval of the Quantum, taking only one unit of it.
Likewise, process B continuing at 9 is prioritized for execution over A.
and of C since it requires less execution time.
As both A and C are waiting and both require the same interval of
time to complete its execution, we take whoever has taken the longest chronologically
waiting, being in this case A.
The column under execution in the second table is the amount of Quantum used,
which is limited to 2 for each arrival.

Formulas:

Time in the System (T)Completion


= - Arrival.
-Desperdicio(W) =T – Execution.
T
-Penalización(P) =
TEjec

Jesus Miguel Almao. IEC-183-00075

You might also like