Skinpress Rss

Thursday, November 29, 2012

Basic Real-Time Concepts -- Real-Time Definitions

0

Real-Time Definitions


Definition: A real-time system is a system that must satisfy explicit (bounded) response-time constraints or risk severe consequences, including failure.
 
What is a “failed” system? In the case of the space shuttle or a nuclear plant, it is painfully obvious when a failure has occurred. For other systems, such as an automatic bank teller machine, the notion of failure is less clear. For now, failure will be defined as the “inability of the system to perform according to system specification,” or, more formally:
 
Definition: A failed system is a system that cannot satisfy one or more of the requirements stipulated in the formal system specification.
 
Because of this definition of failure, precise specification of the system operating criteria, including timing constraints, is important. This matter is dis- cussed later.
 
Various other definitions exist for real-time, depending on which source is consulted. Nonetheless, the common theme among all definitions is that the system must satisfy deadline constraints in order t be correct. For example, an alternative definition might be:
 
Definition: A real-time system is one whose logical correctness is based
on both the correctness of the outputs and their timeliness.
 
In any case, note that by making unnecessary the notion of timeliness, every ystem becomes a real-time system.
 
Real-time systems are often reactive or embedded systems. Reactive systems are those in which scheduling is driven by ongoing interaction with their environment; for example, a fire-control system reacts to buttons pressed by a pilot. Embedded systems are those that are found in a system that is not itself a computer. For example, a modern automobile contains many embedded computers that control fuel injection, airbag deployment, braking, climate control, and so forth. Today, many household items such as televisions, stereos, washing machines, even toys contain embedded computers. It is clear that sophisticated systems such as aircraft, spacecraft, and industrial machines must contain many embedded, reactive computer systems.
 
The three systems mentioned earlier satisfy the criteria for a real-time system precisely. An aircraft must process accelerometer data within a certain period that depends on the specifications of the aircraft; for example, every 10 milliseconds. Failure to do so could result in a false position or velocity indication and cause the aircraft to go off-course at best or crash at worst. For a nuclear reactor thermal problem, failure to respond swiftly could result in a meltdown. Finally, an airline reservation system must be able to handle a surge of passenger requests within the passenger’s perception of a reasonable time (or before the flights leave the gate). In short, a system does not have to process data in microseconds to be considered real-time; it must simply have response times that are constrained.
 
When Is a System Real-Time?
 
It can be argued that all practical systems are real-time systems. Even a batch-oriented system – for example, grade processing at the end of a semester or a bimonthly payroll run – is real-time. Although the system may have response times of days or weeks (e.g., the time that elapses between submitting the grade or payroll information and issuance of the report card or check), it must respond within a certain time or there could be an academic or financial disaster. Even a word-processing program should respond to commands within a reasonable amount of time (e.g., 1 second), or it will become torturous to use. Most of the literature refers to such systems as soft real-time systems.
 
Definition: A soft real-time system is one in which performance is degraded but not destroyed by failure to meet response-time constraints.
Conversely, systems where failure to meet response-time constraints leads to complete and catastrophic system failure are called hard real-time systems.
 
Definition: A hard real-time system is one in which failure to meet a single deadline may lead to complete and catastrophic system failure
 
 
Firm real-time systems are those systems with hard deadlines where some arbitrarily small number of missed deadlines can be tolerated.
 
Definition: A firm real-time system is one in which a few missed deadlines
will not lead to total failure, but missing more than a few may lead to
complete and catastrophic system failure.


As noted, all practical systems minimally represent soft real-time systems. Table above gives a sampling of hard, firm, and soft real-time systems.
 
Note that there is a great deal of latitude for interpretation of hard, firm, and soft real-time systems. For example, in the automated teller machine, missing too many deadlines will lead to significant customer dissatisfaction and potentially even enough loss of business to threaten the existence of the bank. This extreme scenario represents the fact that every system can probably be characterized any way – soft, firm, or hard – real-time by the construction of a supporting scenario. The careful construction of systems requirements (and, hence, expectations) is the key to setting and meeting realistic deadline expectations. In any case, it is a principal goal of real-time systems engineering to find ways to transform hard deadlines into firm ones, and firm ones into soft ones.
 
The Nature of Time
 
It is typical, in studying real-time systems, to consider the nature of time, because deadlines are instants in time. But the question arises, “Where do the deadlines come from?” Generally speaking, deadlines are based on the underlying physical phenomena of the system under control. For example, in animated displays, images must be updated at approximately 30 frames per second to provide continuous motion, because the human eye can resolve updating at a slower rate. In navigation systems, accelerations must be read at a rate that is based on the maximum velocity of the vehicle, and so on. In some cases, systems have deadlines that are imposed on them that are based on nothing less than guessing or on some forgotten and since eliminated requirement. The problem in these cases is that the undue constraints may be placed on the systems. This is a primary maxim of real-time systems design – to understand the basis and nature of the timing constraints, so that they can be relaxed if necessary.
 
Many real-time systems utilize time-stamping and global clocks for synchronization, task initiation, and data marking. It must be noted, however, that clocks keep inaccurate time; even the official U.S. atomic clock must be adjusted. More- over, there is an associated digitization error with clocks, which may need to be considered when using them for data time-stamping.
 
 

Monday, November 26, 2012

Basic Real-Time Concepts --- Systems Concepts

0

Systems Concepts


The hardware of the general-purpose computer solves problems by repeated execution of macroinstructions, collectively known as software. Software is traditionally divided into system programs and application programs.

System programs consist of software that interfaces with the underlying computer hardware, such as schedulers, device drivers, dispatchers, and programs that act as tools for the development of application programs. These tools include compilers, which translate high-order language programs into assembly code; assemblers, which translate the assembly language into a special binary format called object or machine code; and linkers, which prepare the object code for execution. An operating system is a specialized collection of system programs that manage the physical resources of the computer. As such, a real-time operating system is a systems program.

Application programs are programs written to solve specific problems, such as payroll preparation, inventory, and navigation. Certain design considerations play a role in the design of certain systems programs and application software intended to run in real-time environments.

The notion of a “system” is central to software engineering, and indeed to all engineering, and warrants formalization.

Definition: A system is a mapping of a set of inputs into a set of outputs.

When the internal details of the system are not of interest, the mapping function can be considered as a black box with one or more inputs entering and one or more outputs exiting the system (see Figure A).

Every real-world entity, whether synthetic or occurring naturally, can be modeled as a system. In computing systems, the inputs represent digital data from hardware devices and other software systems. The inputs are often associated with sensors, cameras, and other devices that provide analog inputs, which are converted to digital data, or provide direct digital input. The digital output of the computer system can be converted to analog outputs to control external hardware devices such as actuators and displays (Figure B).
Modeling a real-time system, as in Figure B, is somewhat different from the more traditional model of the real-time system as a sequence of jobs to be scheduled and performance to be predicted, which is very similar to that shown in Figure C. The latter view is simplistic in that it ignores the fact that the input sources and hardware under control are complex. Moreover, there are other, sweeping software engineering considerations that are hidden by the model shown in Figure C.
Look again at to the model of a real-time system shown in Figure 1.2. Note that in its realization there is some delay between presentation of the inputs (stimulus) and appearance of the outputs (response). This fact can be formalized as follows:

Definition: The time between the presentation of a set of inputs to a system (stimulus) and the realization of the required behavior (response), including the availability of all associated outputs, is called the response time of the system.

How fast the response time needs to be depends on the purpose of the system.
 

Sunday, November 25, 2012

Voltage and Resistance

0

The ability of an energy source (e.g. a battery) to produce a current within a conductor may be expressed in terms of electromotive force  (e.m.f.). Whenever an e.m.f. is applied to a circuit  a potential difference  (p.d.) exists. Both e.m.f. and p.d. are measured in volts (V). In many practical circuits there is only one e.m.f. present (the battery or supply) whereas a p.d. will be developed across each component present in the circuit.
The conventional flow of current in a circuit is from the point of more positive potential to the point of greatest negative potential (note that electrons move in the  opposite  direction!). Direct current results from the application of a direct e.m.f. (derived from batteries or a d.c. power supply). An essential characteristic of these supplies is that the applied e.m.f. does not change its polarity (even though its value might be subject to some fluctuation).

For any conductor, the current flowing is directly proportional to the e.m.f. applied. The current flowing will also be dependent on the physical dimensions (length and cross-sectional area) and material of which the conductor is composed.
The amount of current that will flow in a conductor when a given e.m.f. is applied is inversely proportional to its resistance. Resistance, therefore, may be thought of as an opposition to current flow; the higher the resistance the lower the current that will flow (assuming that the applied e.m.f. remains constant).

Conductors and Insulators

0

Electric current is the name given to the flow of electrons  (or negative charge carriers). Electrons orbit around the nucleus of atoms just as the earth orbits around the sun.

Electrons are held in one or more  shells, constrained to their orbital paths by virtue of a force of attraction towards the nucleus which contains an equal number of protons(positive charge carriers). Since like charges repel and unlike charges attract, negatively charged electrons are attracted to the positively charged nucleus. A similar principle can be demonstrated by observing the attraction between two permanent magnets; the two North poles of the magnets will repel each other, while a North and South pole will attract. In the same way, the unlike charges of the negative electron and the positive proton experience a force of mutual attraction.

The outer shell electrons of a conductor  can be reasonably easily interchanged between adjacent atoms within the  lattice  of atoms of which the substance is composed. This makes it possible for the material to conduct electricity. Typical  examples of conductors are metals such as copper, silver, iron and aluminium. By contrast, the outer shell electrons of an  insulator  are firmly bound to their parent atoms and virtually no interchange of electrons is possible. Typical examples of  insulators are plastics, rubber and ceramic materials.