You are on page 1of 24

Embedded Systems

Lec_03

Discrete Dynamics
&
Embedded Processors
Objectives
• Modeling of discrete dynamic systems
• Types of embedded processors used to
implement discrete dynamic system design

2
Discrete Systems
 A discrete system operates in a sequence of discrete
steps and is said to have discrete dynamics.
 Some systems are inherently discrete

A discrete event occurs at an instant of time rather than over time.


3
The Notion of State
 The state of a system is its condition at a particular
point in time
 In general, the state affects how the system reacts
to inputs
 Formally, the state is defined to be an encoding of
everything about the past that has an effect on the
system’s reaction to current or future inputs
 The state is a summary of the past

4
Finite – State Machines
 A state machine is a model of a system with
discrete dynamics that at each reaction maps
valuations of the inputs to valuations of the
outputs, where the map may depend on its current
state
 A finite-state machine (FSM) is a state machine
where the set States of possible states is finite

5
Finite – State Machines
 States = { State1; State2; State3}

If the number of states is reasonably small

6
Finite – State Machines
 Transitions between states govern the discrete
dynamics of the state machine and the mapping of
input valuations to output valuations.
 A transition is represented as a curved arrow

7
Extended State Machines
 The notation for FSMs becomes awkward when
the number of states gets large
 The garage counter in the previous figure
illustrates this point clearly
 An extended state machine solves this problem by
augmenting the FSM model with variables that
may be read and written as part of taking a
transition between states

8
Extended State Machines
 Extended state machine for the garage counter of
the previous figure

9
Nondeterminism
 Most interesting state machines react to inputs and produce
outputs. These inputs must come from somewhere, and the
outputs must go somewhere. We refer to this “somewhere”
as the environment of the state machine
 If for any state of a state machine, there are two distinct
transitions with guards that can evaluate to true in the same
reaction, then the state machine is nondeterministic.
 It is also possible to define state machines where there is
more than one initial state. Such a state machine is also
nondeterministic

10
Nondeterminism
 In both cases, a nondeterministic FSM specifies a
family of possible reactions rather than a single
reaction. Operationally, all reactions in the family
are possible
 The nondeterministic FSM makes no statement at
all about how likely the various reactions are

11
Behaviors and Traces
 Abstract away the passage of time and consider
only the sequence of reactions, without concern
for when in time each reaction occurs
 The amount of time that passes between reactions
is actually irrelevant to the behavior of an FSM

12
Behaviors and Traces
 Deterministic state machines have the property
that there is exactly one behavior for each set of
input sequences: That is, if you know the input
sequences, then the output sequence is fully
determined.
 Nondeterministic state machines can have more
than one behavior sharing the same input
sequences: hence cannot be viewed as a function
mapping input sequences to output sequences

13
Behaviors and Traces
 The set of all behaviors of a state machine M is
called its language
 A behavior may be more conveniently represented as
a sequence of valuations called an observable trace
 ((x0, y0), (x1, y1), (x2, y2)…)
 Traces and computation trees can be valuable for
developing insight into the behaviors of a state
machine and for verifying that undesirable behaviors
are avoided

14
Embedded Processors
 In general-purpose computing, the variety of instruction
set architectures today is limited, with the Intel x86
architecture overwhelmingly dominating all
 There is no such dominance in embedded computing
 On the contrary, the variety of processors can be daunting
to a system designer
 When deployed in a product, embedded processors
typically have a dedicated function
 Making them more specialized can bring enormous
benefits

15
Types of Processors
 As a consequence of the huge variety of embedded
applications, there is a huge variety of processors
that are used
 They range from very small, slow, inexpensive,
low-power devices, to high-performance, special-
purpose devices

16
Types of Processors
 Microcontrollers
– a small computer on a single integrated circuit
consisting of a relatively simple central processing unit
(CPU) combined with: peripheral devices such as
memories, I/O devices, and timers
– The simplest microcontrollers operate on 8-bit words
and are suitable for applications that require small
amounts of memory and simple logical functions
– consume extremely small amounts of energy, and often
include a sleep mode that

17
Types of Processors
 DSP Processors
– Many embedded applications do quite a bit of signal
processing
– A signal is a collection of sampled measurements of the
physical world, typically taken at a regular rate called
the sample rate
– Processors designed specifically to support numerically
intensive signal processing applications are called DSP
processors, or DSPs

18
Types of Processors
 Graphics Processors
– A graphics processing unit (GPU) is a specialized
processor designed especially to perform the
calculations required in graphics rendering
– Some embedded applications, particularly games, are a
good match for GPUs
– GPUs have evolved towards more general programming
models, and hence have started to appear in other
compute-intensive applications, such as instrumentation
– GPUs are typically quite power hungry

19
Parallelism
 Parallelism Vs Concurrency
– computer program is said to be concurrent if different
parts of the program conceptually execute
simultaneously
– A program is said to be parallel if different parts of the
program physically execute simultaneously on distinct
hardware
– Non-concurrent programs specify a sequence of
instructions to execute
» Parallelism exists to improve performance for computation-
intensive applications

20
Parallelism
 Pipelining
» Most modern processors are pipelined

21
Parallelism
 Pipelining
– In cycle 5, E is being fetched
while D is reading from the
register bank, while C is
using the ALU, while B is
reading from or writing to
data memory, while A is
writing results to the register
bank.
– The write by A occurs in
cycle 5, but the read by B
occurs in cycle 3. Thus, the Reservation Table
value that B reads will not be
the value that A writes This is called Data Hazard
22
Parallelism
 Multicore Architectures
– A multicore machine is a combination of several
processors on a single chip
– Heterogeneous multicore machines combine a variety
of processor types on a single chip, vs. multiple
instances of the same processor type
– For embedded applications, multicore architectures
have a significant potential advantage over single-core
architectures because real-time and safety-critical tasks
can have a dedicated processor

23
Parallelism
 Multicore Architectures
– This is the reason for the heterogeneous architectures
used for cell phones, since the radio and speech
processing functions are hard real-time functions with
considerable computational load
– In such architectures, user applications cannot interfere
with real-time functions

24

You might also like