Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE) PDF Download

A Basic Model of a Real-Time System 

We have already pointed out that this book confines itself to the software issues in real-time systems.  However, in order to be able to see the software issues in a proper perspective, we need to have a basic conceptual understanding of the underlying hardware.  We therefore in this section try to develop a broad understanding of high level issues of the underlying hardware in a real-time system. For a more detailed study of the underlying hardware issues, we refer the reader to [2]. Fig.28.3 shows a simple model of a real-time system in terms of its important functional blocks. Unless otherwise mentioned, all our subsequent discussions would implicitly assume such a model.  Observe that in Fig. 28.3, the sensors are interfaced with the input conditioning block, which in turn is connected to the input interface. The output interface, output conditioning, and the actuator are interfaced in a complementary manner. In the following, we briefly describe the roles of the different functional blocks of a real-time system. 

Sensor:  A sensor converts some physical characteristic of its environment into electrical signals.  An example of a sensor is a photo-voltaic cell which converts light energy into electrical energy. A wide variety of temperature and pressure sensors are also used.  A temperature sensor typically operates based on the principle of a thermocouple. Temperature sensors based on many other physical principles also exist.  For example, one type of temperature sensor employs the principle of variation of electrical resistance with temperature (called a varistor). A pressure sensor typically operates based on the piezoelectricity principle. Pressure sensors based on other physical principles also exist. 

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.3 A Model of a Real-Time System 

Actuator:  An actuator is any device that takes its inputs from the output interface of a computer and converts these electrical signals into some physical actions on its environment. The physical actions may be in the form of motion, change of thermal, electrical, pneumatic, or physical characteristics of some objects. A popular actuator is a motor. Heaters are also very commonly used. Besides, several hydraulic and pneumatic actuators are also popular. 

Signal Conditioning  Units:  The  electrical  signals  produced  by a computer can rarely be used to directly drive an actuator. The computer signals usually need conditioning before they can be used by the actuator. This is termed output conditioning.   Similarly,  input  conditioning  is  required  to  be  carried  out  on  sensor  signals  before they can be accepted by the computer. For example, analog signals generated by a photo-voltaic cell are normally in the milli-volts range and need to be conditioned before they can be processed by a computer.  The following are some important types of conditioning carried out on raw signals generated by sensors and digital signals generated by computers: 

  1. Voltage Amplification:  Voltage amplification is normally required to be carried out to match the full scale sensor voltage output with the full scale voltage input to the interface of a computer.  For example, a sensor might produce voltage in the millivolts range, whereas the input interface of a computer may require the input signal level to be of the order of a volt.
  2. Voltage Level Shifting: Voltage level shifting is often required to align the voltage level generated by a sensor with that acceptable to the computer. For example, a sensor may produce voltage in the range -0.5 to +0.5 volt, whereas the input interface of the computer may accept voltage only in the range of 0 to 1 volt.  In this case, the sensor voltage must undergo level shifting before it can be used by the computer.
  3. Frequency Range Shifting and Filtering: Frequency range shifting is often used to reduce the noise components in a signal.  Many types of noise occur in narrow bands and the signal must be shifted from the noise bands so that noise can be filtered out.
  4. Signal Mode Conversion: A type of signal mode conversion that is frequently carried out during signal conditioning involves changing direct current into alternating current and vice-versa. Another type signal mode conversion that is frequently used is conversion of analog signals to a constant amplitude pulse train such that the pulse rate or pulse width is proportional to the voltage level. Conversion of analog signals to a pulse train is often necessary for input to systems such as transformer coupled circuits that do not pass direct current. 

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.4 An Output Interface  

Interface Unit: Normally commands from the CPU are delivered to the actuator through an output interface. An  output  interface  converts  the  stored  voltage  into  analog  form  and  then  outputs  this to the actuator circuitry. This of course would require the value generated to be written on a register (see Fig. 28.4). In an output interface, in order to produce an analog output, the CPU selects a data register of the output interface and writes the necessary data to it. The two main functional blocks of an output interface are shown in Fig. 28.4. The interface takes care of the buffering and the handshake control aspects. Analog to digital conversion is frequently deployed in an input interface. Similarly, digital to analog conversion is frequently used in an output interface.

In the following, we discuss the important steps of analog to digital signal conversion (ADC). 

Analog to Digital Conversion: Digital  computers  can  not  process  analog  signals.   Therefore, analog signals need to be converted to digital form. Analog signals can be converted to digital form using a circuitry whose block diagram is shown in Fig. 28.7. Using the block diagram shown in Fig. 28.7, analog signals are normally converted to digital form through the following two main steps: 

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.5 Continuous Analog Voltage 

  • Sample the analog signal (shown in Fig. 28.5) at regular intervals. This sampling can be done by a capacitor circuitry that stores the voltage levels. The stored voltage levels can be made discrete. After sampling the analog signal (shown in Fig. 28.5), a step waveform as shown in Fig. 28.6 is obtained.
  • Convert the stored value to a binary number by using an analog to digital converter (ADC) as shown in Fig. 28.7 and store the digital value in a register. 

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.6 Analog Voltage Converted to Discrete Form  

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.7 Conversion of an Analog Signal to a 16 bit Binary Number 

Digital to analog conversion can be carried out through a complementary set of operations. We leave it as an exercise to the reader to figure out the details of the circuitry that can perform the digital to analog conversion (DAC).

Characteristics of Real-Time Systems 

We now discuss a few key characteristics of real-time systems.  These characteristics distinguish real-time systems from non-real-time systems. However, the reader may note that all the discussed characteristics may not be applicable to every real-time system. Real-time systems cover such an enormous range of applications and products that a generalization of the characteristics into a set that is applicable to each and every system is difficult. Different categories of real-time systems may exhibit the characteristics that we identify to different extents or may not even exhibit some of the characteristics at all. 

1. Time constraints: Every real-time task is associated with some time constraints.  One form of time constraints that is very common is deadlines associated with tasks. A task deadline specifies the time before which the task must complete and produce the results. Other types of timing constraints are delay and duration (see Section 1.7). It is the responsibility of the real-time operating system (RTOS) to ensure that all tasks meet their respective time constraints.  We shall examine in later chapters how an RTOS can ensure that tasks meet their respective timing constraints through appropriate task scheduling strategies.

2. New Correctness Criterion: The notion of correctness in real-time systems is different from that used in the context of traditional systems.  In real-time systems, correctness implies not only logical correctness of the results, but the time at which the results are produced is important.  A logically correct result produced after the deadline would be considered as an incorrect result. 

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.8 A Schematic Representation of an Embedded Real-Time System 

3. Embedded: A vast majority of real-time systems are embedded in nature [3]. An embedded computer system is physically “embedded” in its environment and often controls it.  Fig. 28.8 shows a schematic representation of an embedded system. As shown in Fig. 28.8, the sensors of the real-time computer collect data from the environment, and pass them on to the realtime computer for processing.  The computer, in turn passes information (processed data) to the actuators to carry out the necessary work on the environment, which results in controlling some characteristics of the environment. Several examples of embedded systems were discussed in Section 1.2. An example of an embedded system that we would often refer is the Multi-Point Fuel Injection (MPFI) system discussed in Example 6 of Sec. 1.2.

4. Safety-Criticality:  For traditional non-real-time systems safety and reliability are independent issues. However, in many real-time systems these two issues are intricately bound together making them safety-critical. Note that a safe system is one that does not cause any damage even when it fails. A reliable system on the other hand, is one that can operate for long durations of time without exhibiting any failures. A safety-critical system is required to be highly reliable since any failure of the system can cause extensive damages. We elaborate this issue in Section 1.5.

5. Concurrency: A real-time system usually needs to respond to several independent events within very short and strict time bounds. For instance, consider a chemical plant automation system (see Example1 of Sec. 1.2), which monitors the progress of a chemical reaction and controls the rate of reaction by changing the different parameters of reaction such as pressure, temperature, chemical concentration. These parameters are sensed using sensors fixed in the chemical reaction chamber. These sensors may generate data asynchronously at different rates. Therefore, the real-time system must process data from all the sensors concurrently, otherwise signals may be lost and the system may malfunction. These systems can be considered to be non-deterministic, since the behavior of the system depends on the exact timing of its inputs. A non-deterministic computation is one in which two runs using the same set of input data can produce two distinct sets of output data in the two runs.

6. Distributed and Feedback Structure: In many real-time systems, the different components of the system are naturally distributed across widely spread geographic locations. In such systems, the different events of interest arise at the geographically separate locations. Therefore, these events may often have to be handled locally and responses produced to them to prevent overloading of the underlying communication network. Therefore, the sensors and the actuators may be located at the places where events are generated. An example of such a system is a petroleum refinery plant distributed over a large geographic area. At each data source, it makes good design sense to locally process the data before being passed on to a central processor.  

Many distributed as well as centralized real-time systems have a feedback structure as shown in Fig. 28.9. In these systems, the sensors usually sense the environment periodically. The sensed data about the environment is processed to determine the corrective actions necessary. The results of the processing are used to carry out the necessary corrective actions on the environment through the actuators, which in turn again cause a change to the required characteristics of the controlled environment, and so on.

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.9 Feedback Structure of Real-Time Systems 

7. Task Criticality: Task criticality is a measure of the cost of failure of a task.  Task criticality is determined by examining how critical are the results produced by the task to the proper functioning of the system.  A real-time system may have tasks of very different criticalities.  It is therefore natural to expect that the criticalities of the different tasks must be taken into consideration while designing for fault-tolerance.  The higher the criticality of a task, the more reliable it should be made. Further,  in  the  event  of  a  failure  of  a  highly  critical  task, immediate failure detection and recovery are important.  However, it should be realized that task priority is a different concept and task criticality does not solely determine the task priority or the order in which various tasks are to be executed (these issues shall be elaborated in the later chapters).

8. Custom Hardware: A real-time system is often implemented on custom hardware that is specifically designed and developed for the purpose. For example, a cell phone does not use traditional microprocessors. Cell phones use processors which are tiny, supporting only those processing capabilities that are really necessary for cell phone operation and specifically designed to be power-efficient to conserve battery life. The capabilities of the processor  used  in  a  cell  phone  are  substantially  different  from  that  of  a  general  purpose  processor. Another example is the embedded processor in an MPFI car. In this case, the processor used need not be a powerful general purpose processor such as a Pentium or an Athlon processor. Some of the most powerful computers used in MPFI engines are 16- or 32-bit processors running at approximately 40 MHz. However, unlike the conventional PCs, a processor used in these car engines do not deal with processing frills such as screen-savers or a dozen of different applications running at the same time. All that the processor in an MPFI system needs to do is to compute the required fuel injection rate that is most efficient for a given speed and acceleration. 

9. Reactive: Real-time systems are often reactive. A reactive system is one in which an ongoing interaction between the computer and the environment is maintained. Ordinary systems compute functions on the input data to generate the output data (See Fig. 28.10 (a)). In other words, traditional systems compute the output data as some function φ of the input data. That is, output data can mathematically be expressed as: output data = φ(input data). For example, if some data I1 is given as the input, the system computes O1 as the result O1 = φ(I1). To elaborate this concept, consider an example involving library automation software. In a library automation software, when the query book function is invoked and “Real-Time Systems” is entered as the input book name, then the software displays “Author name: R. Mall, Rack Number: 001, Number of Copies: 1”.

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 28.10 Traditional versus Reactive Systems 

In  contrast  to  the  traditional  computation  of  the  output  as  a  simple  function  of  the  input  data,  real-time systems do not produce any output data but enter into an on-going interaction with their environment. In each interaction step, the results computed are used to carry out some actions on the environment. The reaction of the environment is sampled and is fed back to the system. Therefore the computations in a real-time system can be considered to be non-terminating. This reactive nature of real-time systems is schematically shown in the Fig. 28.10(b). 

10. Stability: Under overload conditions, real-time systems need to continue to meet the deadlines of the most critical tasks, though the deadlines of non-critical tasks may not be met. This is in contrast to the requirement of fairness for traditional systems even under overload conditions. 

11. Exception Handling: Many real-time systems work round-the-clock and often operate without human operators. For example, consider a small automated chemical plant that is set up to work non-stop. When there are no human operators, taking corrective actions on a failure becomes difficult. Even if no corrective actions can be immediate taken, it is desirable that a failure does not result in catastrophic situations. A failure should be detected and the system should continue to operate in a gracefully degraded mode rather than shutting off abruptly. 

The document Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Embedded Systems (Web).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
47 videos|69 docs|65 tests

Top Courses for Computer Science Engineering (CSE)

47 videos|69 docs|65 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

study material

,

mock tests for examination

,

Semester Notes

,

Sample Paper

,

video lectures

,

shortcuts and tricks

,

Viva Questions

,

practice quizzes

,

Objective type Questions

,

Important questions

,

Extra Questions

,

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

Summary

,

Exam

,

Free

,

past year papers

,

MCQs

,

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

Introduction to Real Time Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

pdf

,

Previous Year Questions with Solutions

,

ppt

;