Embedded systems: overview and classification
Overview and classification of embedded systems: definitions, key properties (real-time, resource-constrained, dedicated), architectural and application classifications, schedulability results (Rate Monotonic and EDF), power and cost trade-offs, with worked examples and exam guidance.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Embedded systems are everywhere: from a mobile-phone camera to a car airbag controller. Engineers use this topic to choose the correct hardware and software architecture, prove timing behavior for safety, and balance cost, power and performance during design and testing.
Key ideas
Start from first principles and simple definitions. Bold each defined term when first used.
Embedded system: a computing system that is designed to perform one or a few dedicated functions, often with real-time constraints, and typically embedded as part of a larger system. Assumptions: dedicated purpose, limited interface to user, may be resource-constrained (memory, CPU, power).
Microcontroller: a single-chip computer containing a CPU, on-chip memory (RAM and ROM/Flash), and peripherals (timers, UART, ADC). Use when cost, power and integration matter.
System on Chip (SoC): an integrated circuit that contains one or more processors, memory interfaces, and peripherals on a single die. Assumption: higher integration than a microcontroller; may include dedicated hardware accelerators.
Firmware: the low-level software that initializes and controls hardware, usually stored in non-volatile memory. Firmware sits between hardware and higher-level software (e.g., RTOS or application code).
Real-time system: a system where correctness depends not only on logical results but also on the time at which results are produced. Assumption: tasks have deadlines that matter for correctness.
Hard real-time: a class of real-time systems where missing a deadline is considered a total system failure (e.g., airbag). Correctness requires deadlines always met.
Soft real-time: a class where occasional deadline misses are tolerable and degrade quality (e.g., video streaming). Correctness is statistical or probabilistic.
Deterministic: predictable timing behavior (same inputs and state produce same timing). Important for hard real-time systems; often achieved by limiting dynamic features like caches, dynamic frequency scaling, or non-deterministic bus/memory behavior.
RTOS (real-time operating system): an OS that provides predictable scheduling, inter-task communication and timing services. Example services: task creation, mutexes, semaphores, timers, and priority-inversion control mechanisms (e.g., priority inheritance or priority ceiling) for mutexes.
Throughput: amount of work done per unit time (e.g., bytes/s, frames/s, instructions/s). Units depend on what 'work' means in context. Important for data-intensive embedded systems.
Latency: time between an external event (or request) and the system response. SI unit: seconds (s). Critical in control systems.
Power: electrical power consumed. SI unit: watts (W). Low-power operation is often a primary requirement in battery-operated embedded devices.
Classification dimensions (draw distinct categories):
- By application domain: consumer, automotive, industrial, medical, aerospace, IoT.
- By timing constraints: hard real-time, soft real-time, non-real-time.
- By architecture: microcontroller-based, microprocessor-based (with external memory), SoC, FPGA-based, ASIC, distributed embedded system (networked nodes).
- By performance/cost: resource-constrained (low RAM/CPU/power), mid-range, high-performance (multicore SoC with GPUs).
Exact scheduling results you must know (formal statements):
Rate Monotonic (RM) schedulability bound (Liu & Layland 1973): For a set of n independent, preemptible, periodic tasks with deadlines equal to their periods and fixed priorities assigned by period (shorter period → higher priority), a sufficient condition for schedulability is Σ (C_i / T_i) ≤ n(2^{1/n} − 1). Assumptions: tasks are independent (no blocking), deadlines = periods, context switch time ≈ 0, priorities fixed by period, tasks are periodic and worst-case execution times C_i are known, and a single processor is used. This bound is sufficient but not necessary; tighter analyses (e.g., response-time analysis) may show schedulability above the bound. As n → ∞, the bound tends to ln 2 ≈ 0.693. RM is optimal among fixed-priority assignments for implicit-deadline periodic tasks under these assumptions.
Earliest Deadline First (EDF) optimality: For the same task model but using preemptive dynamic-priority EDF scheduling, the task set is schedulable if and only if Σ (C_i / T_i) ≤ 1. Assumptions same as above.
Architectural trade-offs (state the trade):
- Microcontroller vs SoC: microcontrollers give lower cost/power and simpler firmware; SoCs give higher performance and integration but higher design complexity and sometimes higher power.
- FPGA vs ASIC: FPGAs allow post-fabrication changes and faster time-to-market; ASICs give lower unit cost and power for very high volumes but have high NRE (non-recurring engineering) cost.
What to draw (diagram descriptions):
- Draw a block diagram of a typical embedded system: center box labeled CPU/MCU; to the left a block "Sensors" with arrows into CPU; to the right a block "Actuators/Outputs" with arrows from CPU; below CPU draw "Memory (Flash, RAM)" with lines to CPU; above draw "Power supply / Battery"; draw a bus connecting CPU and memory; label interrupts line from sensors to CPU and label peripherals (UART, ADC, Timers) attached to CPU.
Formulas
U = Σ (C_i / T_i) — CPU utilization for task set. C_i is worst-case execution time of task i (s), T_i is period of task i (s). Dimensionless. Applies for periodic tasks.
U_RM_bound(n) = n (2^{1/n} − 1) — Liu & Layland utilization bound for Rate Monotonic scheduling. Dimensionless. Applies under RM assumptions.
U ≤ 1 — EDF schedulability condition for preemptive EDF (sufficient and necessary under assumptions). Dimensionless.
P = V · I — electrical power. V is voltage (V), I is current (A), P in watts (W). Applies to DC power of device.
E = P · t — energy used. P in watts (W), t in seconds (s), E in joules (J).
Throughput = work / time — general definition. Units depend on context (e.g., bytes/s, frames/s, instructions/s).
Worked examples
Example 1 — RM schedulability numeric (university exam style) Given: two periodic tasks
- Task 1: C1 = 20 ms, T1 = 50 ms
- Task 2: C2 = 20 ms, T2 = 100 ms Question: Is the task set schedulable under RM? Show steps. Steps:
- Compute utilizations: U1 = C1/T1 = 20/50 = 0.4; U2 = C2/T2 = 20/100 = 0.2.
- Total utilization U = U1 + U2 = 0.4 + 0.2 = 0.6.
- RM bound for n = 2: U_RM_bound(2) = 2(2^{1/2} − 1) = 2(1.41421356 − 1) ≈ 2(0.41421356) ≈ 0.82842712.
- Compare: U = 0.6 ≤ 0.8284 ⇒ sufficient condition satisfied. Conclusion: The task set is schedulable under Rate Monotonic. (Final answer in bold: Schedulable under RM.)
Example 2 — EDF check (conceptual + numeric) Same tasks as Example 1. For EDF, check Σ C_i/T_i ≤ 1: U = 0.6 ≤ 1 so schedulable. Final: Schedulable under EDF.
Example 3 — Architecture choice (short-answer model) Question: For a battery-powered temperature monitor with very low cost, simple control, and <16 kB RAM requirement, which architecture do you choose and why? Model answer steps:
- Constraints: low cost, battery, small RAM → favour microcontroller.
- Choose an 8/16-bit microcontroller with low-power sleep modes, built-in ADC and UART, on-chip Flash and RAM to avoid external memory. This minimises BOM and power.
- Use simple firmware without full RTOS; use interrupts for ADC-ready and low-power timers to wake up. Final sentence: Microcontroller-based solution with event-driven firmware.
Common mistakes
- Mixing units: using ms for C_i and seconds for T_i without conversion (always use same units).
- Ignoring context-switch and interrupt overhead in short deadlines; these are not free in practice.
- Confusing latency and throughput in exam answers or forgetting to state which matters for the given application.
- Saying "microprocessor" when the correct recommendation is "microcontroller" for tight power/cost constraints.
For your exam
Typical question types:
- Definitions (define embedded system, firmware, hard/soft real-time). A full-marks answer gives concise definition + one line example.
- Short notes (compare microcontroller vs SoC, list real-time requirements). Full marks: list 4–6 points each with consequences.
- Derivations (derive RM bound or show utilization test). Full marks: state assumptions, show steps for bound or apply numeric example.
- Numericals (schedulability tests). Full marks: show unit-consistent calculations, compute U, compare to bound, conclude.
- Diagrams (draw embedded system block diagram). Full marks: labelled CPU/Memory/Peripherals/Sensors/Actuators/Power and interrupt lines.
- Design questions (choose architecture given constraints). Full marks: state constraints, alternatives with trade-offs, final justified choice.
Always begin scheduling answers by listing assumptions (periodic/aperiodic, deadlines = periods, preemption allowed, context-switch cost negligible) — examiners deduct if assumptions are omitted.
Quick check
- Define a hard real-time system in one line.
- State the Liu & Layland sufficient condition for RM scheduling in symbols.
- If a task has C = 5 ms and T = 20 ms, what is its utilization (in decimal)? Answers: 1) A hard real-time system is one where missing any deadline is an unacceptable system failure. 2) Σ (C_i / T_i) ≤ n (2^{1/n} − 1) under RM assumptions. 3) 0.25 (25%).
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?