You are on page 1of 38

KOM 151150

Sistem Embedded

Fakultas Ilmu Komputer Universitas Brawijaya


FILKOM | UB

MATAKULIAH : Sistem Embedded


KODE/ STATUS : KOM 151150
SKS :4
Dosen : Dahnial Syauqy, S.T, M.T, M.Sc
Email : dahnial87@ub.ac.id
Ruang : C.1.12
Agenda kuliah
• Introduction + Overview
• Design flow, spesifikasi dan model komputasi
• UML (unified Modelling Language)
• Interfacing dengan environment
• Hardware
• Data Communication in Embedded System
• Programming & Embedded OS
• -----------------------------------UTS-------------------------------------
• Scheduling
• Reliability dan fault tolerance
• Evaluasi dan Validasi
• Optimisasi
• Testing Embedded system
• Presentasi Project 1
• Presentasi Project 2
• -----------------------------------UAS-------------------------------------

18 September 2019 Slide 3


What is modeling?
• Modeling consists of building an abstraction of reality.
• Abstractions are simplifications because:
o They ignore irrelevant details and
o They only represent the relevant details.
• What is relevant or irrelevant depends on the purpose of the model.
Systems, Models and Views
• A model is an abstraction describing a subset of a system
• A view depicts selected aspects of a model
• A notation is a set of graphical or textual rules for depicting views
• Views and models of a single system may overlap each other

* *
System Model View
Described by Depicted by

• Examples:
 System: Aircraft
 Models: Flight simulator, scale model
 Views: All blueprints, electrical wiring, fuel system
Systems, Models and Views

Flightsimulator
Blueprints
Aircraft
Model 2
View 2
View 1
System
View 3
Model 1

Electrical
Wiring
Scale Model
What is UML?
UML (Unified Modeling Language)
 An emerging standard for modeling object-oriented software.
Reference: “The Unified Modeling Language User Guide”, Addison Wesley,
1999.

i.e:
Use case Diagrams
 Describe the functional behavior of the system as seen by the user.
Sequence diagrams
Describe the dynamic behavior between actors and the system and between objects of
the system
Statechart diagrams
 Describe the dynamic behavior of an individual object (essentially a finite state
automaton)
Pada UML 2.3 terdiri dari 13 macam diagram yang dikelompokkan dalam 3
kategori UML 2.3
Diagram

Structure Behavior Interaction


Diagram Diagram Diagram

Use Case Sequence


Class Diagram
Diagram Diagram

Communication
Object Diagram Activity Diagram
Diagram

Component State Machine


Timing Diagram
Diagram Diagram

Composite Interaction
Structure Overview
Diagram Diagram

Package
Diagram

Deployment
Diagram

18 September 2019 Slide 8


Use case diagram

18 September 2019 Slide 9


Use Case Diagram
 Use case diagram merupakan kelakukan/ behavior sistem yang dibuat
 Use case mendeskripsikan interaksi aktor dengan sistem
 Sederhananya, use case digunakan untuk mengetahui fungsi apa saja
dalam sebuah sistem dan siapa yang berhak menggunakan

Ada 2 hal utama pada use case


1) Aktor. Dapat berupa orang, proses, atau sistem lain yang berinteraksi dengan
sistem
2) Use case. Berupa fungsi yang disediakan sistem
UML first pass: Use case diagrams

Package Use case


Watch

Actor
ReadTime

SetTime
WatchUser WatchRepairPerson

ChangeBattery

Use case diagrams represent the functionality of the system


from user’s point of view
Example-1: Use Case of Telephone Answering Machine

18 September 2019 Slide 12


Sequence diagram

18 September 2019 Slide 13


Sequence Diagram
 Adalah diagram yang menggambarkan kelakuan objek pada use case
dengan mendeskripsikan waktu objek dan message yang dikirim/diterima
objek.
 Untuk menggambar diagram, perlu diketahui objek-objek yang terlibat
dalam sebuah use case
 Banyaknya diagram yang harus dibuat minimal sebanyak pendefinisian use
case
 Penggambaran letak pesan harus berurutan, pesan paling atas berjalan
terlebih dahulu

18 September 2019 Slide 14


UML first pass: Sequence diagram
Actor Object

:Watch :LCDDisplay :Time


:WatchUser

pressButton1() blinkHours()
pressButton1() blinkMinutes()

Message pressButton2() incrementMinutes()


refresh()
pressButtons1And2()
commitNewTime()
stopBlinking()

Activation
Lifeline

Sequence diagrams represent the behavior as interactions


Example

18 September 2019 Slide 16



Sequence Diagrams

© Oscar Nierstrasz
Sequence Diagram : Change Audio Volume

© Thiele, ETHZ
Statechart

18 September 2019 Slide 19


State-based Specification
Describe behavior of a system in terms of possible states and
transitions
 Capture the condition of a system in terms of its state
Hardware and control systems where the behavior of a system
is reactive
State-based specification techniques have:
 Explicit description and complete coverage of states and transitions
 Specification language and formal reasoning
 Precise mathematics
 Analysis tools
Concepts
State
 A state represents the computational readiness of a system at that instance of time during
its lifetime
Initial state
 The state in which a system starts
Condition
 Represents an existing on-going state of the system
Transition
 A transition is a change in the state of the system
Event
 An event is an instantaneous change in the environmental or internal condition of a
system.
Action/activity
 The function that is carried out or the event that is emitted upon the transition of the
system from one state to another
Techniques and Methods
• Finite state machines (FSM)
• SDL
• Petri nets
• Sequence diagrams
• Statecharts
• Computational tree logic
• ASLAN specifications
• UML state diagrams
Statecharts
Purpose
 Specification and design of discrete-event systems
 Provide behavioral description of reactive systems

“When event α occurs in state A and condition C is true, transfer state to B”

Features
 State-transition diagrams
 Hierarchy, concurrency and communication
 Uses area and location of graphical objects
 Statecharts = state diagrams + depth + orthogonality + broadcast-
communication
Example: Basic states
State changes from A to B when event b occurs and the condition P is true;
the output is c

18 September 2019 Slide 24


Depth (Hierarchy)
State charts extend FSM with:
• Refinement, clustering
• AND, OR decomposition of states (actually XOR, not OR)

FSM will be in exactly


one of the sub-states of
S if S is active
(either in A or in B or ..)

18 September 2019 Slide 25


State Charts
Modelling with hierarchy. Hierarchy is introduced by means of super-states

Definitions:
States comprising other states are called super-states.
States included in super-states are called sub-states of the super-states.

Definitions:
Each state which is not composed of other
states is called a basic state.

18 September 2019 Slide 26


State Charts

 Current states of FSMs are also called active states.


 States which are not composed of other states are called basic states.
 States containing other states are called super-states.
 Super-states S are called OR-super-states, if exactly one of the sub-states
of S is active whenever S is active.

superstate

substates
Default state mechanism

Default state
Filled circle
indicates sub-state entered
whenever super-state is
entered.
Not a state by itself!
History State
 Can use a history entrance (H).
 The state entered is the last state the level was in when it existed.
 The H entrance overrides a default state

18 September 2019 Slide 29


Orthogonality (Concurrency)
• AND-Super state
• Y is the orthogonal product of A and D

18 September 2019 Slide 30


Concurrent Substates

© Oscar Nierstrasz ESE 7.31


Timers

18 September 2019 Slide 32


Using timers: in an answering machine

.
When to develop a state chart?
• Model objects that have change state in interesting ways:
• Devices (microwave oven, Ipod)
• Complex user interfaces (e.g., menus)
• Transactions (databases, banks, etc.)
• Stateful sessions (server-side objects)
• Controllers for other objects
• Etc.
Example: behavior of an alarm
We can start with setting the
current time.
• Need to set hours, minutes,
seconds
• Need to decide which
buttons (one, both together)
do what

18 September 2019 Slide 35


Example: behavior of an ATM
ATM software states at a bank

9/18/2019 36
Next:
Interfacing dengan Environment

18 September 2019 Slide 38

You might also like