Exercise2 - Solution Introduction For Embedded Systems
Exercise2 - Solution Introduction For Embedded Systems
Task 1: Feasibility
Given the task set and cyclic-executive schedule in Table 1, determine whether the cyclic-executive schedule
is feasible. Determine the initial phase for each task such that the execution of each task instance finishes
between its arrival and deadline. Note that the deadline should be after the frame in which the task instance
executes, and the arrival should be before the frame in which the task instance executes.
Solution to Task 1:
1
2 3 1 4 3 4 2 1 4 3 4 2 3 4 1 4 2 3 4 1 4 2 3 4 4
0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60
2
Frame #1 #2 #3 #4 #5 #6 #7 #8
exec. time 3+1 2+2 1+2 3 2+2 1+2 3 1+2
Frame #9 # 10 # 11 # 12 # 13 # 14 # 15
exec. time 2+2 3 1+2 2+2 3+1 2 2
(3 − 1)15 − 1 + 9 = 38 ≥ 36 = 9 · 4
(4 − 1)15 − 1 + 9 = 53 ≥ 48 = 12 · 4
(1 − 1)12 + 0 + 4 = 4 ≥ 4 = 1 · 4
(2 − 1)12 + 0 + 4 = 16 ≥ 16 = 4 · 4
(3 − 1)12 + 0 + 4 = 28 ≥ 28 = 7 · 4
(4 − 1)12 + 0 + 4 = 40 ≥ 40 = 10 · 4
(5 − 1)12 + 0 + 4 = 52 ≥ 52 = 13 · 4
(1 − 1)10 − 2 + 6 = 4 ≥ 4 = 1 · 4
(2 − 1)10 − 2 + 6 = 14 ≥ 12 = 3 · 4
(3 − 1)10 − 2 + 6 = 24 ≥ 24 = 6 · 4
(4 − 1)10 − 2 + 6 = 34 ≥ 32 = 8 · 4
(5 − 1)10 − 2 + 6 = 44 ≥ 44 = 11 · 4
(6 − 1)10 − 2 + 6 = 54 ≥ 52 = 13 · 4
(1 − 1)6 + 2 + 6 = 8 ≥ 8 = 2 · 4
(2 − 1)6 + 2 + 6 = 14 ≥ 12 = 3 · 4
(3 − 1)6 + 2 + 6 = 20 ≥ 20 = 5 · 4
(4 − 1)6 + 2 + 6 = 26 ≥ 24 = 6 · 4
(5 − 1)6 + 2 + 6 = 32 ≥ 32 = 8 · 4
(2)
(6 − 1)6 + 2 + 6 = 38 ≥ 36 = 9 · 4
(7 − 1)6 + 2 + 6 = 44 ≥ 44 = 11 · 4
(8 − 1)6 + 2 + 6 = 50 ≥ 48 = 12 · 4
(9 − 1)6 + 2 + 6 = 56 ≥ 56 = 14 · 4
(10 − 1)6 + 2 + 6 = 62 ≥ 60 = 15 · 4
3
Task Period Deadline Execution Time
1 15 3 3
2 10 5 3
3 6 6 3
Solution to Task 2:
We see from the table that the period P is 30, and we can use 3 as the frame f . Since this task set is a small
one, we can derive a feasible schedule graphically, see Fig. 2.
1 2 3 3 2 1 3 3 2 3
0 3 6 9 12 15 18 21 24 27 30
Solution to Task 3:
We see from the table that the period P is 30, and we can use 3 as the frame f . Since this task set is a small
one, we can derive a feasible schedule graphically, see Fig. 3.
3 1 4 2 3 4 3 2 4 1 3 4 3 2 4
0 3 6 9 12 15 18 21 24 27 30