Module 4
Module 4
1. Explain the operational and non-operational quality attributes of embedded systems. Discuss each attribute
with their significance in product development.
Ans:
Operational quality attributes (online mode)
These attributes apply when the embedded system is in operation or online.
1. Response
• Response measures how quickly the system tracks changes in input variables and produces the
corresponding output.
• Many embedded systems, especially mission-critical ones like flight control or automotive brake
control, demand almost real-time response so that no critical deadlines are missed.
• Significance: Poor response can lead to safety hazards or unacceptable user experience, so designers
must consider worst-case scenarios and choose suitable processors, scheduling policies, and interrupt
mechanisms.
2. Throughput
• Throughput represents the efficiency of the system, defined as the rate of production or operation over
a period of time, such as transactions per minute in a card reader.
• It is usually evaluated using benchmarks, which act as reference performance criteria or standard
products for comparison.
• Significance: High throughput is crucial in applications like payment terminals or communication
gateways where a large number of operations must be served within limited time, directly affecting
system sizing and hardware selection.
3. Reliability
• Reliability indicates how much we can rely on the proper functioning of the system and reflects its
susceptibility to failures.
• It is expressed using Mean Time Between Failures (MTBF) and Mean Time To Repair (MTTR),
where MTBF shows failure frequency and MTTR shows allowed repair time.
• Significance: For critical embedded systems, MTTR must be very small (order of minutes), and high
MTBF ensures fewer breakdowns, influencing component quality, redundancy, and fault-tolerant
design.
4. Maintainability
• Maintainability deals with the ease of supporting and repairing the product, through both scheduled
(preventive) and corrective maintenance.
• Significance: Maintainability is closely linked to system availability; as reliability improves,
corrective maintenance reduces, so designers must plan diagnostics, modular design, and service
strategies.
MTBF
• Ideal availability is given by Ai = , showing how design decisions on reliability and repair
MTBF+MTTR
time affect usable uptime.
5. Security
• Security in embedded systems is often described using Confidentiality, Integrity and Availability for
data and applications.
• Significance: Security prevents unauthorised access, modification, or misuse of embedded devices,
which is vital in shared devices, industrial controllers, and network-connected embedded products.
6. Safety
• Safety focuses on the potential damages to operators, the public and the environment due to system
breakdown or hazardous emissions from the product.
• Significance: Safety analysis is mandatory in product engineering to evaluate possible damages and
define measures (protective circuits, shutdown mechanisms, standards compliance) to reduce risk to
an acceptable level.
• Significance: Understanding PLC helps plan investments, pricing strategy, and timing of new
versions; for example, new model phones launch at high price and drop significantly after a few
months.
2. Explain the fundamental issues in hardware-software co-design. Discuss the key decisions involved in
selecting the system model, architecture (RISC/CISC), programming language, and partitioning system
requirements.
Ans:
In hardware–software co-design, the same embedded system requirements must be realised partly in hardware and
partly in software, so several fundamental design decisions become critical: model, architecture, language and
partitioning.
Fundamental issues in HW–SW co-design
The co-design process starts from system-level processing requirements, expressed as functional needs rather than
separate hardware and software demands. These requirements are first modelled and simulated to check functionality
and performance, and only in the architecture phase are they mapped to specific hardware and software blocks based
on various trade-offs. The main fundamental issues are: selecting a suitable system model, selecting an appropriate
architecture (e.g., controller, datapath, RISC, CISC, VLIW, SIMD, MIMD), choosing a programming language that
matches the model and architecture, and finally partitioning system requirements into hardware and firmware.
1. Selecting the system model
• A model is a formal system with objects and composition rules used to capture system characteristics.
• In practice, no single model suffices; designers often switch between models as the design moves from
specification (functionality-oriented) to implementation (structure-oriented).
Common computational models in this chapter include Data Flow Graph (DFG), Control Data Flow Graph (CDFG),
State Machine Model, Sequential Program Model, Concurrent/Communicating Process Model and Object-Oriented
Model.
• At the requirements/specification stage, data-driven or behavioural models (e.g., DFG, CDFG, FSM) are
preferred to express what the system should do without implementation details.
• At the architectural/implementation stage, models must reveal structure (controllers, datapaths, tasks, objects,
communication), so designers use FSMD, concurrent processes, or OO models that map more directly to
hardware blocks and software tasks.
• Issue: Choosing models that both capture behaviour accurately and are amenable to automatic or manual
mapping to hardware and software; a poor choice complicates verification and partitioning.
3. With functional block diagrams, explain the operation of the following application-specific embedded
systems:
(i) Washing Machine Control System
(ii) Automatic Tea/Coffee Vending Machine
(iii) Automatic Seat Belt Warning System
Ans:
(i) Washing Machine Control System
Operation in brief
1. User inputs and modes
• The user selects wash parameters via keypad: type of cloth (Light / Medium / Heavy duty), wash
stage (Wash, Spin, Rinse) and washing time.
• These inputs go to the control unit, which runs the control algorithm.
2. Filling and sensing
• The controller opens the inlet valve to let water in through the inlet pipe into the outer tub.
• The water level sensor and temperature sensor continuously provide feedback about water level and
temperature.
• Based on feedback and selected program, the controller closes the inlet valve when required level and
temperature are reached.
3. Washing/agitation phase
• For top-loading machines, the agitator twists back and forth pulling clothes down and up; for
front-loading machines, clothes are tumbled and plunged into water repeatedly.
• The controller drives the motorised agitator/tumble tub with appropriate speed and direction
according to the selected cloth type and wash time.
4. Draining and spin phase
• After washing, the pump removes water from the tub and drains it through the outlet pipe.
• The inner tub spins at several hundred RPM, using centrifugal force to remove water through holes
into the stationary outer tub.
• This is the Spin phase (controlled via Spin button).
5. Rinse and completion
• The controller may repeat fill–agitate–drain cycles for rinsing based on the selected program.
• Status indications (e.g., stage, remaining time) are shown on LED/LCD display and status LEDs.
Thus, the washing machine is an application-specific embedded system where the controller orchestrates sensors and
actuators to implement different wash programs based on user input.
FSM-based operation
Vending starts by inserting a 5-rupee coin; user can then select Tea or Coffee or press Cancel to get the coin back.
1. State A – Wait for coin
• Initial state with no coin inserted.
• Event: Insert Coin → Action: accept coin → Next state: Wait for user input (State B).
2. State B – Wait for user input
• Machine waits for one of: Cancel, Tea button, Coffee button.
• Event: Cancel button press → Action: return coin → Next state: Wait for coin (State A).
• Event: Tea button press → Action: Dispense Tea → Next state: Dispense tea (State C).
• Event: Coffee button press → Action: Dispense Coffee → Next state: Dispense coffee (State D).
3. State C – Dispense tea
• Controller activates valves/pumps for tea mix and hot water to fill the cup.
• Event: Tea Dispensed → Action: Done → Next state: Wait for coin (State A).
4. State D – Dispense coffee
• Controller activates coffee mix and hot water valves/pumps.
• Event: Coffee Dispensed → Action: Done → Next state: Wait for coin (State A).
Possible enhancements include adding timeouts if no user input is given after coin insertion, and error states for
“Water not available” or “Tea/Coffee mix not available”
(iii) Automatic Seat Belt Warning System
Two main diagrams:
• FSM model for Seat Belt Warning System.
System requirement
1. When vehicle ignition is turned ON and the seat belt is not fastened within 10 seconds, the system generates
an alarm signal for 5 seconds.
2. The alarm turns OFF when any one of the following occurs first: 5-second alarm time expires, seat belt is
fastened, or ignition switch is turned OFF.
FSM-based functional
Operation:
1. State: Alarm Off
• Default state; alarm is not active.
• Event: Ignition Key ON → Action: start 10 s wait timer → Next state: Waiting.
2. State: Waiting
• System waits for 10 s to allow driver/passenger to fasten the seat belt.
• If Seat Belt ON occurs during Waiting, or Ignition Key OFF occurs, the system transitions back to
Alarm Off (no alarm).
• When the 10 s timer expires, it generates event Timer Expire → Next state: Alarm On (if ignition still
ON and seat belt OFF).
3. State: Alarm On
• Alarm output is activated and 5 s alarm timer is started.
• Alarm continues until any of these events occur first:
• Seat Belt ON, or
• Ignition Key OFF, or
• Alarm Time Expire (5 s over).
• On any of these events, system transitions to Alarm Off and alarm output is deactivated.
Timer FSM
• States: IDLE, READY, RUNNING.
• IDLE → READY on Load Timer (timer count loaded).
• READY → RUNNING on Start Timer (count begins decrementing).
• RUNNING → IDLE on Stop Timer or Timer Expire; on Timer Expire, Timeout flag/interrupt is set.
Together, the seat belt warning controller FSM, ignition and seat belt sensors, timers, and alarm actuator form an
application-specific embedded system that improves safety by reminding users to fasten seat belts promptly after
ignition is turned on.
4. Explain the Finite State Machine (FSM) model with the following examples:
(i) FSM model for an Automatic Tea/Coffee Vending Machine
(ii) FSM model for a Coin-Operated Telephone System
Ans:
Finite State Machine (FSM) is a model in which the system behaviour is described using a finite set of states, with
transitions triggered by events, and optional actions associated with transitions or states. The basic elements are: States
(current situation), Events (inputs/stimuli), Transitions (movement from one state to another), and Actions (activities
performed).
(i) FSM model for an Automatic Tea/Coffee Vending Machine (10 marks)
Show states A–I with transitions labelled as given (Line OK, Lift Receiver, Coin Insert, Line Busy, etc.).
Requirements captured by the FSM
• Call starts when receiver is lifted (off-hook) and a 1-rupee coin is inserted.
• User dials a number; if invalid, coin is returned when receiver is placed back.
• If line is busy or there is a line fault, coin is returned when receiver is placed back.
• If line is through, user can talk for 60 seconds; at 45 seconds, user is asked to insert another coin to continue
the call.
• If additional coin is not inserted, call terminates at 60 seconds.
• System goes to “Out of order” state when line fault occurs.
The same seat belt warning requirement is remodeled using multiple tasks:
• Tasks defined:
1. Wait Timer Task (10-second wait after ignition ON).
2. Ignition Key Status Monitor Task.
3. Seat Belt Status Monitor Task.
4. Alarm Control Task.
5. Alarm Timer Task (5-second alarm duration).
• Events used for communication:
• waittimerexpire – set by Wait Timer Task after 10 seconds.
• ignitionon / ignitionoff – set/reset by Ignition Monitor Task.
• seatbelton / seatbeltoff – set/reset by Seat Belt Monitor Task.
• alarmtimerstart, alarmtimerexpire – used by Alarm Control and Alarm Timer tasks.
• Behaviour:
• Wait Timer Task: sleeps 10 s, then sets waittimerexpire.
• Ignition Monitor Task: continuously updates ignitionon/ignitionoff events.
• Seat Belt Monitor Task: continuously updates seatbelton/seatbeltoff.
• Alarm Control Task:
• Waits for waittimerexpire.
• If ignitionon and seatbeltoff are set → starts alarm and sets alarmtimerstart.
• Then waits until one of alarmtimerexpire / ignitionoff / seatbelton occurs, then stops alarm.
• Alarm Timer Task: waits for alarmtimerstart, then sleeps 5 s and sets alarmtimerexpire.
(iii) Object-Oriented Model
The object-oriented (OO) model decomposes the system into interacting objects, each encapsulating state (data) and
behaviour (methods), with classes as blueprints for objects. It emphasises abstraction, encapsulation, reuse and
maintainability.
• Key OO concepts in embedded modelling:
• Object: Entity representing part of the system with its own state and behaviour.
• Class: Abstract description (blueprint) of a set of objects, containing member variables (state) and
member functions (behaviour).
• Access control: private, public, protected members to control visibility and protection.
• Inheritance: Derived classes inheriting behaviour and state from base classes.
OO modelling is often combined with UML class diagrams, sequence diagrams and state diagrams for embedded
systems.
6. With a neat block diagram, explain how a high-level source file is translated to an object file during
firmware development. Describe each stage of the translation process.
Ans:
Stages of translation
1. Preprocessor
• Input: High-level source file (.c) plus header files.
• Functions:
• Expands macros defined using #define.
• Processes conditional compilation directives (#if, #ifdef, #ifndef, #else, #endif).
• Includes header files using #include by literally copying their contents.
• Output: A pure high-level language file with all macros expanded and headers included, sometimes called
“preprocessed source”.
The preprocessor operates on source file directives and generates an expanded source file without preprocessor
directives.
2. Compiler (front end, optimization, code generation)
• Input: Pre-processed high-level source.
• Front end:
• Performs lexical analysis (tokenizing), syntax analysis (parsing), and semantic analysis (type checking,
scope resolution).
• Builds an intermediate representation (IR) of the program.
• Optimizer:
• Applies high-level and machine-independent optimizations like constant folding, dead-code
elimination, common subexpression elimination, loop optimizations.
• Code generator:
• Translates the IR into target-specific assembly language for the chosen microcontroller/processor.
• Output: Assembly source file (.asm or .s) containing symbolic instructions and labels.
Compiler converts the high-level program into target assembly code, with optional optimization.
3. Assembler
• Input: Assembly file generated by the compiler.
• Functions:
• Translates symbolic assembly instructions into actual machine opcodes for the target processor.
• Resolves symbolic labels into addresses (within that module).
• Builds relocation information, symbol table entries, and sections (code, data, bss).
• Output: Object file (.obj or .o), which is in a relocatable binary format (e.g., ELF, COFF) understood by the
linker.
Assembler converts assembly language into relocatable machine code and produces the object file.
4. Object file
• The object file contains:
• Machine code for the compiled module (text section).
• Initialised data, uninitialised data info.
• Symbol table (exported and undefined symbols).
• Relocation records so the linker can later adjust addresses.
In the final build, the linker combines multiple object files and libraries, resolves external symbols and relocates code
to generate the final executable or firmware image (e.g., HEX/BIN for ROM/Flash).
7. Explain the concepts of Time-to-Market and Time-to-Prototype. Discuss their significance in embedded
product development and strategies to minimize them.
Ans:
Time-to-Market and Time-to-Prototype are both time-based quality attributes that strongly influence the commercial
success of an embedded product.
Time-to-Market
Definition:
Time-to-Market is the elapsed time between the conceptualisation of a product and the point at which the product is
ready for selling or deployment.
• It covers idea generation, feasibility, design, development, testing, certification, and ramp-up to a shippable
product.
• In embedded products (mobiles, automotive ECUs, consumer gadgets), the market is highly competitive and
technology changes fast, so delay can make the product obsolete even before launch.
Significance in embedded development:
• If your time-to-market is long, competitors may launch similar or better products earlier and capture market
share.
• Since technology evolves rapidly, a design based on a “new” technology may become outdated by the time
you ship if development takes too long.
• Revenue and profit curves in the product life-cycle show that maximum profit is realised when you enter the
growth and maturity phases early; late entry can drop you straight into a saturated or declining market.
Strategies to minimise Time-to-Market:
• Use rapid prototyping to validate feasibility early and reduce re-design cycles.
• Reuse existing IP blocks, reference designs, and proven software components instead of reinventing them.
• Choose off-the-shelf components and development platforms (evaluation boards, RTOS, middleware) to avoid
long custom hardware cycles.
• Parallelise hardware and firmware development where possible, based on early stable interfaces.
• Maintain good requirements management to prevent late scope changes that cause slips.
Time-to-Prototype
Definition:
Time-to-Prototype is the time taken to build an initial working prototype that demonstrates the important features of
the product concept.
• A prototype is an informal, early version used to check feasibility, validate requirements, and uncover design
issues; it need not be fully optimised or production-ready.
• Fast prototyping helps you explore design alternatives and assess technical risk early in the project.
Significance in embedded development:
• A quick prototype helps detect hardware/firmware integration problems before committing to costly final
hardware.
• It reduces uncertainty: once feasibility is proven, detailed design estimates and schedules become more
realistic, which indirectly shortens time-to-market.
• Early feedback from customers or internal stakeholders (using the prototype) can refine requirements and
avoid expensive late changes.
Strategies to minimise Time-to-Prototype:
• Use evaluation boards, development kits and generic platforms instead of designing custom hardware for the
first iteration.
• Employ high-level tools and reusable firmware components (libraries, middleware, RTOS drivers) to get basic
functionality running quickly.
• Focus the prototype only on critical features and high-risk parts, not on full product polish, mechanicals, or
cost optimisation.
• Leverage re-usable assets from previous projects (code, schematics, test setups).
1. Write short notes on the following embedded design tools and methods:
(i) Data Flow Diagram (DFD)
(ii) Control Data Flow Diagram (CDFD)
(iii) State Machine Model
Ans:
All three are modelling tools used during embedded hardware–software co-design to capture behaviour and structure
before coding.
2. Explain the basic approaches for designing embedded firmware. Discuss the trade-offs between assembly
language and high-level language firmware development.
Ans:
Basic approaches to firmware design
In embedded design, once HW–SW partitioning is done, the functions mapped to software are implemented as
firmware using a suitable programming language.
• Assembly-only approach: Entire firmware is written in the target processor’s assembly language and
assembled to machine code.
• High-level language (HLL) approach: Firmware is written mainly in a high-level language such as C or
C++, compiled to assembly/machine code by a compiler.
• Mixed approach: Most of the code in C, with small performance-critical or device-specific parts in assembly
(e.g., context switch, ISRs, start-up code).
The choice is governed by trade-offs involving performance, memory, cost, development time, portability, and
maintainability.
Hardware
Excellent, cycle-accurate Good, but less predictable without care
control/timing
3. Explain the automotive communication buses (CAN, LIN, FlexRay) and discuss the key players in the
automotive embedded market. Highlight the significance of these buses in modern automotive design.
Ans:
Automotive communication buses
1. CAN – Controller Area Network
• Proposed by Bosch, CAN is a multi-master, message-oriented serial bus widely used in automotive safety and
powertrain systems.
• It supports medium-speed ISO11519 Class B (up to 125 kbps) and high-speed ISO11898 Class C (up to 1
Mbps).
• CAN is event-driven and includes robust error detection and handling, so it is used in critical applications
such as airbag control, engine control, ABS, and navigation systems.
2. LIN – Local Interconnect Network
• LIN is a low-speed, low-cost serial bus aimed at simple sensor/actuator networks and body electronics.
• It uses a single master and up to 16 slave nodes, with a single-wire physical layer and data rates up to 20 kbps.
• The master triggers all communication, eliminating arbitration issues and making LIN suitable for non-critical
functions like mirror control, fan control, seat position, window control, and similar comfort features.
3. FlexRay (and note on MOST)
• FlexRay is referenced in the context of automotive networking products alongside CAN and LIN, supplied by
vendors like Atmel.
• It is a high-speed, deterministic bus designed for x-by-wire and advanced safety systems where
time-triggered, fault-tolerant communication is required (e.g., steer-by-wire, brake-by-wire).
• The book also discusses MOST (Media-Oriented Systems Transport), a fibre-optic multimedia bus for
audio/video distribution, but your focus is CAN/LIN/FlexRay as control and body networks.