Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(10EC74)
Unit - 01
Prof G B Gour 1
VTU Syllabus
Prof G B Gour 2
Unit-01
Introducing Embedded Systems
Philosophy
Prof G B Gour 3
Unit-01
Philosophy
Philosophy
Example:
ancestors, Shovel,
gasoline
Prof G B Gour 4
Unit-01
1. System within another system Embedded Systems
Type Avionics
Guidance Computer
Processor Discrete IC RTL based
Frequency 2.048 MHz
Memory 16- bit wordlength,
2048 words RAM
Prof G B Gour 9
According to Wayne Wolf,
“An Embedded System is a computing system other than
desktop computers.”
Prof G B Gour 10
First, an air conditioner is taken for understanding.
In air conditioner, temperature is the process variable. A controller inside will keep
on monitoring the process variable. If at all the room temperature changes due to
variation in external temperature, controller will take a counter acting signal and
PV (temperature) will be brought to required range.
Second case, controller inside a pace maker will keep monitoring the heart
beat count. If it is getting low, immediately a counter acting action will be taken
and it will boost up the heart.
Prof G B Gour 11
How to Identify an Embedded System?
Prof G B Gour 12
Prof G B Gour 13
4. System which brings features & capabilities to everyday things
Prof G B Gour 14
Challenges to an Embedded System
Prof G B Gour 15
1. Meeting Deadlines w.r.t product!!
Meeting deadline accurately will need high speed hardware. & Increasing
hardware components with quality would increase the cost of the product.
2. Hardware Selection
Too high speed processor would cost more and can drain battery also.
Prof G B Gour 16
3. Is it upgradable and maintainable?
* How the developer can fix the problem of already released mobile phone
in the market?
4. Will it work ?
It is proceeded through rigorous testing.
First it can be unit testing, next stage is Sanity Testing and the third stage can
be Regression testing.
Then through continuous monitoring….
Prof G B Gour 17
8. Building an Embedded System
Microprocessor
3
Microcomputer basic types of
computing
engines
Microcontroller
Prof G B Gour 18
Microprocessor
firmware, stored in ROM,
Instruction cycle
while (1)
Microcontroller {
Embedded Program
Instruction Cycle }
Prof G B Gour 19
9. An Embedded System w.r.t 3 Engines
Example:
an automobile with 100’s embedded microprocessors &
microcontrollers for managing:
Prof G B Gour 20
10. Watchdog Timer
Prof G B Gour 21
11. Real Time
Prof G B Gour 22
Soft Real Time System
failure to meet the time constraint results only in degraded
performance
Prof G B Gour 23
13. R T O S
Prof G B Gour 24
Unit-01
Embedded Design & Development Process
Sophisticated ones
Prof G B Gour 25
Embedded System Life Cycle
Increased Productivity
Reduced Design Life Cycle
Improved Product Quality
Prof G B Gour 26
Interfacing with Outside World
Prof G B Gour 27
Embedded System Design
(10EC74)
Unit - 02
Prof G B Gour 1
VTU Syllabus
Prof G B Gour 2
Unit-02
Hardware Side: Introduction
At Top:
VLSI Circuits, microprocessors, microcontrollers, FPGA’s, CPLD’s &
memories
Prof G B Gour 3
Next Level Down:
MSI Circuits,
Prof G B Gour 4
Unit-02
Hardware Side:
Core Level
Computing Core:
Prof G B Gour 5
Core Level
Memory:
Prof G B Gour 6
Data Path & Control Unit ( CPU ) :
Bus
electrical wires that carry the related
Address Bus
electrical signals into , out or throughout
Data bus the system
Control Bus
Prof G B Gour 7
High Level Functional diagram refined with Bus Structure
Prof G B Gour 8
Bit
Width
Examples:
Prof G B Gour 9
Microprocessor
Prof G B Gour 10
Microcomputer
Prof G B Gour 11
Microcontroller
Prof G B Gour 12
DSP
Prof G B Gour 13
Unit-02
Hardware Side:
Representing Information
Prof G B Gour 14
Word Size ( Examples ) Microprocessor with word size of 32 bits,
called 32-bit machine
Prof G B Gour 15
Unit-02
Hardware Side:
Understanding Numbers
Prof G B Gour 16
Unit-02
Hardware Side:
Addresses
Memory
Prof G B Gour 17
Unit-02
Hardware Side:
Instructions
Purpose of an Instruction
is to direct the hardware of the microprocessor to perform a series of
actions like, arithmetic, logical calculations, Read/ Write operations..etc..
Example: x = y + z
Prof G B Gour 18
Operators taking only single operand have an arity of one & called
Unary Operator
z = x + y
Prof G B Gour 19
x = x + y
++x or x++
Prof G B Gour 20
Interpretation of bits in 32 bit word w.r.t instructions
Prof G B Gour 21
Three Operand Instruction
Problem:
How to interpret a 32 bit word as different data types (operands) ?
Problem:
If an instruction containing a single operand , along with op code is
32 bits; then a 32 bit piece of data will not fit into any of the fields,
allocated to hold the operand
Register
Prof G B Gour 23
RISC /CISC
Main Points
Prof G B Gour 24
Example:
Hypothetical Microprocessor with number of instructions 144,
for unique identification of each instruction, needs an op code
with 8 bits => 27 < 144 < 28
Conclusion
For unique identification or access of each register, needs an operand
of 8 bits; REGISTER Designator
Type information
Grouping of bits has no inherent meaning, but interpretation does…..!!
Prof G B Gour 25
New Interpretation of the Operand Fields
Prof G B Gour 26
Three operand Instruction
Prof G B Gour 27
Prof G B Gour 28
Unit-02
Hardware Side:
Embedded Systems – An Instruction set View
Architecture I S A
Objectives:
to transfer or to store the data
make decisions based on the data values of the operations
Prof G B Gour 30
Data Transfer Instructions
Prof G B Gour 32
Use of Addressing Mode
Offers greater flexibility in accessing the data & controlling the flow of the
program as it executes
this leads to optimization of performance of an application
1 - Operand Instruction
Prof G B Gour 33
2 - Operand Instruction
3 - Operand Instruction
Prof G B Gour 34
Commonly used Addressing Modes
1. Immediate Mode
Uses one of the operand fields to hold the value of the operand.
( helps to reduce the number of memory access )
This is useful if, the value of the immediate operand is small ;
like loop indices or initializing values.
Prof G B Gour 35
Immediate Instruction in the form of 1 or 2 operand instruction
@ Assembly level
int x = 0xB;
MOVE OPR1, #Bh
Prof G B Gour 36
Variations on the Immediate Mode Instruction
Examples:
Prof G B Gour 37
2. Direct & Indirect Modes
Direct Mode
Prof G B Gour 38
Indirect Mode
Major Disadvantage
Additional Memory Access needed to retrieve an Operand
Prof G B Gour 39
3. Register Direct & Register Indirect Modes
Advantage
means to easily implement POINTER type Operations used in C/C++
Disadvantage
Additional Memory Access to get operand’s value
Prof G B Gour 40
Register Direct Mode
Assumes that , the values of x & y have been stored in registers R2 & R3
Prof G B Gour 41
Register Indirect Mode
Assumes that , the values of x & y have been stored in registers R2 & R3
Prof G B Gour 42
4. Indexed Mode ( Displacement Addressing Mode )
Advantage
for accessing Array type of data
Disadvantage
Time consumption in computation of ,
Effective Address = Base Address + Contents of Indexing Register
& then retrieving the value from memory
Prof G B Gour 43
Index Register
Base Register
Prof G B Gour 44
5. Program Counter Relative Mode ( P C R M )
Differences
Value in P C = Base Address
P C is assigned a value of computed effective address
Therefore contents of P C are modified due to inherent execution
As offset added to P C is a signed number, it may refer to an address
either higher or lower then the original value
Prof G B Gour 45
Index register
Prof G B Gour 46
Flow of Control or Execution Flow of Instructions
1. Sequential Flow
Prof G B Gour 47
2. Branch Flow
Decision Point
Prof G B Gour 48
Unconditional Branch
Conditional Branch
Prof G B Gour 49
o Conditional Information is temporarily held in as a collection of bits in
flag register or condition code register
Prof G B Gour 50
Typical Branching Instructions
Prof G B Gour 51
C/C++ Code Assembly Code
if (a = = b) CMP R2, R1;
c = d + e; BE $1
else SUB R3, R4, R5;
c = d - e; BR $2
$1: ADD R3, R4, R5;
$2: ….
Assembler Construct
Variable s a-e are placed in R1-R5
Compiler will create labels $1 & $2 if, the original source was
written in a high level language,
or by the designer if the original source was assembler code
Prof G B Gour 52
3. Loop
Code
Prof G B Gour 54
4. Procedure or Function Call
Control flow leaves the current context & executes the set of
instructions,
and then returns to the original context
Code i
function Call function
Code i +1
Prof G B Gour 55
Operation is supported by the instructions:
CALL
P C is unconditionally saved & replaced by specified operand,
Control is transferred to specified memory location
RET
Previously saved contents of P C are restored
& control is returned to previous context
STACK
Push
Increments the address held by the SP to refer to the next place
( new top of stack)
Then, writes the data to be stored into the address in memory indicated by
that address
The address in SP is incremented from a lower memory address to higher
memory address
Prof G B Gour 57
Arithmetic & Logical Instructions
Prof G B Gour 58
Unit-02
Embedded Systems:
A Register View
I S A Level
Prof G B Gour 59
Data Path (Set of Registers)
associated set of micro operations
on data held in registers
Control Unit
System’s behavior is expressed by the
directs the execution order of
movement of data among registers
micro operations
Prof G B Gour 60
Register Transfer Level ( R T L )
operation on data found at the instruction level are paralleled by
similar set of operations at the register level
Prof G B Gour 61
RTN
has direct equivalent
in contemporary hardware
design languages like,
HDLs,
Verilog or VHDL
Prof G B Gour 62
Prof G B Gour 63
Unit-02
Embedded Systems:
A Register View of Microprocessor
Data Path & Control of a Microprocessor
Prof G B Gour 64
Process Control Microprocessor’s data path is controlled by
4 basic operations of instruction cycle
Fetch
Fetch
At I S A level;
Decode MOVE IR, *PC;
Execute At R T L level;
MAR PC ;
MDR memory [ MAR ] ;
Next IR MDR ;
@ R T L level; @ I S A level;
MAR R1 ; ST *R1, R2;
MDR memory [ MAR ] ; @ C level;
R2 MDR ; *xptr = y ;
Prof G B Gour 66
Next Address of the next instruction to be executed depends on
type of instruction to be executed
state of condition flags as modified by the recently
completed instruction
2 types of Jumps:
1. Shorter Jump: displacement contained in one of the operands of an
instruction
2. Longer Jump: value contained in memory location following an instruction
@ R T L level;
TR0 IR < n…m> @ I S A level;
// say, offset contained in instruction ADD PC, offset ;
TR1 TR0 + PC;
PC TR1; // next instruction..
Prof G B Gour 67
Unit-02
Embedded Systems:
Concepts of STATE & TIME
TIME:
Neglecting delays through the system, o/p is the immediate & direct
function of current i/p(s). The present o/p of FSM depends on...
o Path the system took to reach the current state
o Present values of i/p set
Prof G B Gour 68
STATE:
State variables are the variables whose values changes over time & explains
the behavior of the circuit/ system
State of a system at any time is a set of values of State variables
initial fixed
1
Prof G B Gour 69
Unit-02
Embedded Systems:
STATE Diagram
In the Embedded World, the state diagram is the one to capture, describe
& specify the behavior of the system.
State b
1
State a
Prof G B Gour 70
Textual Description
enter room
if in State awake
Prof G B Gour 71
boring event
as sleep
enter room
Prof G B Gour 72
Unit-02
Embedded Systems:
Finite State Machine-
Theoretical Model
Prof G B Gour 73
Prof G B Gour 74
Embedded System Design
(10EC74)
Unit - 03
Prof G B Gour 1
VTU Syllabus
Prof G B Gour 2
Unit-03
Memories & Memory Sub System:
Classifying Memory
RAM
memory location is available for immediate access with RAM organized
as bits, bytes or words.
Prof G B Gour 3
D RAM
it is simple memory cell design with bit storage , implemented by stored
charge mechanism & the stored charge can leak away, if it not
repeatedly restored.
are used for larger memory systems
I/O is asynchronous w.r.t external system clock
S RAM
it is complex memory cell design with bit storage , implemented by
latch type mechanism & the stored data doesn’t have to be repeatedly
restored.
are used for high speed memory systems, faster than DRAM
I/O is asynchronous w.r.t external system clock
Prof G B Gour 4
Semi Static RAM
periphery is clock activated.
only 1 memory cycle is permitted/ clock
periphery ckt must allowed to reset after each active memory cycle for
minimum pre charge time, hence no refreshing needed.
SD RAM
synchronizes all addresses, data & control signals to system clock
& allows much higher data transfer rates than asynchronous transfers
Prof G B Gour 5
ROM
like a RAM, only location in memory is available for immediate access
RD operation is orders of magnitude faster than WR operation
WR operation usually involves programming the ROM
organized as bits, bytes or words
P ROM
programmed using programming device & that to only once
EP ROM
programmed using programming device & erasure is done by placing the
device under UV light
Prof G B Gour 6
EE P ROM
reprogrammed & erasure is done electrically via programming device
Flash
kind of a EE PROM,
can be reprogrammed in “ in situ”, device doesn’t have to be removed
from the circuit for reprogramming
Prof G B Gour 7
Unit-03
Memories & Memory Sub System:
A General Memory Interface
Prof G B Gour 8
Prof G B Gour 9
Memory Interface needs ...
Prof G B Gour 10
Unit-03
Memories & Memory Sub System:
R O M Overview
Prof G B Gour 11
Prof G B Gour 12
Unit-03
Memories & Memory Sub System:
Static RAM Overview
Prof G B Gour 13
Prof G B Gour 14
Unit-03
Memories & Memory Sub System:
Dynamic RAM Overview
Prof G B Gour 15
Prof G B Gour 16
Unit-03
Memories & Memory Sub System:
Chip Organization
Prof G B Gour 17
Unit-03
Memories & Memory Sub System:
Terminology
Read Operation
Write Operation
Prof G B Gour 18
Memory Cycle Time – time interval from the start of one
RD/WR to the next
Prof G B Gour 19
Block Size – logical view of a set of words
Bandwidth
Prof G B Gour 20
Latency
measures the time required to compute the address of the sequence
& then locate it’s first block of words in memory
Page
logical view placed on, large collection of words in memory.
Size of page can be given in words/Blocks
Prof G B Gour 21
Unit-03
Memories & Memory Sub System:
Memory Interface In Detail:
SRAM Design
oTo support 4K- 16 bit words, 12 address lines & 16 data lines needed
o With restriction of only 8 address lines & 8 data lines.. how?..
Memory Array
Prof G B Gour 22
Prof G B Gour 23
Unit-03
Memories & Memory Sub System:
Memory Interface In Detail:
DRAM Design
Prof G B Gour 24
Problem with SRAM
In SRAM design, insufficient pins were available on the microprocessor to
allow the necessary address bits to be controlled in parallel.
Solution
Multiplexing address into the chip as a row segment / Column Segment
& demultiplexing following the strobe (RAS/CAS)
Example:
4M-16 bit device a RAM , that will store 4 million 16 bit words
Prof G B Gour 25
DRAM Timing Analysis
Refresh Period -
Max. period by which all the
memory cells must be refreshed
Prof G B Gour 26
Prof G B Gour 27
Basic Timing Cycle is extended to reduce the time to perform Read/Write
Operations
Prof G B Gour 28
DRAM Refresh
Alternative Approach
Prof G B Gour 29
Unit-03
Memories & Memory Sub System:
Memory Interface In Detail:
DRAM Memory Interface
From microprocessor’s point of view, the interface for normal RD/WR operations
to DRAM is same as designed for SRAM
Prof G B Gour 30
Example:
Consider 4M word memory chip, organized as
4K rows & 1K columns,
with each row must be refreshed every 64 ms
Prof G B Gour 31
Interval between Phase-2 & Phase-1 sufficient for all changing &
propagating signals to settle before they are acted on by the logic
clocked by Phase-1
Prof G B Gour 33
Refresh Address
Different from the address used by normal RD/WR operations. For REFRESH
address, a 12-bit binary counter is used.
Prof G B Gour 34
A0 - A11 => 12 address bits (4K)
shared by row (ERA)
Prof G B Gour 35
Timing for the normal row & column address enable signals:
Phase-2
Phase-1
Prof G B Gour 36
Row & column address enable signals are asserted on Phase-1 of the
clock &
RAC/CAS are generated on Phase-2 of the clock
Prof G B Gour 37
Probability of collision with 3 operations:
Refresh Arbitration
Normal RD/WR
& Refresh
Prof G B Gour 38
Prof G B Gour 39
Prof G B Gour 40
Prof G B Gour 41
Unit-03
Memories & Memory Sub System:
Memory Map
Memory Map of a 16 bit Machine
ROM:
used to hold the words that are not
changing at run time
Prof G B Gour 42
RAM:
used to hold the words that are changing at run time
Non-Volatile RAM:
portion of RAM memory that is used for data to be retained, if the power is
removed from the system
Prof G B Gour 43
Unit-03
Memories & Memory Sub System:
Memory Sub System Architecture
Bottom Level
Smallest, fastest memories
Prof G B Gour 44
Unit-03
Memories & Memory Sub System:
Basic Concept of Caching
Cache:
small & fast memory that temporarily holds
copies of data & program instructions
from main memory
Prof G B Gour 45
Locality of Reference
Problem
Time burdens in an Embedded system are:
memory accesses & memory access speeds
Solution
Locality of Reference
Prof G B Gour 46
Cache System Architecture
DRAM
Prof G B Gour 47
Unit-03
Memories & Memory Sub System:
Designing A Cache System
Prof G B Gour 48
Unit-03
Memories & Memory Sub System:
Dynamic Memory Allocation
Prof G B Gour 49
Different Schemes of Dynamic Memory Allocation
( works well with an embedded system )
Swapping
Overlays
Prof G B Gour 50
Multiprogramming
Prof G B Gour 51
Embedded System Design
(10EC74)
Unit - 04
Prof G B Gour 1
VTU Syllabus
Prof G B Gour 2
Unit-04
System Design & Development
Getting ready
Prof G B Gour 3
Getting Started Designing & developing ES requires:
Prof G B Gour 4
Unit-04
Life Cycle Models:
Prof G B Gour 5
Will start with any stage/ phase/ step of engineering
Why reliability & Safety are important in early stages of the requirement
specifications & Design phase of life Cycle?
Cost
Time
Prof G B Gour 6
(2) Water-Fall Model
Recognition of Problems is
delayed until later states of
development, where the
cost of repair is higher
Prof G B Gour 7
(3) V-Cycle Model
Prof G B Gour 8
(4) Spiral Model
Prof G B Gour 9
Advantages:
Spiral model is an improvement over the Water-Fall Model & V-Model
because, it provides for multiple builds with many opportunities for RISK
assessment & customer involvement
Disadvantages:
This method is elaborate, difficult to manage & does not keep all developers
occupied during all the phases
Prof G B Gour 10
(5) Rapid- Prototyping-Incremental
Provides rapid implementation of high level portions of both H/D & S/F
in early stages of the development cycle
It allows the developers to construct working portions of the hardware &
software in incremental stages
Each stage has Design, Code & Unit Test, Integration test, Delivery
Thus it allows one to identify the major problems in the early stages
Prof G B Gour 11
Advantages
Customer benefits with an option to work with a functional unit much earlier
in development cycle
Feed back from customer encourages reverse flow through the process
Thus it can be used to refine or change the prototype to meet the real needs of
the customer
Prof G B Gour 12
Unit-04
Problem Solving – 5 Steps to Design
Requirements Definition
System Specification
Functional Design
Architectural Design
Prototyping
Prof G B Gour 13
Unit-04
Design Process
Design process related with how one particular model approaches the
interpretation of 5-Steps Design.
3) Functional Design
4) Architectural Design move inside the system, & repeat the process
for the internal implementation to meet the
5) Prototyping desired behavior
Prof G B Gour 14
Designing a Counter:
Example
By trip report from High Avionics .Inc.,
To capture the formal description of the complete system from customer’s point
of view
These requirement definitions plays the role between the customer &
people executing the Design
Prof G B Gour 16
Environment & System
Prof G B Gour 17
o From the Perspective of the Environment, the requirements definition must
include...
# Specification for the Environment
# Description of i/p’s & o/p’s through Environment
# Description of necessary behavior of the system
# Description of how the system is to be used
o From the System’s point of view, begins with high level abstraction
with outside view having proper definitions.
o then moving to lower levels of abstraction with more detailed definition
Prof G B Gour 18
o After transforming the definition of requirements into specification, will now
focus on High-Level-Behavior of the system
Prof G B Gour 19
Unit-04
Formulating the Requirements Specification
Prof G B Gour 20
To begin with....
Inputs
Environment System
Outputs
Prof G B Gour 21
1) Environment
Identify all the Entities of the Environment & then characterize their effects
on the System
Each entity that make up the environment is described by the name & Public
Interface consisting of i/p’s , o/p’s & its functional behavior
Prof G B Gour 22
c) Relationships:
* relationships between the entity & it’s activities
* accessing the relationship is responding
* is it producer or consumer !..
d) Safety & Reliability: to identify all the safety critical issues in the System
Specification Design
2) System To identify all the factors of the public interface of the system &
then characterize their effects on the environment
a) System i/p’s & o/p’s: the system interacts with the real world through the
entities described & defined in the environment
Prof G B Gour 23
may include like...
the name of the signal
use of the signal as input or output
nature of the signal as an event, data, state variable ..
It tells about how of the Design? but, not what Design is?
Master1:
must specify the system’s public interface
Outside View of
the System
Prof G B Gour 26
Unit-04
System Specification V/s System Requirements
1) Coupling:
* an estimate of interdependency of the modules
* lower the Coupling, better the job done during partitioning
* how to reduce the coupling? then...
2) Cohesion:
* it will bring the pieces together instead of partitioning..
* is measure of strength of the functional relatedness of elements in
the module
* idea is to create strong, high cohesive modules
Prof G B Gour 28
Unit-04
Functional Design:
Main objective:
* To find internal functional architecture for the system
by formulating the implementation of the Requirements
by the analysis of loose understanding of Design transformed into a
Precise Description
Advantages:
* Early Flexibility
* Time to explore before beginning to constraint system
Prof G B Gour 29
Role of Engineers:
Detailed Textual Functional description is to be understood by those in Application
Domain ( who will be doing HD/SF development)
Functional Decomposition:
•1st Functional decomposition is done by finding IMP internal variables & events
in the system.
Followed by successive Decomposition for each function until will get elementary
functions (forms Functional Model of the System )
Prof G B Gour 30
Ideally the functional Model should be executable, to allow verification w.r.t
specification
Example: one such tool behavioral Verilog model
Prof G B Gour 31
Prof G B Gour 32
Prof G B Gour 33
Functional Partitioning & Signal Flow between the major functional blocks
Prof G B Gour 34
Unit-04
Architectural Design:
Goal:
1. To select the most appropriate solution to the original problem(s), based on
variety of architectures
2. Choice of the best suited HD/SF partitioning & allocation of the functionality
Part III
S/F Part is concurrently developed
Decide about the Real time Kernel
( Co-Design)
Prof G B Gour 38
Unit-04
Prototyping:
Prof G B Gour 39
Unit-04
Archiving the Project:
When the product is finally released to production, still some work ha been left...?
Means:
During development, lot of information is produced, some of it used/unused,
then what must be saved for future revisions? ARCHIVING
Prof G B Gour 40
END of UNIT-04
Prof G B Gour 41