The document discusses various modeling programs for embedded systems, emphasizing the importance of creating models for dynamic control systems to save time and costs. It covers data flow models, control data flow graphs, finite state machines, and sequential program models, detailing their advantages and disadvantages. The document also provides examples and graphical representations to illustrate the concepts effectively.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
12 views43 pages
13 Modelling Programs 25-01-2025
The document discusses various modeling programs for embedded systems, emphasizing the importance of creating models for dynamic control systems to save time and costs. It covers data flow models, control data flow graphs, finite state machines, and sequential program models, detailing their advantages and disadvantages. The document also provides examples and graphical representations to illustrate the concepts effectively.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43
Modelling programs
Dr.K.Ragavan, SCOPE, VIT Vellore 2
Modelling programs • Creating a model for the embedded system provides a time-saving and cost-effective approach to the development of dynamic control systems, based on a single model maintained in a tightly integrated software suite. • It refers to a visual method for designing complex control systems
Dr.K.Ragavan, SCOPE, VIT Vellore 3
Modelling programs • Modelling processes are used for software analysis and design before software implementation. • A software analysis and design helps – A description of the system requirement – A description of how system works – Shows system validation • Graphical modelling languages use a diagram technique with named symbols that represent concepts and lines that connect the symbols and represent relationships and various other graphical notation to represent constraints.
Dr.K.Ragavan, SCOPE, VIT Vellore 4
Dr.K.Ragavan, SCOPE, VIT Vellore 5 DATA FLOW MODEL • A program is modelled as handling the input data streams and creating output data streams. • A data-flow means that a program flow such that specifically the data only determines all the program execution steps and program flows are determined specifically only by the data.
Dr.K.Ragavan, SCOPE, VIT Vellore 6
DATA FLOW MODEL • Programmer predetermines the data inputs and designs the programming steps to generate the data output.
• A set of data-input generates a set of data output
and another set of input will generate another output
Dr.K.Ragavan, SCOPE, VIT Vellore 7
Dr.K.Ragavan, SCOPE, VIT Vellore 8 Dr.K.Ragavan, SCOPE, VIT Vellore 9 Example of Data Flow graph (DFG) • A program for finding an average of grades in various subjects will have the data inputs of grades and data output of the average.
• Program executes a function to generate the
appropriate output.
• Name it as AVG FINDING
Dr.K.Ragavan, SCOPE, VIT Vellore 10
• An arrow directed towards the circle represents the data input (or set of inputs) and an arrow originating from the circle represents a data output (or a set of outputs).
• Data input along an input edge is considered as
token
• An input edge has at least one token.
Dr.K.Ragavan, SCOPE, VIT Vellore 11
DFD-FINITE IMPULSE SEQUENCE(FIR)-AVG FUNCTION
Dr.K.Ragavan, SCOPE, VIT Vellore 12
DFD-FINITE IMPULSE SEQUENCE(FIR)-AVG FUNCTION ( 6 INP/6 OUT)
Dr.K.Ragavan, SCOPE, VIT Vellore 13
ADVANTAGES of DFG • Data flow graph models help in a simple code design.
• which the program mostly breaks into Number of
DFGs.
• A DFG models a fundamental program element
having an independent path.
Dr.K.Ragavan, SCOPE, VIT Vellore 14
DISADVANTAGE OF DFG • A DFG gives that unit of a system, which has no control conditions and thus a single path for the program flow.
• Delay is Very high for complex applications
• Execution time is also high
Dr.K.Ragavan, SCOPE, VIT Vellore 15
Control Data Flow Graph (CDFG) Modelling • A control flow means that specifically only the program determines all program execution steps and the flow of a program
• The programmer predetermines these steps
• The steps may have loops or condition statements
in-between.
Dr.K.Ragavan, SCOPE, VIT Vellore 16
• Data that is input generate the data output after a control data-flow as per controlling conditions.
• Output(s) and paths taken after the steps depends on
the control statements for various decisions in a process.
Dr.K.Ragavan, SCOPE, VIT Vellore 17
Dr.K.Ragavan, SCOPE, VIT Vellore 18 Dr.K.Ragavan, SCOPE, VIT Vellore 19 • CDFG model, there is a diagram, which graphically represents the conditions and the program flow along a condition dependent path.
• Effect of events among the processes and shows
which processes are activated on each specific event.
Dr.K.Ragavan, SCOPE, VIT Vellore 20
Example-Control Data Flow Graph (CDFG) Modelling
Dr.K.Ragavan, SCOPE, VIT Vellore 21
ADVANTAGES - (CDFG) Modelling • a variable value changing above a limit or below a limit or falling within a range is also like an event that activates a certain process.
• Guides us how software to be tested for each path
starting from a decision node
• Helps in analysing the program in terms of
complexity
Dr.K.Ragavan, SCOPE, VIT Vellore 22
Dr.K.Ragavan, SCOPE, VIT Vellore 23 FSM Model
Dr.K.Ragavan, SCOPE, VIT Vellore 24
Dr.K.Ragavan, SCOPE, VIT Vellore 25 A STATE MACHINE AS: • A set of input events • A set of output events • A set of states • A function that maps states and input to output • A function that maps states and inputs to states (which is called a state transition function)
Dr.K.Ragavan, SCOPE, VIT Vellore 26
Dr.K.Ragavan, SCOPE, VIT Vellore 27 Finite States Machine(FSM) Model • A finite state machine is one that has a limited or finite number of possible states.
• A finite state machine can be used both as a
development tool for approaching and solving problems and as a formal way of describing the solution for later developers and system maintainers.
• There are a number of ways to show state machines,
from simple tables through graphically animated illustrations.
Dr.K.Ragavan, SCOPE, VIT Vellore 28
Example • The formal description of this state machine is the following: States: • A: if input == 1 then { output 0, state = B} else { output 0, state = A} • B: if input == 1 then { output 0, state = C} else { output 0, state = A} • C: if input == 1 then { output 0, state = C} else { output 1, state = A} • The initial state is A. • The final state is C Dr.K.Ragavan, SCOPE, VIT Vellore 29 Dr.K.Ragavan, SCOPE, VIT Vellore 30 Dr.K.Ragavan, SCOPE, VIT Vellore 31 Dr.K.Ragavan, SCOPE, VIT Vellore 32 Dr.K.Ragavan, SCOPE, VIT Vellore 33 Dr.K.Ragavan, SCOPE, VIT Vellore 34 Dr.K.Ragavan, SCOPE, VIT Vellore 35 Dr.K.Ragavan, SCOPE, VIT Vellore 36 Dr.K.Ragavan, SCOPE, VIT Vellore 37 Dr.K.Ragavan, SCOPE, VIT Vellore 38 Dr.K.Ragavan, SCOPE, VIT Vellore 39 Dr.K.Ragavan, SCOPE, VIT Vellore 40 Dr.K.Ragavan, SCOPE, VIT Vellore 41 SEQUENTIAL PROGRAM MODEL • Use of multiple function calls sequentially
Dr.K.Ragavan, SCOPE, VIT Vellore 42
Example Sequential Program Model=VM • Run function get_user_input ( ) for obtaining input for choice of chocolate from child. • Run function read_coins ( ) for reading the coins inserted into VendingMachine(VM) for cost of chocolate. • Run function deliver_chocolate() for delivering the chocolate. • Run function display_thanks() for displaying ‘Collect the nice chocolate. Visit again!’