Академический Документы
Профессиональный Документы
Культура Документы
Surabhi Narayanan
Bangalore Professional Development Center
Outline
Introduction to UML
UML Diagrams:
State diagram
Sequence diagram
Use-case diagram
Class diagram
Activity diagram
Introduction to memory
BITS Pilani, Pilani Campus
Introduction
UML consists of a number of graphical elements
that combine to form diagrams.
OMG (Object Management Group) Standard
The purpose of the UML diagrams is to present
multiple views of a system; this set of multiple
views is called a MODEL.
The UML model of a system tells WHAT the
system is supposed to do, NOT how to
implement the system.
BITS Pilani, Pilani Campus
UML Diagrams To Be
Discussed
State diagrams
Sequence diagrams
Use Case diagrams
Class diagrams
Activity diagrams
There are more, but these are used more frequently
BITS Pilani, Pilani Campus
UML Object
The most fundamental primitives of UML are
the object and the class.
An object is an instance of a class.
Fig: An Object in UML
notation
UML Class
A class is a form of type definitionall objects derived
from the same class have the same characteristics,
although their attributes may have different values.
A class also defines the operations that determine how
the object interacts with the rest of the world.
A class defines
both
the
interface for a
particular
type
of object and
that
objects
implementation.
State diagram
State Machine
A state machine for an operation of the display is shown:
The start and stop states are special states that help us to organize the flow of the
state machine.
In some cases, we take conditional transitions out of states based on inputs or the
results of some computation done in the state. In other cases, we make an
unconditional transition to the next state.
Sequence diagram
Sequence Diagram
Processing includes three objects shown at the top of the
diagram.
Extending below each object is its lifeline, a dashed line
that shows how long the object is alive.
The display object uses call events to invoke the menu
object twice: once to determine which menu item was
selected and again to actually execute the menu call.
Sequence Diagram
Example: ATM
Flow of Events
User inserts card
System prompts user to enter
PIN
User enters PIN
System prompts user to select
services
User selects service - withdraw
money
System prompts user to enter
withdrawal amount
User enters withdrawal amount
System displays withdrawal
successful message, ejects card
and dispenses money
User collects card and money
BITS Pilani, Pilani Campus
Sequence Diagram
Example
Use-Case diagram
Use-Case diagrams
A use-case diagram is a set of use-cases
A use case is a model of the interaction
between
External users of a software product (actors) and
The software product itself
More precisely, an actor is a user playing a specific
role
Use-Case diagrams
Use-case Relationships
Use case
Actor
<<include>>
Use case
<<extends>>
Use case
Use case
PurchaseSingleTicket PurchaseMultipleTickets
<<includes>>
<<includes>>
CollectMoney
<<extends>>
NoChange
<<extends>>
Timeout
Class diagram
Symbol
Meaning
Exactly one
0..1
Zero or one
M..N
From M to N
Association
HR Manager
-Name: string
+ID: int
+GetName(): string
+SetName(string
sName)
HR Manager
-Name: string
+ID: int
+GetName(): string
+SetName(string
sName)
Finance
Manager
-Name: string
+ID: int
+GetName(): string
+SetName(string
sName)
R&D
Manager
-Name: string
+ID: int
+GetName(): string
+SetName(string
sName)
Inheritance
Employee
-Name: string
+ID: int
+GetName(): string
+SetName(string
sName)
Inheritance
The child class inherits the
properties and operations of the
base class
Adds its own specific
functionalities as well
Engineer
-Name: string
+ID: int
+GetName(): string
+SetName(string
sName)
Activity diagram
Activity Diagram
Activity Diagram represents the workflow
It contains activity states. An activity state
represents the execution of a statement in a
procedure or the performance of an activity in a
workflow.
An activity diagram may contain branches, as well
as forking of control into concurrent threads.
Concurrent threads represent activities that can be
performed concurrently by different objects or
persons.
BITS Pilani, Pilani Campus
Process
Order
Activity Diagram
Memory
Different Classes of
Memory
Traditional Distinction between Memories:
ROM (Read Only Memory) Non-volatile
RAM (Random Access Memory) Volatile
DRAM
34
BITS Pilani, Pilani Campus
Non-Volatile Memory
Erasing is slower than RAMs
Each device can be rewritten 1000,000 1,000,000 times only.
EEPROMs are usually used for storing non-volatile programs
and parameters.
Flash memory is usually used for storing both application
programs (including operating system) and large data records.
These are slower to read compared to RAM
It is a common practice in many real-time systems to load the
application-program (including the operating system) from a
flash memory to the RAM and then run it from the RAM.
In many cases the flash memory used is a movable one (e.g. a
SD Card or a USB Memory stick)
35
BITS Pilani, Pilani Campus
Evolution of DRAM
First page mode (FPM) DRAM
Extended data output (EDO) DRAM
Synchronous DRAM (SDRAM)
Direct Rambus DRAM (DRDRAM)
Double data rate 3 synchronous DRAM (DDR3
DRAM)
37
BITS Pilani, Pilani Campus
Memory Hierarchy
CPU Clock Rates are increasing at a faster rate
compared to DRAM access times.
Programmers always desire faster and infinite
memory.
Solution is Memory Hierarchy.
In order of fastest to slowest, memory should be
assigned, considering cost as follows:
Registers
Internal CPU memory
Cache
Main memory
Memory on board external devices
38
BITS Pilani, Pilani Campus
Cache
Cache memories rely on the
locality of reference principle.
Locality of reference
Cache
Controller
L2 Cache
L1
Cache
Cache Hierarchy
L1 Cache: Nearest cache to CPU
39
L2 Cache: Next level cache between L1 cache and Main
Memory
BITS
Pilani, Pilani Campus
40
41
BITS Pilani, Pilani Campus
Watchdog Timer
Something goes unexpectedly wrong with your
program, and one piece of code (a subroutine)
keeps running, and running and running.
Watchdog Timer resets a stuck system.
Typically a timer that counts to zero
Reboots the system if counter reaches zero
For normal operation the software has to ensure
that the counter never reaches zero (kicking the
dog)