嵌入式ex1
姓名 | 學(xué)號(hào) | 班級(jí) | 電話 | 郵箱 |
---|---|---|---|---|
歐陽毅 | 15352268 | 15M2 | 13247686905 | 438020310@qq.com |
1啃炸、What are the most important extensions of the StateChart model in comparison to an ordinary Finite state machine (FSM)?
狀態(tài)圖可以建模層次結(jié)構(gòu)和并發(fā)性毡鉴。有條件的保護(hù)轉(zhuǎn)換情连,使轉(zhuǎn)換和動(dòng)作相關(guān)聯(lián)规丽。動(dòng)作可以像生成新事件一樣用變量計(jì)算。
2栅屏、Disadvantages of StateCharts
盡管狀態(tài)圖比普通的FSMs更好戈次,但是它們?cè)诖笙到y(tǒng)中生成,而且往往難以理解隘世,重新用的潛力是有限的可柿。與轉(zhuǎn)換相關(guān)的操作提供了一個(gè)強(qiáng)大的擴(kuò)展鸠踪,但是另一方面,廣泛使用的操作將系統(tǒng)狀態(tài)信息的一部分從狀態(tài)轉(zhuǎn)移到變量复斥,這個(gè)隱藏的狀態(tài)使系統(tǒng)分析變得更加困難营密。
3、Given the StateChart in Figure 1. Draw the state space of the StateChart as a tree, which shows the hierarchy
Figure 1: StateChartof states and denotes the state types (basic state, sequential states, and parallel states).
畫出的狀態(tài)圖
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.15. 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.
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.
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.
- 訂紅茶
- bug
-
修復(fù)之后:
1.png