The introduction of microprocessor ushered change in all industries. In banking, it enabled transactions which previously took days to be completed in milliseconds. This is done through the use of Real Time Embedded Systems. It is time to learn something new!
Table of Contents
What are Real Time Embedded Systems?
This is defined as system whose logical correctness is based on both the correctness of the outputs and their timeliness. In other words, when a system has to respond to an event, or a request in a strictly defined time period, this is referred to as a real time embedded system.
The defined time is referred to as a deadline. These systems must be predictable, and by definition are deterministic.
Real Time Embedded Systems Classifications
The real time embedded systems are classified on the degree of tolerance towards missed deadlines. This therefore categorizes the real time embedded systems into two – Hard Real Time Embedded Systems and Soft Real Time Embedded Systems.
1. Hard Real Time Embedded Systems
In these real time embedded systems, the level of tolerance for a missed deadline is extremely small. In some cases there is zero tolerance.
The penalty that is incurred for missing a deadline results in a catastrophe.
The results computed after the deadline is missed are likely to be useless for the majority of the systems.
An example to illustrate the zero tolerance concept is the Ariane 5 Explosion
In 1996, on the 4th of June, an unmanned Arianne 5 rocket that was launched by the European Space Agency exploded 40 seconds after lift-off. This was the rocket’s first voyage, and an entire decade of development was put into the creation of this rocket.
The total costs reached a staggering $7 billion. In the explosion, the rocket was completely destroyed together with all of the cargo valued at 500 million.
After carrying out investigations, it was realized that the cause of the catastrophe was a software error in the inertial reference system.
A 64 bit floating point number relating to the horizontal velocity of the rocket with respect to the platform was converted to a 16 bit signed integer. The number was larger than 32768, which is the largest integer that can be stored in a signed integer, and the conversion failed.
2. Soft Real Time Embedded Systems
In these real time embedded systems, the level of tolerance for a missed deadline is non-zero. The computed results after the missed deadline have a rate of depreciation. The usefulness of the results does not reach zero soon after passing the deadline – unlike most hard real time embedded systems. The physical impact of a missed deadline is non-catastrophic
Every real time embedded system has a set of timing constraints that it is designed to meet. These timing constraints can be divided into two and these are: response and task scheduling.
1. Event response
An event is defined as a stimulus that the system has to respond to. The events can be initiated in the hardware and the software. They provide an indication that something occurred and needs to be addressed. An example is a key press. The system may detect this change and perform the necessary operations. Events can be created at any time the system detects a change.
The period of time between the moment the system detects an event and the moment the system responds to the event is referred to as the latency. To find the latency, one simply subtracts the detection time from the response time.
2. Task Scheduling
A task is the set of instructions that the system’s processor needs to run. An important term used in task scheduling is the term jitter. Jitter is the time between when a scheduled task is supposed to run and when it actually does run.
The ultimate aim is for the real time system to have as little latency and jitter as possible, while defining an upper bound worst case scenario that is deemed to be acceptable.
These are used to determine which task is executed first if more than one task is in the ready queue. The algorithms used are as follows:
1. Priority Based
In this scheduling algorithm, each process is associated with a corresponding priority level and the CPU executes them based on their priorities. Multiple processes with the same priority are dealt with using the First Come First Serve algorithm.
2. Shortest Job First
As the name implies, the process which has the lowest execution time is executed first. This can be pre-emptive or non pre-emptive. Pre-emptive tasks are those in which the CPU is taken from the task before the task is completed. In non pre-emptive scheduling, the opposite is true.
This method has the disadvantage that when there is a larger number of shorter jobs, the longer jobs are starved of the CPU.
3. Round Robin
In this scenario, each process is given a time slot. After the time has elapsed, the process is pre-empted and added to the end of the ready queue. This type of scheduling is fair in that every process gets an equal share of the Central Processing Unit.
This method does have the disadvantage that setting the time slot too sort will increase overhead and lower the CPUs efficiency. Setting it too long may cause poor response to short processes.
4. First Come First Serve
As the name implies, in this scheduling algorithm, the process which entered the queue first is executed first. This algorithm is non pre-emptive.
Well, real time systems are not as complicated as one may think. In this article, we first got to understand exactly what a real time embedded system is, and proceeded to give classifications of the real time embedded systems. The example given in which there was a catastrophe was given to help you gain an appreciation of the concept presented.
I believe that you now have a clear understanding of exactly what these Real Time Embedded Systems are.