Ecs-Unit I
Ecs-Unit I
Ecs-Unit I
UNIT I
Embedded Computing
Early history:
A microprocessor is a single-chip CPU. Very large scale integration
(VLSI) —the acronym is the name technology has allowed us to put a complete
CPU on a single chip since 1970s, but those CPUs were very simple.
• Late 1940’s: MIT Whirlwind computer was designed for real-time operations.
➢ Originally designed to control an aircraft simulator.
• First microprocessor was Intel 4004 in early 1970’s.
Microprocessors come in many different levels of sophistication; they are usually classified
by their word size.
➢ a 16-bit microcontroller is often used for more sophisticated applications that may
require either longer word lengths or off-chip I/O and memory;
➢ a 32-bit RISC microprocessor offers very high performance for computation-intensive
applications.
Real time: Many embedded computing systems have to perform in real time—
if the data is not ready by a certain deadline, the system breaks.
Example: Missed deadlines in printers, can result in scrambled pages.
Multirate: Many embedded computing systems have several real-time activities going on
at the same time. They may simultaneously control some operations that run at slow rates and
others that run at high rates.
Multimedia applications are prime examples of multirate behavior.
Power and energy: Power consumption directly affects the cost of the hardware, since a
larger power supply may be necessary. Energy consumption affects battery life, which is
important in many applications, as well as heat consumption.
Hardware includes- microprocessor, memory and peripheral devices. Selection of hardware must
meet both performance deadlines and manufacturing cost constraints so the choice of hardware is
important
• too little hardware and the system fails to meet its deadlines
• The brute force way of meeting a deadline is to speed up the hardware so that the
program runs faster but this makes system more expensive.
• Increasing the CPU clock rate may not make enough difference to execution
time, since the program’s speed may be limited by the memory system.
• In real-time applications we may not be able to easily stop the system to see
what is going on inside.
➢ Restricted development environments:
• The development environments for embedded systems (the tools used to
develop software and hardware) are often much more limited than those
available for PCs and workstations.
• Generally compile code on one type of machine, such as a PC, and
download it onto the embedded system.
• To debug the code, Embedded Computing Systems rely on programs that run
on the PC or workstation and then look inside the embedded system.
At the heart of embedded computing is real-time computing, the program receives its
input data; the deadline is the time at which a computation must be finished. If the program
does not produce the required output by the deadline, then the program does not work. In
order to understand the real-time behaviour of an ECS we have to analyze the system at
different levels of abstraction.
➢ CPU: The CPU clearly influences the behaviour of the program, particularly when
the CPU is a pipelined processor with a cache.
➢ Platform: The platform includes the bus and I/O devices. The platform components
that surround the CPU are responsible for feeding the CPU and can dramatically
affect its performance.
➢ Program: Programs are very large and the CPU sees only a small window of the
program at a time. We must consider the structure of the entire program to determine
its overall behaviour.
➢ Task: Several programs simultaneously run on a CPU, creating a multitasking
system. The tasks interact with each other in ways that have profound implications
for performance.
➢ Multiprocessor: Many embedded systems have more than one processor— they
may include multiple programmable CPUs as well as accelerators. Once again, the
interaction between these processors adds yet more complexity to the analysis of
overall system performance.
➢ We must analyze the design at each step to determine how we can meet the specifications.
➢ We must then refine the design to add detail.
➢ And we must verify the design to ensure that it still meets all system goals, such as cost,
speed, and so on.
Major levels of abstraction in the design process:
• Design process follows Top-down design:
Requirements:
Gather an informal description from the customers known as requirements, and refine the
requirements into a specification that contains enough information to begin designing the
system architecture.
Requirements may be Functional or Nonfunctional requirements:
1. Performance
➢ The speed of the system is often a major consideration both for the usability of
the system and for its ultimate cost.
➢ Performance may be a combination of soft performance metrics such as
approximate time to perform a user-level function and hard deadlines by
which a particular operation must be completed.
2. Cost:
➢ The target cost or purchase price for the system is almost always a
consideration.
➢ Cost typically has two major components: manufacturing cost includes the
cost of components and assembly; nonrecurring engi- neering (NRE) costs
include the personnel and other costs of designing the system.
➢ The physical aspects of the final system can vary greatly depending upon the
application.
➢ A handheld device typically has tight requirements on both size and weight
that can ripple through the entire system design.
4. Power Consumption:
➢ Power is important in battery-powered systems and is often important in other
applications as well.
➢ Power can be specified in the requirements stage in terms of battery life.
1. Name: Giving a name to the project not only simplifies talking about it to other
people but can also crystallize the purpose of the machine.
2. Purpose: This should be a brief one- or two-line description of what the system is
supposed to do.
3. Inputs and outputs: The inputs and outputs to the system encompass a wealth of
detail:
➢ Types of data: Analog electronic signals? Digital data? Mechanical inputs?
➢ Data characteristics: Periodically arriving data, such as digital audio
samples? Occasional user inputs? How many bits per data element?
4. Functions: This is a more detailed description of what the system does. A good way
to approach this is to work from the inputs to the outputs.
Specification:
➢ The specification must be carefully written so that it accurately reflects the customer’s
requirements.
➢ The specification should be understandable enough so that someone can verify that it
meets system requirements and overall expectations of the customer.
➢ It should also be unambiguous enough that designers know what they need to build.
Architecture Design
➢ The specification does not say how the system does things, only what the system does.
➢ Describing how the system implements those functions is the purpose of the architecture.
➢ The architecture is a plan for the overall structure of the system that will be used later to
design the components that make up the architecture.
A sample architecture or block diagram of the moving map:
➢ Block diagram shows major operations & data flow among them.
➢ The task performed by software running on a CPU and the operations performed by
special purpose hardware is not clear.
• Search the topographic DB & render the result for the display.
➢ Initial system block diagram is refined into two block diagram i.e one for hardware
and another for software.
Hardware block diagram:
System Integration
Structural Description
Structural description is nothing but the basic components of the system.
➢ The principal component of an object-oriented design is, naturally enough, the object.
➢ An object includes a set of attributes that define its internal state.
An object describing a display (such as a CRT screen) is shown in UML notation.
➢ The text in the folded-corner page icon is a note; it does not correspond to an object in
the system and only serves as a comment.
➢ The attribute is an array of pixels that holds the contents of the display in the above
example.
➢ The object is identified in two ways: It has a unique name, and it is a member of a
class. The name is underlined to show that this is a description of an object and not of
a class.
Class:
➢ A class is a form of type definition—all objects derived from the same class have the
same characteristics, although their attributes may have different values.
➢ A class defines the attributes that an object may have.
➢ It also defines the operations that determine how the object interacts with the rest of
the world.
The UML description of the Display class
There are several types of relationships that can exist between objects and classes:
➢ Association occurs between objects that communicate with each other but have no
ownership relationship between them.
➢ Aggregation describes a complex object made of smaller objects.
➢ Composition is a type of aggregation in which the owner does not allow access to the
component objects.
➢ Generalization allows us to define one class in terms of another.
Unified Modeling Language allows to define one class in terms of another. Consider an
example:
➢ Here deriving two particular types of displays. The BW_display, describes a black
and-white display. This does not require us to add new attributes or operations, but we
can specialize both to work on one-bit pixels.
➢ Color_map_display, uses a graphic device known as a color map to allow the user to
select from a large number of available colors even with a small number of bits per
pixel.
➢ A derived class inherits all the attributes and operations from its base class. In this
class, Display is the base class for the two derived classes.
➢ A derived class is defined to include all the attributes of its base class.
Association:
➢ Association between classes.
➢ When generalized into classes, we define an association between the message set
class and the message class. The association is drawn as a line between the two
labelled with the name of the association, namely, contains.
➢ The ball and the number at the message class end indicate that the message set may
include zero or more message objects.
Behavioral Description
A state machine specification in UML which helps in understanding the semantics of UML
state machines.
➢ The start and stop states are special states that help us to organize the flow of the state
machine.
➢ The states in the state machine represent different conceptual operations.
➢ State machine includes state transition based on conditional and unconditional
transition.
➢ Both the unconditional and conditional transitions make use of the call event.
The user sends messages to the train with a control box attached to the tracks. The control
box may have familiar controls such as a throttle, emergency stop button, and so on. Since
the train receives its electrical power from the two rails of the track, the control box can send
signals to the train over the tracks by modulating the power supply voltage.
Requirements
➢ The console shall be able to control up to eight trains on a single track.
➢ The speed of each train shall be controllable by a throttle to at least 63 different levels
in each direction (forward and reverse).
➢ There shall be an inertia control that shall allow the user to adjust the responsiveness
of the train to commanded changes in speed.
➢ There shall be an emergency stop button.
➢ An error detection scheme will be used to transmit messages.
Example:
Conceptual Specification
A train control system turns commands into packets. Commands and packets may not
to be generated in a 1 to 1 ratio.
There are 2 major subsystems: the command unit and the train-board component.
Class diagram for the train controller messages:
UML Collaboration diagram for major subsystems of the train controller system:
The command unit and receiver are each represented by objects; the command unit sends a
sequence of packets to the train’s receiver, as illustrated by the arrow .The notation on the
arrow provides both the type of message sent and its sequence in a flow of messages; since
the console sends all the messages, we have numbered the arrow’s messages as 1..n.Those
messages are carried over the track.
Break down the command unit and receiver into their major components.
➢ The console needs to perform three functions: read the state of the front panel on the
command unit, format messages, and transmit messages.
➢ The train receiver must also perform three major functions: receive the message,
interpret the message (taking into account the current speed, inertia setting, etc.),and
actually control the motor.
A UML class diagram for the train controller showing the composition of the subsystems.
Detailed Specification
Conceptual specification that defines the basic classes, refine it to create a more
detailed specification.
Class diagram includes attributes and behaviors of the classes.
The Panel has three knobs: train number (which train is currently being controlled), speed
(which can be positive or negative), and inertia. It also has one button for emergency-stop.
When we change the train number setting, we also want to reset the other controls to the
proper values for that train so that the previous train’s control settings are not used to change
the current train’s settings .To do this, Knobs* must provide a set-knobs behavior that allows
the rest of the system to modify the knob settings.
The speed of electric motors is commonly controlled using pulse-width modulation. The
digital interface to the motor system specifies that pulse width as an integer, with the
maximum value being maximum engine speed. A separate binary value controls direction.
The Panel class defines a behavior for each of the controls on the panel. The new-settings
behavior uses the set-knobs behavior of the Knobs* class to change the knobs settings
whenever the train number setting is changed. The Motor-interface defines an attribute for
speed that can be set by other classes.
The Transmitter provides a distinct behavior for each type of message that can be sent; it
internally takes care of formatting the message. The Receiver class provides a read-cmd
behavior to read a message off the tracks.
The formatter holds the current control settings for all of the trains. The send-command
method is a utility function that serves as the interface to the transmitter. The operate
function performs the basic actions for the object. The panel-active behaviour returns true
whenever the panel’s values do not correspond to the current values.
Sequences diagram for transmitting a control input:
Two changes to the knob settings: first to the throttle, inertia, or emergency stop; then to the train
number. The panel is called periodically by the formatter to determine if any control settings have
changed. If a setting has changed for the current train, the formatter decides to send a command,
issuing a send-command behavior to cause the transmitter to send the bits. Because transmission is
serial, it takes a noticeable amount of time for the transmitter to finish a command; in the meantime,
the formatter continues to check the panel’s control settings. If the train number has changed, the
formatter must cause the knob settings to be reset to the proper values for the new train.
If the train number changes, it updates the panel display; otherwise, it causes the required
message to be sent.
The operate behavior is called by the receiver when it gets a new command; operate looks at
the contents of the message and uses the issue-command behavior to change the speed,
direction, and inertia settings as necessary.
The Controller’s operate behavior must execute several behaviors to determine the nature of
the message. Once the speed command has been parsed, it must send a sequence of
commands to the motor to smoothly change the train’s speed.