CH#1 - Introduction to RealTime and Embedded System
CH#1 - Introduction to RealTime and Embedded System
CHAPTER ONE
Introduction to Real Time and Embedded System
Overview of System
A system is an arrangement in which all its unit assemble work together according to a set of
rules. It can also be defined as a way of working, organizing or doing one or many tasks
according to a fixed plan. For example, a watch is a time displaying system. Its components
follow a set of rules to show time. If one of its parts fails, the watch will stop working. So we can
say, in a system, all its subcomponents depend on each other.
Real-Time Systems and Embedded Systems are crucial concepts in computer science and
engineering, often used in applications where specific performance characteristics are
essential. Let’s break down each term:
Real-Time Systems
Definition: A Real-Time System is a computing system that must respond to inputs or events
within a specific time frame. The correctness of the system depends not only on the logical
correctness of the computations but also on the time at which the results are produced.
Key Characteristics:
1. Timeliness: The system must meet deadlines for processing and responding to events.
Missing a deadline can lead to failure or suboptimal performance.
2. Predictability: The system's behavior must be predictable and consistent. This is
often achieved through specialized scheduling algorithms.
3. Determinism: The system should provide consistent performance in terms of
response time and throughput under given conditions.
Embedded Systems
As its name suggests, Embedded means something that is attached to another thing.
An embedded system can be thought of as a computer hardware system having software
embedded in it.
Applications:
Consumer Electronics: Smartphones, smart TVs, home appliances.
Automotive Systems: Engine control units, airbag systems, ABS braking systems.
Medical Devices: Pacemakers, infusion pumps, diagnostic equipment.
Industrial Control: PLCs (Programmable Logic Controllers), SCADA systems.
Embedded Components
An embedded system has three components: -
It has hardware.
It has application software.
It has Real Time Operating system (RTOS) that supervises the application software and
provide mechanism to let the processor run a process as per scheduling by following a
plan to control the latencies. RTOS defines the way the system works. It sets the rules
during the execution of application program. A small scale embedded system may not
have RTOS.
So we can define an embedded system as a Microcontroller based, software driven, reliable,
real-time control system.
Compact and Integrated Design: Embedded systems often integrate hardware and
software into a single chip or compact module, which reduces size, weight, and power
consumption. This is ideal for devices with space constraints like wearable technology or
compact appliances.
Low Power Consumption: Designed to be power-efficient, embedded systems often
consume less power than general-purpose systems, making them suitable for battery-
operated devices and energy-sensitive applications.
High Reliability and Stability: By focusing on specific functions, embedded systems
can be made highly reliable and stable, which is crucial in applications where failure is
not an option, such as in medical or industrial control systems.
Real-Time Operation: Many embedded systems support real-time operations, enabling
them to handle time-sensitive tasks effectively, which is essential in applications like
automotive control systems and real-time data acquisition.
Long Lifecycle and Durability: Embedded systems are often built for long-term use and
can operate reliably in harsh environments. This is beneficial for applications in industrial
machinery, aerospace, and remote sensing.
Enhanced Security: Custom-designed embedded systems can be tailored with specific
security features and minimal exposure to potential vulnerabilities, making them more
secure against attacks compared to general-purpose systems.
Summary:
Real-Time Systems offer advantages in terms of predictability, reliability, and
meeting deadlines, making them essential for applications where timing is critical and
performance must be guaranteed.
Embedded Systems provide specialized functionality, cost-effectiveness, and
compact design, making them ideal for dedicated tasks in consumer electronics,
industrial applications, and various other fields. Their low power consumption and
high reliability also contribute to their effectiveness in a wide range of applications.
Scalability Issues: Real-time systems may face scalability issues when dealing with an
increasing number of tasks or more complex scheduling requirements. Ensuring that the
system remains responsive as it scales can be difficult.
Summary:
Real-Time Systems face challenges including complexity in design, higher costs, limited
flexibility, and difficulties in testing. These systems must ensure that all tasks meet
deadlines, which can introduce additional overhead and make scaling challenging.
Embedded Systems are constrained by limited resources, difficulties in upgrading, and
specialized knowledge requirements. They also face challenges related to user interface
limitations, potential obsolescence, and integration issues. Security and debugging can
also be more challenging in embedded environments.
Sensor − It measures the physical quantity and converts it to an electrical signal which
can be read by an observer or by any electronic instrument like an A2D converter. A
sensor stores the measured quantity to the memory.
A-D Converter − An analog-to-digital converter converts the analog signal sent by the
sensor into a digital signal.
Processor & ASICs − Processors process the data to measure the output and store it to
the memory.
D-A Converter − A digital-to-analog converter converts the digital data fed by the
processor to analog data
Actuator − An actuator compares the output given by the D-A Converter to the actual
(expected) output stored in it and stores the approved output.
Processors in a System
A processor has two essential units −
Program Flow Control Unit (CU)
Execution Unit (EU)
The CU includes a fetch unit for fetching instructions from the memory. The EU has circuits
that implement the instructions pertaining to data transfer operation and data conversion from
one form to another.
The EU includes the Arithmetic and Logical Unit (ALU) and also the circuits that execute
instructions for a program control task such as interrupt, or jump to another set of
instructions.
A processor runs the cycles of fetch and executes the instructions in the same sequence as
they are fetched from memory.
Types of Processors
Processors can be of the following categories: -
General Purpose Processor (GPP)
o Microprocessor
o Microcontroller
o Embedded Processor
o Digital Signal Processor
o Media Processor
Application Specific System Processor (ASSP)
Application Specific Instruction Processors (ASIPs)
GPP core(s) or ASIP core(s) on either an Application Specific Integrated Circuit
(ASIC) or a Very Large Scale Integration (VLSI) circuit.
Microprocessor
A microprocessor is a single VLSI chip having a CPU. In addition, it may also have other units
such as coaches, floating point processing arithmetic unit, and pipelining units that help in faster
processing of instructions.
Earlier generation microprocessors’ fetch-and-execute cycle was guided by a clock frequency of
order of ~1 MHz. Processors now operate at a clock frequency of 2GHz
Microcontroller
A microcontroller is a single-chip VLSI unit (also called microcomputer) which, although
having limited computational capabilities, possesses enhanced input/output capability and a
number of on-chip functional units.
CPU RAM ROM
Microprocessor vs Microcontroller
Let us now take look at the most notable differences between a microprocessor and a
microcontroller.
Microprocessor Microcontroller
RAM, ROM, I/O Ports, and Timers can be RAM, ROM, I/O Ports, and Timers cannot be
added externally and can vary in numbers. added externally. These components are to be
embedded together on a chip and are fixed in
numbers.
External devices require more space and their A microcontroller-based system consumes less
power consumption is higher. power and takes less space.
memory. Today's processing speeds vastly outpace memory access times, and we employ a very
fast but small amount of memory (cache) local to the processor.
Harvard Architecture
The Harvard architecture offers separate storage and signal buses for instructions and data. This
architecture has data storage entirely contained within the CPU, and there is no access to the
instruction storage as data. Computers have separate memory areas for program instructions and
data using internal data buses, allowing simultaneous access to both instructions and data.
Programs needed to be loaded by an operator; the processor could not boot itself. In a Harvard
architecture, there is no need to make the two memories share properties.
Single memory to be shared by both code and data. Separate memories for code and data.
In the early 1980s, computer designers recommended that computers should use fewer
instructions with simple constructs so that they can be executed much faster within the CPU
without having to use memory. Such computers are classified as Reduced Instruction Set
Computer or RISC.
CISC vs RISC
The following points differentiate a CISC from a RISC −
CISC RISC
Larger set of instructions. Easy to program Smaller set of Instructions. Difficult to program.
Higher clock cycles per second. Low clock cycle per second.