Professional Documents
Culture Documents
1st Session Unit III
1st Session Unit III
• The event ‘insert coin’, transitions the state to ‘wait for user input’.
• The system stays in this state until a user input is received from buttons
‘cancel’, ‘tea’ or ‘coffee’.
• If the event triggered in ‘wait state’ is cancel button press, the coin is
pushed out and the state transitions to ‘wait for coin’.
• If the event received in the ‘wait state’ is either ‘tea’ button press or
‘coffee’ button press, the state changes to ‘dispense tea’ and ‘dispense
coffee’ respectively.
• Once the coffee/tea vending is over, the respective states transitions back
to the ‘wait for coin’ state.
Assignment
• Design a coin operated public telephone unit
based on FSM model
• Page no. 210 & 211
Sequential Program Model
• Executed in sequence
• It is same as conventional procedural programming
• The program instructions iterated and executed
conditionally and the data gets transformed
through a series of operations.
• FSMs and flow charts are good for sequential
program modelling.
The execution of functions in a sequential program
model for ‘seat belt warning’ system is illustrated
#define ON 1
below
#define OFF 0
#define YES 1
#define NO 0
void seat_belt_warn()
{
wait_10sec();
if (check_ignition_key()==ON)
{
if(check_seat_belt()==OFF)
{
set_timer(5);
start_alarm();
while ((check_seat_belt()==OFF) && (check_ignition_key()==OFF) &&
(timer_expire==NO));
stop_alarm();
}
}
}
Concurrent/Communicating Process Model
• Models concurrently executing tasks/processes
• It easier to implement certain requirements in concurrent processing model
than the conventional sequential execution.
• Sequential leads to a single execution of task and leads poor processor
utilisation.
• If the task is split into multiple subtasks, it is possible to tackle the CPU usage
effectively.
Seat belt warning in concurrent processing model: we can split the tasks into:
1. Timer task for waiting 10 seconds (wait timer task).
2. Task for scheduling the ignition key status(ignition key status
monitoring task) .
3. Task for checking the seat belt status (seat belt status monitoring task).
4. Task for starting and stopping the alarm (alarm control task).
5. alarm timer task for waiting 5 seconds (alarm timer task).
Object Oriented Model
• Is object based model for modelling system requirements.
• Disseminates a complex s/w requirement into simple well
defined pieces called objects.
• It brings reusability, maintainability, productivity in system
design.
• Object is an entity used for representing or modelling a
particular piece of the system.
• Each object is characterized by a set of unique behavior and
state.
• A class is an abstract description of a set of objects and it is
considered as blueprint of an object.
• A class represents the state of an object through a member
variables and object behavior through member functions.
• Member variables and member functions of class may be
private, public or protected.
• Private members and functions are accessible only within
class.
• Public variables and functions are accessible within and
outside class.
• Protected are protected by external access.
• Class derived by parent class can access protected.
• The concept of object and class bring
• Abstraction: Abstraction means displaying only essential
information and hiding the details.
• Hiding:
• A key feature of object oriented programming is
'data - hiding' i.e., the data is concealed within a
class, so that it cannot be accessed mistakenly by
functions outside the class. 'private' and 'public' are
two types of protection available within a class.
• Protection:
• Data is not accessed by the other classes. Data is
protected within the class.
Unified Modeling Language (UML)
• Is a standardized modeling language consisting of an integrated set of
diagrams, developed to help system and software developers for
specifying, visualizing, constructing, and documenting the artifacts of
software systems.
• The main aim of UML is to define a standard way to visualize the way a
system has been designed. UML is not a programming language, it is
rather a visual language.
• As well as for business modeling and other non-software systems.
• The UML represents a collection of best engineering practices that have
proven successful in the modeling of large and complex systems.
• The UML is a very important part of developing object oriented software
and the software development process.
• The UML uses mostly graphical notations to express the design of
software projects.
• Using the UML helps project teams communicate, explore potential
designs, and validate the architectural design of the software.
UML Building Blocks
• Things, relationships and diagrams are building blocks of UML.
Things :
Structural things: represents mostly the static (lacking in
movement, action) part of a UML model. They are also known
as classifiers.
Behavioural things: represents mostly the dynamic
(characterized by constant change, activity, or progress) parts
of a UML model. Interaction, state machine and activity are
the behavioural things in UML.
Grouping things: are the organisational parts of a UML model.
Package and subsystem are the grouping things in UML.
Annotational things: are the explanatory parts of a UML
model. Note is the annotational thing in UML.
Behavioural diagram
Hardware Software Trade-Offs
• Certain system level processing requirements may be possible to
develop in either hardware or software.
• The decision is based on the trade offs and actual system
requirement.
Ex: Multimedia Codec (compression and decompression algorithm)
developed either s/w or h/w chip.
here trade off is performance and re-configurability.
developed in h/w may be more efficient, optimised with low-
processing and power requirements.
It is possible to develop in s/w using algorithm, but need not be
optimised for performance , speed and power efficiency.
A codec developed in s/w is re-usable and re-configurable
Developed in h/w is fixed and can not be modified.
h/w s/w trade offs in embedded system
design
Processing speed and performance
Frequency of change
Memory size and gate count
Reliability
Man hours (effort) and cost