Quiz 1 Flashcards

1
Q

There are two types of real-time systems, what are they?

A

Hard real-time systems and soft real-time systems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between hard and soft real-time systems

A

Hard real-time systems are strictly adherent to deadlines, where timing is absolutely vital.
Soft real-time systems are more forgiving, where occasional timing breaches do not cause critical failure.

The primary difference between the two is based on their tolerance for timing constraints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

To coordinate the process of sharing the CPU between multiple tasks, RTOS uses a program called a ________________

A

Kernel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What four things is an RTOS responsible for?

A
  • Task management (scheduling/dispatching)
  • Communication between tasks
  • Input and output management
  • Memory management
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

True or False: An RTOS can run tasks in parallel

A

False, an RTOS can switch between tasks (run concurrently) but they cannot be run in parallel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True or False: Tasks executions are asynchronous to each other

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an event?

A

An event is defined as a change in the signals (hardware) or in the variables (software)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the two types of events that could occur?

A

Periodic: An event with a deterministic period
Sporadic: Non-periodic and non-deterministic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: The minimum time between sporadic events must be known

A

True, or else all events may not be captured

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

To detect an event, input signals can be ___________________________ to synchronize real-time events with the program

A

Sampled periodically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

If you are given the task execution time, T, and the period, P, how can you calculate the load on the CPU?

A

Divide the task execution time by the period (L = T/P)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If you are given multiple task execution times and periods, how can you calculate the load on the CPU?

A

Find the sum of all execution times divided by their periods (L = T1/P1 + T2/P2 + … + Tn/Pn)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False: The necessary condition for a design to be realizable is L > 1

A

False, L (load on CPU) must be less than or equal to 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

True or False: Given the time required to make one pass through the sampling loop, S, and the time required to update the outputs, D, the worst-case response time, R, is:

R <= S + D ~= 2S

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the three different types of event detection

A
  • Level detection
  • Flag detection
  • Edge detection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Event detection can be done by _________ in a free-running event loop

A

Polling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the formula for polling time in a level-detection free-running event loop

A

T_poll = T_det + T_srv < T_ep + T_et_2 - T_et_1

18
Q

What is the formula for polling time in a flag-based free-running event loop

A

T_poll = T_det + T_srv < T_ep

19
Q

What is the condition to detect edges in a free-running event loop

A

2*T_det + T_srv < T_ep

20
Q

What is the formula for the response time from an event becoming active to the time the response is made in a free-running event loop

A

T_R = T_poll + T_det + T_srv + T_cir

21
Q

True or False: CPU load can be decreased by using hardware

22
Q

An ______________ is a hardware solution for both event detection and changing the program flow

23
Q

What is a problem with using interrupts in multitask systems?

A

It results in nondeterministic timings and can interrupt a task in the middle of it. To address this, the CPU context must be saved prior to servicing the interrupt (referred to as a context switch)

24
Q

What is a timed event loop?

A

A programming construct that executes code at regular intervals, ensuring multiple tasks can run at regular intervals

25
Q

True or False: Timed event loops makes scheduling and executing multiple tasks possible

26
Q

To not miss an event, the event signal must be sampled with a period, P, that is ________ than the event time

27
Q

The response time of a timed event loop is _________ than a free-running loop

28
Q

A ________ is needed to coordinate task executions

29
Q

To coordinate tasks, either the kernel must ________ tasks or tasks themselves must _________ to share the CPU

A

Preempt/Interrupt, cooperate

30
Q

What is the difference between a preemptive kernel and a cooperative kernel

A

Cooperative kernel relies on each task to cooperate in execution, where tasks run until they reach a point where they can voluntarily yield the processor to enable another task to run.

Preemptive kernel determines which task should run at any given time and may preempt one task to run another task.

31
Q

What is the condition for proper switch debouncing?

A

The sampling period must be less than the bounce time (S < B)

32
Q

What is the two-step validation method for switch debouncing?

A

Read the switch twice in consecutive polling cycles. If the state remains the same, register the press

33
Q

What is mutual exclusion in task scheduling?

A

Tasks take turns running in different time slices to prevent interference while keeping their original periods

34
Q

When does mutual exclusion NOT help?

A

When a task is too long to fit in its allocated time slot

35
Q

What is task decomposition?

A

Splitting a long task into smaller parts so it can run in multiple cycles without blocking other tasks

36
Q

What are the two types of task decomposition?

A

Co-routines: The task pauses and resumes in multiple cycles

State decomposition: The task is broken into steps that run in separate time slices

37
Q

When should task decomposition be used?

A

When a task’s execution time is longer than the required period of another task

38
Q

Tasks an be decomposed into shorter pieces using a ____________________

A

State machine

39
Q

What are the most important features of a real-time program?

A
  • Deterministic timing
  • Predictable
  • Priority management
  • Interrupt handling
  • Concurrency handling