美文网首页
嵌入式导论练习题2

嵌入式导论练习题2

作者: 泽泽馥泽泽 | 来源:发表于2017-11-04 00:23 被阅读0次

Introduction to Embedded Systems

Exercise 2 MOC-stateChartStatechart

  1. Advantages of StateCharts

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

状态图可以对层次结构和并发进行建模。可以警戒(有条件地启用)转换。此外,转换可以与操作相关联。 操作可以与操作相关联。 操作可以对变量执行计算,并生成新事件。状态图(Statechart Diagram)是描述一个实体基于事件反应的动态行为,显示了该实体如何根据当前所处的状态对不同的事件做出反应。

  1. Disadvantages of StateCharts

What are the disadvantages of the StateChart formalism?

虽然StateChart比普通的FSM更好,但是它们在大型系统中的规模越来越大,往往很难理解。 重复使用的潜力是有限的。 与转换相关的操作提供了强大的扩展,但另一方面,广泛使用的操作将部分系统状态信息从状态本身移动到变量。 这种隐藏状态使系统分析困难。

  1. Tree of states for StateChart

Given the StateChart in Figure 1. Draw the state space of the StateChart
as a tree, which shows the hierarchy of states anddenotes the state types
(basic state, sequential states, and parallel states).

ex1.jpg image.png
  1. 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 bythe StateChart from
Fig.1

image.png
  1. 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:

image.png
  1. 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.

image.png image.png
  1. 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.
image.png
  • The control of the vending machine has a bug that allows the user to cheat.
    Describe the trace of transitions that illustratethe bug.


    image.png
  • Draw the corresponding StateChart that fixes the bug.

Bug:


ex2.jpg

Correct:


image.png

Simulated:

设置一个人想要喝咖啡的状态:

输入事件:

coin_in=1;
cancel=0;
drink_ready=1
req_tea=0;
req_coffee=0;

image.png

仿真结果为:

输出事件

start_coffee=1;
start_tea=0;
coin_out=0;

验证模型是正确的,输出为

image.png

相关文章

  • 嵌入式导论练习题2

    Introduction to Embedded Systems Exercise 2 MOC-stateChar...

  • 嵌入式导论练习题1

    1.1 Model of Computation - Kahn Process Network(KPN) Mode...

  • 嵌入式导论练习题6

    嵌入式导论实验报告 Introduction to Embedded Systems Exercise 3 Res...

  • 嵌入式TM4C123GXL —— LED和Button

    嵌入式导论实验报告Guo-Lab2 TM4C123GXL Button and Led 实验题目 熟悉实验环境和实...

  • 嵌入式lab3

    嵌入式系统导论实验报告 1.实验题目 DOL的编程与实例分析 2.实验结果 (1)修改example2中的文件,使...

  • TM4C123GXL:GPIO、中断、定时器,LED,串口

    嵌入式导论综合实验设计——嵌入式期末报告 TM4C123GXL Final Project 实验题目 综合实验设计...

  • 嵌入式系统导论

    思维导图https://mubu.com/doc/1y91Dl_sPF 嵌入式系统概述 嵌入式系统(Embedde...

  • 2018-12-01

    练习题1 练习题2 练习题3

  • DOL实例分析&编程

    嵌入式导论实验报告 DOL实例分析&编程 Make工具简介 在Linux和Ubuntu环境中,make工具主要被用...

  • 嵌入式系统导论实验报告 一、实验目的 1、进一步掌握本学期以来所做实验用到的各种元器件的使用方法和编程;2、加深G...

网友评论

      本文标题:嵌入式导论练习题2

      本文链接:https://www.haomeiwen.com/subject/roaapxtx.html