You are on page 1of 48

CE-432

Embedded Systems
Instructor
Dr. Ali Ahmed
Assistant Professor at Usman Institute of Technology.
FALL 2017
About Me
• Ph.D. in Electronics and Communication from Hanyang University,
South Korea.
• Masters in Electronics and Communication (MS) from Hanyang
University, South Korea.
• Masters in Information Security (MS) from NUST, SEECS, Islamabad.
• Bachelor in Electronics (B.E.) from NED University of Engg. And Tech.,
Karachi.
• Research interests: Computer Architecture, Hardware Designing,
Information Security, Digital and Analog Electronics, FPGA and IoT.
About My Class (Homework 0):
All grading predicated on receipt of Homework 0.
• Q1: What is your name and roll no.?
• Q2: What you want to achieve from CE 432?
• Q3: Do you want some fun with problem driven projects in CE 432? Want to
create something? “Or” Want to study subject theoretically only?
• Q4: What is your last semester GPA?
• Q5: How do you rank your knowledge about the subjects given below? Give
your rating out of 5 (5 means excellent, 1 means poor)
1. CE 201 (Computer Architecture and organization)
2. EL 224 (Microprocessor based systems)
3. C++ or C programming language.
HOMEWORK IS DUE TOMORROW, PLEASE SUBMIT IT THROUGH YOUR CR.
Course Book and Reading material
• Embedded System Design: A Unified Hardware/Software
Introduction 
Frank Vahid and Tony Givargis
John Wiley & Sons; ISBN: 0471386782. Copyright (c) 2002. 
Book site at Wiley
Course Purpose
• This course introduces students to the design and analysis of computational systems that interact with
physical processes. Applications of such systems include medical devices and systems, consumer electronics,
toys and games, assisted living, traffic control and safety, automotive systems, process control, energy
management and conservation, environmental control, aircraft control systems, communications systems,
instrumentation, critical infrastructure control (electric power, water resources, and communications systems
for example), robotics and distributed robotics (telepresence, telemedicine), defense systems,
manufacturing, and smart structures.
• A major theme of this course is on the interplay of practical design with models of systems, including both
software components and physical dynamics. A major emphasis will be on building high confidence systems
with real-time and concurrent behaviors.
• Prior to taking this course, student should know the basics of computer architecture, programming
fundamentals and microprocessor. It includes embedded software and hardware co-design that allows
student to shift tradeoff from software to hardware and vice versa.
• This course lay foundation for those students that wish to take embedded system as career in future. This
course allow student to think outside the box by creating and developing novel solutions to the existing
problems using embedded systems, once they know the key concepts of embedded systems.
Course Description
• Learn the fundamentals of how gadgets are designed, developed, and
built as embedded systems.
Students completing this course will be well positioned to:
• Discuss the major components that constitute an embedded system.
• Implement small programs to solve well-defined problems on an
embedded platform, while creating one.
• Develop familiarity with tools used to develop in an embedded
environment
High-level View of Course Content:
Embedded System’s Overview
• Computing systems are everywhere
• Most of us think of desktop and similar computers
• PC’s
• Laptops
• Mainframes
• Servers
• Tablets
• Smart Phone
• Now Industry is shifting towards cloud computing
• But there’s another type of computing system
• Far more common...
Credits: Vahid/Givargis, Embedded Systems Design: A Unified
Hardware/Software Introduction, 2000
What is Embedded System?
• Write down the list of embedded systems near you?
• What is the purpose of each embedded system?
• What are the characteristics that distinguish such systems from other
computing systems?

Credits: Vahid/Givargis, Embedded Systems Design: A Unified


Hardware/Software Introduction, 2000
Definition of Embedded Computing Systems
• Computing systems embedded within electronic devices
• Hard to define. Nearly any computing system other than a desktop computer
• Billions of units produced yearly, versus millions of desktop units
• Perhaps 50 per household and per automobile

Computers are in here...

and here...

Lots more of these,


though they cost a lot
less each.

Credits: Vahid/Givargis, Embedded Systems Design: A Unified


Hardware/Software Introduction, 2000
Some common characteristics of embedded
systems
• Single-functioned
• Executes a single program, repeatedly
• Tightly-constrained
• Low cost, low power, small, fast, etc.
• Reactive and real-time
• Continually reacts to changes in the system’s environment
• Must compute certain results in real-time without delay
Output
Example of Embedded System
Consider an embedded system whose task is to control the inside Power
temperature of refrigerator. It should maintain the temperature at 10 oC .

This Embedded Systems needs a sensor that sense the temperature and a
a device that control the temperature, the device called Microcontroller.

If (Temp > 10)


output = 1,
Switch
Sensor else
On/Off
output = 0 Output
Temp,
I/P
Microcontroller

Embedded System inside Refrigerator

Do you want to make this simple embedded system in your


laboratory, using Arduino Board ?
Characteristics of Embedded System
• It’s a combination of hardware and software
• It’s a part of some larger system
• Its used to perform certain task
• Small in size
• Low power
• Low cost
Trends: Embedded Systems Market Study,
2017
Embedded Systems of future
Hardware Design for Embedded Systems

https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
https://ti.tuwien.ac.at/cps/teaching/courses/esevobachelor/
unterlagen/vortragsfolien-ws10/ese_13_hardware-design-
ws10.pdf
Arduino development board designing
A small outline transistor (SOT) is a
small footprint, discrete surface mount
transistor commonly used in consumer
electronics. Many manufacturers also
offer the nearly identical thin small
outline transistor (TSOT) package for
use in electronic circuits where height is
an important consideration.
In the table below, you can see a list of some components
in the Arduino UNO with their respective package:

https://diyhacking.com/make-arduino-board-and-bootload/
Design challenge – optimizing design metrics
• Common metrics
• Unit cost: the monetary cost of manufacturing each copy of the system, excluding NRE cost
• NRE cost (Non-Recurring Engineering cost): The one-time monetary cost of designing the system
• Size: the physical space required by the system
• Performance: the execution time or throughput of the system
• Power: the amount of power consumed by the system
• Flexibility: the ability to change the functionality of the system without incurring heavy NRE cost
• Time-to-prototype: the time needed to build a working version of the system
• Time-to-market: the time required to develop a system to the point that it can be released and sold to
customers
• Maintainability: the ability to modify the system after its initial release
• Correctness, safety, many more
Design metric competition -- improving one
may worsen others
• Expertise with both software and hardware is needed to optimize design metrics
• Not just a hardware or software expert, as is common
• A designer must be comfortable with various technologies in order to choose the best for a
given application and constraints

Power

Performance Size

NRE cost
Time-to-market: a demanding design metric
• Time required to develop a product to the point it can be sold to customers
• Market window
• Period during which the product would have highest sales
• Average time-to-market constraint is about 8 months
• Delays can be costly

Revenues ($)
Time (months)
Losses due to delayed market entry
• Simplified revenue model
• Product life = 2W, peak at W
• Time of market entry defines a triangle, representing market penetration
• Triangle area equals revenue
Peak revenue
• Loss
Peak revenue from
• The difference between the on-time and delayed triangle areas delayed entry
On-time

Revenues ($)
Area = 1/2 * base * height Market rise Market fall

On-time = 1/2 * 2W * W Delayed

Delayed = 1/2 * (W-D+W)*(W-D)


Percentage revenue loss = D W 2W
(D(3W-D)/2W2)*100% On-time Delayed Time

Try some examples: entry entry


Example of delay market entry
• The difference between the on-time and delayed triangle areas
• Area = 1/2 * base * height Peak revenue
• On-time = 1/2 * 2W * W
Peak revenue from
• Delayed = 1/2 * (W-D+W)*(W-D) delayed entry
On-time

Revenues ($)
• Percentage revenue loss = (D(3W-D)/2W )*100% 2
Market rise Market fall

• Try some examples Delayed


– Lifetime 2W=52 wks, delay D=4 wks
– (4*(3*26 –4)/2*26^2) = 22%
– Lifetime 2W=52 wks, delay D=10 wks D W 2W

– (10*(3*26 –10)/2*26^2) = 50% On-time Delayed Time


entry entry
– Delays are costly!
NRE and unit cost metrics
• Costs:
• Unit cost: the monetary cost of manufacturing each copy of the system, excluding NRE cost
• NRE cost (Non-Recurring Engineering cost): The one-time monetary cost of designing the system
• total cost = NRE cost + unit cost * # of units
• per-product cost = total cost / # of units
= (NRE cost / # of units) + unit cost
• Example
– NRE=$2000, unit=$100
– For 10 units
– total cost = $2000 + 10*$100 = $3000
– per-product cost = $2000/10 + $100 = $300

• Amortizing NRE cost over the units results in an additional $200 per unit
NRE and unit cost metrics
• Compare technologies by costs -- best depends on quantity
• Technology A: NRE=$2,000, unit=$100 • But, must also consider time-to-market
• Technology B: NRE=$30,000, unit=$30
• Technology C: NRE=$100,000, unit=$2

$200,000 $200
A A
B B
$160,000 $160
C C
to ta l c o st (x1000)

p e r p ro d u c t c o st
$120,000 $120

$80,000 $80

$40,000 $40

$0 $0
0 800 1600 2400 0 800 1600 2400
Num b e r o f units (vo lu m e ) Nu m b e r o f un its (vo lu m e )
The performance design metric
• Widely-used measure of system, widely-abused
• Clock frequency, instructions per second – not good measures
• Digital camera example – a user cares about how fast it processes images, not clock speed or instructions
per second
• Latency (response time)
• Time between task start and end
• e.g., Camera’s A and B process images in 0.25 seconds
• Throughput
• Tasks per second, e.g. Camera A processes 4 images per second
• Throughput can be more than latency seems to imply due to concurrency, e.g. Camera B may process 8
images per second (by capturing a new image while previous image is being stored).
• Speedup of B over A = B’s performance / A’s performance
• Throughput speedup = 8/4 = 2
Three key embedded system technologies
• Technology
• A manner of accomplishing a task, especially using technical processes,
methods, or knowledge
• Three key technologies for embedded systems
• Processor technology
• IC technology
• Design technology
Processor technology
• The architecture of the computation engine used to implement a system’s
desired functionality
• Processor does not have to be programmable
• “Processor” not equal to general-purpose processor
Controller Datapath Controller Datapath Controller Datapath

Control Control Registers Control index


Register logic
logic and file logic and total
State State Custom State +
register register ALU register
General
IR PC ALU IR PC
Data Data
memory memory
Program Data Program
memory memory memory
Assembly code Assembly code
for: for:

total = 0 total = 0
for i =1 to … for i =1 to …
General-purpose (“software”) Application-specific Single-purpose (“hardware”)
Processor technology
• Processors vary in their customization for the problem at hand
total = 0
for i = 1 to N loop
total += M[i]
end loop
Desired
functionality

General-purpose Application-specific Single-purpose


processor processor processor
General-purpose processors
• Programmable device used in a variety of Controller Datapath

applications Control Register


logic and file
• Also known as “microprocessor” State
register
• Features General
• Program memory IR PC ALU
• General datapath with large register file and general
ALU Program Data
memory
• User benefits memory

• Low time-to-market and NRE costs Assembly code


for:
• High flexibility
total = 0
• “Pentium” the most well-known, but there are for i =1 to …

hundreds of others
Single-purpose processors
• Digital circuit designed to execute Controller Datapath

exactly one program Control logic index


• a.k.a. coprocessor, accelerator or peripheral
• Features total
• Contains only the components needed to State register
execute a single program +
• No program memory
• Benefits
• Fast Data
memory
• Low power
• Small size
Application-specific processors
• Programmable processor optimized for a Controller Datapath

particular class of applications having Control Registers


logic and
common characteristics State
• Compromise between general-purpose and register
Custom
single-purpose processors ALU
IR PC
• Features Data
• Program memory Program memory
memory
• Optimized datapath
• Special functional units Assembly code
for:

• Benefits total = 0
for i =1 to …
• Some flexibility, good performance, size and
power
IC technology
• The manner in which a digital
(gate-level) implementation is
mapped onto an IC
• IC: Integrated circuit, or “chip”
• IC technologies differ in their gate

customization to a design IC package IC


source
oxide
channel drain

• IC’s consist of numerous layers Silicon substrate

(perhaps 10 or more)
• IC technologies differ with respect to
who builds each layer and when
IC technology
• Three types of IC technologies
• Full-custom/VLSI
• Semi-custom ASIC (gate array and standard cell)
• PLD (Programmable Logic Device)
Full-custom/VLSI
• All layers are optimized for an embedded system’s particular digital
implementation
• Placing transistors
• Sizing transistors
• Routing wires
• Benefits
• Excellent performance, small size, low power
• Drawbacks
• High NRE cost (e.g., $300k), long time-to-market
Semi-custom
• Lower layers are fully or partially built
• Designers are left with routing of wires and maybe placing some blocks
• Benefits
• Good performance, good size, less NRE cost than a full-custom
implementation (perhaps $10k to $100k)
• Drawbacks
• Still require weeks to months to develop
PLD (Programmable Logic Device)
• All layers already exist
• Designers can purchase an IC
• Connections on the IC are either created or destroyed to implement desired
functionality
• Field-Programmable Gate Array (FPGA) very popular
• Benefits
• Low NRE costs, almost instant IC availability
• Drawbacks
• Bigger, expensive (perhaps $30 per unit), power hungry, slower
Design Technology
• The manner in which we convert our concept of desired system
functionality into an implementation Compilation/
Synthesis
Libraries/
IP
Test/
Verification

System System Hw/Sw/ Model simulat./


Compilation/Synthesis: Automates specification synthesis OS checkers
exploration and insertion of
implementation details for lower
level.
Behavioral Behavior Cores Hw-Sw
specification synthesis cosimulators
Libraries/IP: Incorporates pre-
designed implementation from
lower abstraction level into higher
level. RT RT RT HDL simulators
specification synthesis components

Test/Verification: Ensures correct


functionality at each level, thus
reducing costly iterations between Logic Logic Gates/ Gate
levels. specification synthesis Cells simulators

To final implementation
The co-design ladder
• In the past:
• Hardware and software design technologies were very different
• Recent maturation of synthesis enables a unified view of hardware and software
• Hardware/software “codesign Sequential program code (e.g., C, VHDL)

Behavioral synthesis
Compilers (1990's)
(1960's,1970's)
The choice of hardware versus software for a particular function is simply Register transfers
a tradeoff among various design metrics, like performance, power, size, Assembly instructions RT synthesis
NRE cost, and especially flexibility; there is no fundamental difference (1980's, 1990's)
Assemblers, linkers
between what hardware or software can implement. (1950's, 1960's) Logic equations / FSM's
Logic synthesis
Machine instructions (1970's, 1980's)
Logic gates

Implementation
Microprocessor plus VLSI, ASIC, or PLD
program bits: “software” implementation: “hardware”
Independence of processor and IC
technologies
• Basic tradeoff
• General vs. custom
• With respect to processor technology or IC technology
• The two technologies are independent

General- Single-
purpose ASIP purpose
General, processor processor Customized,
providing improved: providing improved:

Flexibility Power efficiency


Maintainability Performance
NRE cost Size
Time- to-prototype Cost (high volume)
Time-to-market
Cost (low volume)

PLD Semi-custom Full-custom


Summary
• Embedded systems are everywhere
• PCB work flow is required to practically create an embedded system.
• Key challenge: optimization of design metrics
• Design metrics compete with one another
• A unified view of hardware and software is necessary to improve productivity
• Three key technologies
• Processor: general-purpose, application-specific, single-purpose
• IC: Full-custom, semi-custom, PLD
• Design: Compilation/synthesis, libraries/IP, test/verification

You might also like