Homework Real Time

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Homework real time

Ahmed Omar Gammam [5181022]

1) State whether you consider the following statements to be TRUE


of FALSE, Justify your answer in cach case,

(a) A hard real time application is mad up of only hard real time tasks. (F)

 A hard real-time application can include both hard and soft real-time
tasks. Hard tasks have strict deadlines that must be met to avoid
catastrophic consequences, while soft tasks have deadlines that can be
occasionally missed without critical failure.

(b) Every safety-critical real-time system has a fail-safe state.(T)

 Safety-critical systems are designed to minimize the risk of harm in


case of failures. A fail-safe state is a predetermined condition that the
system enters when a fault is detected, ensuring safety even if full
functionality is compromised.

(c) A deadline constraint between two stimuli can be considered to be a


behaviorial constraint on the envi-ronment of the system.(F)

 A deadline constraint between two stimuli is a behavioral constraint


on the system itself, not the environment. It dictates how quickly the
system must respond to events within its own operation.

(d) Hardware fault-tolerance techniques can easily be adapted to provide


software fault-tolerance.(F)

 Hardware and software fault-tolerance techniques differ significantly.


Hardware techniques focus on redundancy and physical component
failure, while software techniques address errors in code and logic.

1
Adapting hardware techniques for software fault-tolerance is often not
straightforward.

(e) A good algorithm for scheduling hard real-time tasks must try to
complete each task in the shortest time possible.(F)

 A good hard real-time scheduling algorithm prioritizes meeting


deadlines, even if it means some tasks take longer than necessary. The
goal is to ensure all critical tasks are completed on time, not to
minimize overall execution time

(f) All hard real-time systems are safety-critical in nature.(F)

 While hard real-time systems often have safety-critical aspects, not all
of them are inherently safety-critical. Some hard real-time systems
prioritize performance or functionality over safety.

g) Performance constraints on a real-time system ensure that the


environment of the system is well-behaved.(F)

 Performance constraints primarily focus on system responsiveness and


efficiency, not the behavior of the environment. They ensure the
system meets its intended performance goals within its operating
context.

(h) Soft real-time tasks are those which do not have any time bounds
associated with them.(F)

Soft real-time tasks do have time bounds, but those bounds can be
occasionally missed without causing catastrophic failures. They are often
associated with tasks that enhance user experience or improve system
performance

2
(i) Minimization of average task response times is the objective of any
good hard real time task scheduling algorithm.(F)

 The primary objective of hard real-time scheduling is to meet all


deadlines, even at the expense of average response times. Minimizing
response times is often a secondary goal, considered only after
ensuring deadline adherence

(j) It should be the goal of any good real-time operating system to


complete every hard real-time task as ahead of its deadline as possible.
(F)

 Completing tasks well ahead of their deadlines can lead to resource


contention and scheduling problems for other tasks. A good real-time
operating system aims to meet deadlines consistently, not finish tasks
as early as possible

2) what do you understand by the term real time‫ ؟‬2) how is the
concept of real time different from the traditional notion of time ?
Explain your answer using a suitable example?

The term "real time" refers to a system's ability to respond immediately to


events or inputs without noticeable delay. In real-time systems, timely
and predictable responses are crucial, as seen in applications like control
systems or financial trading.

This concept differs from the traditional notion of time, where the
progression is linear, based on seconds, minutes, and hours, without
requiring immediate responses. For instance, in a traditional computer
system managing an automated manufacturing process, responses may be
delayed based on system workload.

3
Contrastingly, a real-time system in the same scenario must react
immediately to events like sensor-detected faults to ensure safety. The
system guarantees a predictable response time, triggering actions
promptly to maintain the integrity of the manufacturing process.
Essentially, real time involves immediate and deterministic responses,
distinct from the more flexible and non-time-critical nature of traditional
time concepts

3) What does the term "real" in a real-time system signify? Explain


what do you mean by a real-time system

In a real-time system, the term "real" refers to the time constraints placed
on the system's operation. A real-time system is designed to process and
respond to events or inputs within a specified time frame, ensuring that
the system meets its deadlines and provides timely outputs. This is crucial
in applications where timely and predictable responses are essential, such
as in control systems, aviation, or medical devices

Examples:

 Missed deadline in air traffic control: Late data processing could lead
to collisions.
 Delayed response in a medical monitoring system: Critical alerts
might not be delivered on time, impacting patient health.
 Failure in a robot control system: Missed reaction deadlines could
cause physical damage or injury.

Therefore, real-time systems are designed and implemented with an


emphasis on reliability, predictability, and timely responses to ensure
their interactions with the real world remain safe and effective

4
4) Using a block diagram show the important hardware components
of a real-time system and their interactions. Explain the roles of the
different components.

Basic Model of a Real-time System: The basic model of a real-time


system presents the overview of all the components involved in a real-
time system. Real-time system includes various hardware and software
embedded in a such a way that the specific tasks can be performed in the
time constraints allowed. The accuracy and correctness involved in real-
time system makes the model complex. There are various models of real-
time system which are more complex and are hard to understand. Here
we will discuss a basic model of real-time system which has some
commonly used terms and hardware. Following diagram represents a
basic model of Real-time system.

Sensor: Sensor is used for the conversion of some physical events or


characteristics into the electrical signals. These are hardware devices
that takes the input from environment and gives to the system by
converting it. For example, a thermometer takes the temperature as
physical characteristic and then converts it into electrical signals for the
system.

5
Actuator: Actuator is the reverse device of sensor. Where sensor
converts the physical events into electrical signals, actuator does the
reverse. It converts the electrical signals into the physical events or
characteristics. It takes the input from the output interface of the system.
The output from the actuator may be in any form of physical action.
Some of the commonly used actuator are motors and heaters.

Signal Conditioning Unit: When the sensor converts the physical


actions into electrical signals, then computer can’t use them directly.
Hence, after the conversion of physical actions into electrical signals,
there is need of conditioning. Similarly while giving the output when
electrical signals are sent to the actuator, then also conditioning is
required. Therefore, Signal conditioning is of two types:

 Input Conditioning Unit: It is used for conditioning the electrical


signals coming from sensor.

 Output Conditioning Unit: It is used for conditioning the electrical


signals coming from the system.

Interface Unit: Interface units are basically used for the conversion of
digital to analog and vice-versa. Signals coming from the input
conditioning unit are analog and the system does the operations on digital
signals only, then the interface unit is used to change the analog signals to
digital signals. Similarly, while transmitting the signals to output
conditioning unit the interface of signals are changed i.e. from digital to
analog. On this basis, Interface unit is also of two types:

 Input Interface: It is used for conversion of analog signals to digital.

 Output Interface: It is used for conversion of digital signals to


analog.

6
5) In a real-time system. raw sensor signals need to be preprocessed
before they can be used by a computer.

Why is it necessary to preprocess the raw sensor signals before they


can be used by a computer? Explain the different types of
preprocessing that are normally carried out on sensor signals to
make them suitable to be used directly by a computer.

Raw sensor signals often require preprocessing before being used by a


computer. This is because:

 Noise: Real-world environments introduce noise and interference that


can distort data.
 Calibration: Sensor readings might need calibration to match real-
world values.
 Scaling: Raw data might be in a format incompatible with computer
processing.
 Feature extraction: Relevant information from the data might need to
be extracted for specific tasks.
 Common Preprocessing Techniques:
 Filtering: Removes unwanted noise frequencies.
 Smoothing: Eliminates rapid fluctuations in data.
 Calibration: Adjusts readings to match known values.
 Scaling: Converts data to a suitable range for processing.
 Feature extraction: Identifies specific data features relevant to the
task.

7
Preprocessed data becomes more accurate, reliable, and usable for real-
time system tasks and algorithms. By applying appropriate techniques,
developers ensure system effectiveness and optimal performance.

6) dentify the key differences between hard real-time soft real time
and firm teal time systems give at least?

 Hard Real-Time Systems:

• Critical Deadlines: Hard real-time systems have strict and non-


negotiable deadlines that must be met.

• Consequences of Failure: Missing a deadline in a hard real-time system


often leads to catastrophic consequences.

• Example: Airplane avionics systems, medical devices.

Soft Real-Time Systems:

• Flexible Deadlines: Soft real-time systems have deadlines, but missing


them doesn't lead to catastrophic failure.

• Consequences of Failure: Failure to meet deadlines in a soft real-time


system may degrade performance but doesn't result in critical
consequences.

• Example: Multimedia streaming, online gaming.

 Firm Real-Time Systems:

• Mostly Hard with Exceptions: Firm real-time systems are typically hard
real-time but may tolerate occasional deadline misses under specific
conditions.

8
• Consequences of Failure: Missing deadlines is permissible
occasionally, but the system may lose its usefulness if it happens too
frequently.

• Example: Industrial automation, certain telecommunications systems

You might also like