Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE) PDF Download

DFD : Levels and Model 

The DFD model of a system typically consists of several DFDs, viz., level 0 DFD, level 1 DFD, level 2 DFDs, etc.  A single data dictionary should capture all the data appearing in all the DFDs constituting the DFD model of a system. 

Balancing DFDs  

The data that flow into or out of a bubble must match the data flow at the next level of DFD. This is known as balancing a DFD. The concept of balancing a DFD has been illustrated in fig. 36.4. In the level 1 of the DFD, data items d1 and d3 flow out of the bubble 0.1 and the data item d2 flows into the bubble P1. In the next level, bubble 0.1 is decomposed. The decomposition is balanced, as d1 and d3 flow out of the level 2 diagram and d2 flows in. 

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.4 An example showing balanced decomposition 

Context Diagram 

The context diagram is the most abstract data flow representation of a system. It represents the entire system as a single bubble. This bubble is labeled according to the main function of the system. The various external entities with which the system interacts and the data flow occurring between the system and the external entities are also represented. The data input to the system and the data output from the system are represented as incoming and outgoing arrows. These data flow arrows should be annotated with the corresponding data names. The name context diagram is well justified because it represents the context in which the system is to exist, i.e. the external entities who would interact with the system and the specific data items they would be supplying the system and the data items they would be receiving from the system. The context diagram is also called the level 0 DFD. 

To develop the context diagram of the system, we have to analyse the SRS document to identify the different types of users who would be using the system and the kinds of data they would be inputting to the system and the data they would be receiving from the system. Here, the term “users of the system” also includes the external systems which supply data to or receive data from the system.

The bubble in the context diagram is annotated with the name of the software system being developed (usually a noun). This is in contrast with the bubbles in all other levels which are annotated with verbs. This is expected since the purpose of the context diagram is to capture the context of the system rather than its functionality. 

Example 1: RMS Calculating Software 

A software system called RMS calculating software would read three integral numbers from the user in the range of -1000 and +1000 and then determine the root mean square (rms) of the three input numbers and display it. In this example, the context diagram (fig. 36.5) is simple to draw. The system accepts three integers from the user and returns the result to him.  

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.5 Context Diagram 

Example 2: Tic-Tac-Toe Computer Game

Tic-tac-toe is a computer game in which a human player and the computer make alternative moves on a 3 * 3 square. A move consists of marking previously unmarked square. The player, who is first to place three consecutive marks along a straight line (i.e. along a row, column, or diagonal) on the square, wins. As soon as either of the human player or the computer wins, a message congratulating the winner should be displayed. If neither player manages to get three consecutive marks along a straight line, nor all the squares on the board are filled up, then the game is drawn. The computer always tries to win a game. The context diagram of this problem is shown in fig. 36.6. 

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.6 Context diagram for tic-tac-toe computer game 

Developing the DFD Model 

A DFD model of a system graphically depicts the transformation of the data input to the system to the final result through a hierarchy of levels. A DFD starts with the most abstract definition of the system (lowest level) and at each higher level DFD, more details are successively introduced. To develop a higher-level DFD model, processes are decomposed into their sub-processes and the data flow among these sub-processes is identified. To develop the data flow model of a system, first the most abstract representation of the problem is to be worked out. The most abstract representation of the problem is also called the context diagram. After, developing the context diagram, the higher-level DFDs have to be developed.

Context Diagram 

Level 1 DFD: To develop the level 1 DFD, examine the high-level functional requirements. If there are between 3 to 7 high-level functional requirements, then these can be directly represented as bubbles in the level 1 DFD. We can then examine the input data to these functions, the data output by these functions, and represent them appropriately in the diagram. If a system has more than 7 high-level functional requirements, then some of the related requirements have to be combined and represented in the form of a bubble in the level 1 DFD. Such a bubble can be split in the lower DFD levels. If a system has less than three high-level functional requirements, then some of them need to be split into their sub-functions so that we have roughly about 5 to 7 bubbles on the diagram.  

Decomposition: Each bubble in the DFD represents a function performed by the system. The bubbles are decomposed into sub-functions at the successive levels of the DFD. Decomposition of a bubble is also known as factoring or exploding a bubble. Each bubble at any level of DFD is usually decomposed to anything between 3 to 7 bubbles. Too few bubbles at any level make that level superfluous. For example, if a bubble is decomposed to just one bubble or two bubbles, then this decomposition becomes redundant. Also, too many bubbles, i.e. more than 7 bubbles at any level of a DFD makes the DFD model hard to understand. Decomposition of a bubble should be carried on until a level is reached at which the function of the bubble can be described using a simple algorithm.

Numbering the Bubbles: It is necessary to number the different bubbles occurring in the DFD. These numbers help in uniquely identifying any bubble in the DFD from its bubble number. The bubble at the context level is usually assigned the number 0 to indicate that it is the 0 level DFD. Bubbles at level 1 are numbered, 0.1, 0.2, 0.3, etc. When a bubble numbered x is decomposed, its children bubble are numbered x.1, x.2, x.3, etc. In this numbering scheme, by looking at the number of a bubble, we can unambiguously determine its level, its ancestors and its successors.  

Example: Supermarket Prize Scheme 

A supermarket needs to develop the following software to encourage regular customers. For this, the customer needs to supply his/her residence address, telephone number and the driving license number. Each customer who registers for this scheme is assigned a unique customer number (CN) by the computer. A customer can present his CN to the check out staff when he makes any purchase. In this case, the value of his purchase is credited against his CN. At the end of each year, the supermarket intends to award surprise gifts to 10 customers who make the highest total purchase over the year. Also, it intends to award a 22 carat gold coin to every customer whose purchase exceeds Rs.10,000. The entries against the CN are the reset on the day of every year after the prize winners’ lists are generated. 

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.7 Context diagram for supermarket problem 

The context diagram for this problem is shown in fig. 36.7, the level 1 DFD in fig. 36.8, and the level 2 DFD in fig. 36.9.

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

          Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.8 Level 1 diagram for supermarket problem 

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.9 Level 2 diagram for supermarket problem 

Data Dictionary for the DFD Model 

address: name + house# + street# + city + pin 

sales-details: {item + amount}* + CN 

CN: integer 

customer-data: {address + CN}* 

sales-info: {sales-details}*

winner-list: surprise-gift-winner-list + gold-coin-winner-list 

surprise-gift-winner-list: {address + CN}*

gold-coin-winner-list: {address + CN}*

gen-winner-command: command 

total-sales: {CN + integer}* 

Common Errors in Constructing DFD Model 

Although DFDs are simple to understand and draw, students and practitioners alike encounter similar types of problems while modelling software problems using DFDs. While learning from experience is a powerful thing, it is an expensive pedagogical technique in the business world. It is therefore helpful to understand the different types of mistakes that users usually make while constructing the DFD model of systems. 

  • Many beginners commit the mistake of drawing more than one bubble in the context diagram. A context diagram should depict the system as a single bubble.
  • Many beginners have external entities appearing at all levels of DFDs. All external entities interacting with the system should be represented only in the context diagram. The external entities should not appear at other levels of the DFD.
  • It is a common oversight to have either too less or too many bubbles in a DFD. Only 3 to 7 bubbles per diagram should be allowed, i.e. each bubble should be decomposed to between 3 and 7 bubbles.
  • Many beginners leave different levels of DFD unbalanced.
  • A common mistake committed by many beginners while developing a DFD model is attempting to represent control information in a DFD. It is important to realize that a DFD is the data flow representation of a system and it does not represent control information. The following examples represent some mistakes of this kind: 
    • A book can be searched in the library catalogue by inputting its name. If the book is available in the library, then the details of the book are displayed. If the book is not listed in the catalogue, then an error message is generated. While generating the DFD model for this simple problem, many beginners commit the mistake of drawing an arrow (as shown in fig. 36.10) to indicate the error function is invoked after the search book. But, this is a control information and should not be shown on the DFD. 

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 36.10 To show control information on a DFD – A mistake 

  • Another error is trying to represent when or in what order different functions (processes) are invoked and the conditions under which different functions are invoked.
  • If a bubble A invokes either the bubble B or the bubble C depending upon some conditions, we need only to represent the data that flows between bubbles A and B or bubbles A and C and not the conditions depending on which the two modules are invoked. 
  • A data store should be connected only to bubbles through data arrows. A data store cannot be connected to either another data store or to an external entity.  
  • All the functionalities of the system must be captured by the DFD model. No function of the system specified in its SRS document should be overlooked.
  • Only those functions of the system specified in the SRS document should be represented, i.e. the designer should not assume functionality of the system not specified by the SRS document and then try to represent them in the DFD.
  • Improper or unsatisfactory data dictionary.
  • The data and function names must be intuitive. Some students and even practicing engineers use symbolic data names such a, b, c, etc. Such names hinder understanding the DFD model. 
The document Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Embedded Systems (Web).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
47 videos|69 docs|65 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Software Design: Embedded Systems - 2 - Embedded Systems (Web) - Computer Science Engineering (CSE)

1. What is an embedded system?
Ans. An embedded system is a computer system designed to perform specific tasks, typically with real-time computing constraints. It is a combination of hardware and software, where the software is embedded into the hardware to control and perform a dedicated function.
2. What are the key components of an embedded system?
Ans. The key components of an embedded system include the microcontroller or microprocessor, memory, input/output devices, sensors, actuators, and communication interfaces. The microcontroller or microprocessor acts as the brain of the system, while memory stores the program code and data. Input/output devices enable interaction with the external world, and sensors and actuators collect and respond to physical signals. Communication interfaces facilitate data exchange with other systems.
3. What are the challenges in designing embedded systems?
Ans. Designing embedded systems poses several challenges, including limited resources such as memory and processing power, real-time constraints, power consumption optimization, hardware-software co-design, and reliability. It is essential to balance the system's functionality with its resource limitations and ensure that it can perform its tasks within strict time constraints.
4. How are embedded systems different from general-purpose computers?
Ans. Embedded systems differ from general-purpose computers in terms of their purpose, design, and constraints. While general-purpose computers are designed for multiple tasks, embedded systems are dedicated to specific functions. Embedded systems are often resource-constrained and optimized for power consumption, size, and cost, whereas general-purpose computers have more abundant resources and flexibility.
5. What are some examples of embedded systems?
Ans. There are numerous examples of embedded systems, including automotive systems (such as engine control units and anti-lock braking systems), industrial automation systems, medical devices (such as pacemakers and insulin pumps), consumer electronics (such as smartphones and smart TVs), and home appliances (such as washing machines and microwave ovens). These systems rely on embedded software to perform their specific functions efficiently.
47 videos|69 docs|65 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Objective type Questions

,

Previous Year Questions with Solutions

,

pdf

,

MCQs

,

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

ppt

,

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

video lectures

,

Semester Notes

,

study material

,

Extra Questions

,

Sample Paper

,

Important questions

,

practice quizzes

,

Free

,

mock tests for examination

,

Software Design: Embedded Systems - 2 | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

past year papers

,

Viva Questions

,

Summary

,

shortcuts and tricks

,

Exam

;