0% found this document useful (0 votes)
131 views1 page

State Diagram-Example Gallery

The document provides details about a simple digital watch and instructions for creating a state diagram to model its operation. The watch has two modes - display time and set time. The set time mode further divides into set hours and set minutes. Buttons A and B are used to switch between modes and increment values. A state diagram would represent the watch's states (display, set hours, set minutes) and transitions between them triggered by button presses.
Copyright
© Attribution Non-Commercial (BY-NC)
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% found this document useful (0 votes)
131 views1 page

State Diagram-Example Gallery

The document provides details about a simple digital watch and instructions for creating a state diagram to model its operation. The watch has two modes - display time and set time. The set time mode further divides into set hours and set minutes. Buttons A and B are used to switch between modes and increment values. A state diagram would represent the watch's states (display, set hours, set minutes) and transitions between them triggered by button presses.
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 1

State Diagram - Example Gallery

Example I Simple Digital Watch


A simple digital watch has a display and two buttons to set it, the A button and the B button. The watch has two modes of operation, display time and set time. In the display time mode, hours and minutes are displayed, separated by a flashing colon. The set time mode has two modes, set hours and set minutes. The A button is used to select modes. Each time A is pressed, the mode advances in sequence: display, set hours, set minutes, display etc. Within the sub modes, the B button is used to advance the hours or minutes once each time it is pressed. Buttons must be released before they can generate another event. Prepare a state diagram of the watch.

Recap:
A state diagram is a graph in which nodes correspond to states and directed arcs correspond to transitions labeled with event names. A state diagram combines states and events in the form of a network to model all possible object states during its life cycle, helping to visualize how an object responds to different stimuli. A state can be defined as the duration of time during which an object is doing an activity.

Notes: An event occurs at a point in time and transmits information from one object to another. An action occurs in response to an event and cannot be interrupted.

An activity is an operation with certain duration that can be interrupted by another event. For example, a bulb in the On state is doing a continuous activity of illumination and this operation can be interrupted by another event like switch off.

A guard is a logical condition placed before a transition that returns either a true or a false. A guarded transition occurs only if the return value is true.

The State Diagram for Simple Digital Watch

Page 1 of 1

You might also like