ex1

嵌入式ex1


姓名 学号 班级 电话 邮箱
欧阳毅 15352268 15M2 13247686905 [email protected]

1、What are the most important extensions of the StateChart model in comparison to an ordinary Finite state machine (FSM)?

状态图可以建模层次结构和并发性。有条件的保护转换,使转换和动作相关联。动作可以像生成新事件一样用变量计算。

2、Disadvantages of StateCharts

尽管状态图比普通的FSMs更好,但是它们在大系统中生成,而且往往难以理解,重新用的潜力是有限的。与转换相关的操作提供了一个强大的扩展,但是另一方面,广泛使用的操作将系统状态信息的一部分从状态转移到变量,这个隐藏的状态使系统分析变得更加困难。

3、Given the StateChart in Figure 1. Draw the state space of the StateChart as a tree, which shows the hierarchy

figure1.png

Figure 1: StateChartof states and denotes the state types (basic state, sequential states, and parallel states).

画出的状态图

IMG_20171103_115717.jpg

4. Formal computation of state space

How would you formally compute the set of states? Compute the set of states for the hierarchical automata which is defined by the StateChart from Fig.1
IMG_20171103_120341.jpg

5. Analysis

The automaton defined by the StateChart from Fig. 1 passes through a number of states, when external events are applied. Show the sequence of state that are passed through, starting from the initial state, for the following sequence of events:
a,b,e,b,d,b. Use a table notation.

IMG_20171103_121054.jpg

6. Conversion of StateChart to a finite state machine (FSM)

Draw a finite state machine which is equivalent to the StateChart from Fig. 1. Minimize the number of states.

IMG_20171103_121628.jpg

7. StateChart model of a vending machine

The StateChart model of a simplified vending machine is shown in Figure 2.

  • Describe the trace of transitions occurring when the user inserts a coin and orders a tea.
  • The control of the vending machine has a bug that allows the user to cheat. Describe the trace of transitions that illustrate the bug.
  • Draw the corresponding StateChart that fixes the bug.
  • 订红茶
IMG_20171103_131816.jpg
  • bug
IMG_20171103_132403.jpg
  • 修复之后:


    1.png
2.png

你可能感兴趣的:(ex1)