- •1 Introduction (Введение)
- •2 Generalized block diagram of a finite state machine (Обобщенная структурная схема конечного автомата).
- •Push – вталкивать данные в стек;
- •Graphs (Графы)
- •Figure 3: Directed labeled graph for the edge detector Ориентированный помеченный граф для краевого детектора)
- •4 Finite State Machines (Конечные Автоматы)
- •5 Unified Modeling Language (Унифицированный язык моделирования)
- •Uml state machines (конечные автоматы унифицированного языка моделирования).
- •Fsm logic (логическая схема работы конечного автомата).
- •State diagrams versus flowcharts (диаграммы состояний в сравнении с блок-схемами программ)
- •Uml state diagram (диаграмма состояний уям)
- •Defining a State diagram (построение диаграммы состояний)
- •Elements of a State diagram (Элементы диаграммы состояний)
- •Asm Chart (диаграмма алгоритмического конечного автомата)
- •Detailed asm Chart (подробная диаграмма asm).
- •Register transfer level (Условное изображение на уровне rtl).
- •Rtl in the circuit design cycle (описание на уровне rtl для разработки имс).
- •Automata-based programming (программирование с помощью модели конечных автоматов).
- •Example (пример)
- •Traditional (imperative) program (обычная императивная программа).
- •Расшифровка операторов программы на языке с:
- •Automata-based style program (программа на основе модели конечного автомата)
- •A separate function for the automaton step (отдельная функция для этапа конечного автомата)
- •Explicit state transition table (таблица переходов состояний в явном виде)
- •Using object-oriented capabilities (использование объектно-ориентированных возможностей)
- •Other extensions
- •Moore machine
- •Formal definition
- •Mealy machine
- •Formal definition
- •Mathematical model
- •Advantages and disadvantages (преимущества и недостатки).
- •Formal definition (формальное определение).
- •Example (пример)
- •Example (пример)
- •Transformations from/to state diagram (переход от/к диаграмме состояний).
- •Directed graph of a finite state machine (направленный граф конечного автомата).
- •Harel statechart (диаграммы Harel).
- •С. State transition table (таблица смены состояний).
- •Δ and λ aren’t shown in Fig.1. Δ и λ не показаны на схеме для визуального упрощения.
- •The methods to define automata (Способы задания автоматов)
- •Transition and output tables (Таблицы переходов и выходов)
- •Transition and output tables for Mealy automaton (тпв автомата Мили)
- •Transition and output tables for Moore automaton (тпв автомата Мура)
State diagrams versus flowcharts (диаграммы состояний в сравнении с блок-схемами программ)
|
|
Условные обозначения:
Action – действия;
Do X, W, Y,Z – выполнять X, W, Y,Z.
Newcomers to the state machine formalism often confuse state diagrams with flowcharts. For a long time, the UML specification wasn’t helping in this respect because it used to lump activity graphs in the state machine package (the new UML 2 has finally separated activity diagrams from state machines). Activity diagrams are essentially elaborate flowcharts.
Тех, кто впервые сталкивается с формализмом теории конечных автоматов, приводит в замешательство сопоставление диаграммы состояний с блок-схемами программ. В течение долгого времени спецификации УЯМ (UML) не оказывали нужной помощи в данном вопросе, поскольку они использовались для рассмотрения в целом (не вдаваясь в подробности) графов операций в пакете прикладных программ, относящихся к конечным автоматам (новый пакет UML 2 окончательно отделил диаграммы операций от конечных автоматов. С помощью диаграммы операций детально разрабатываются блок-схемы программ.
The figure below shows a comparison of a state diagram with a flowchart. A state machine (panel (a)) performs actions in response to explicit events. In contrast, the flowchart (panel (b)) does not need explicit events but rather transitions from node to node in its graph automatically upon completion of activities.
Graphically, compared to state diagrams, flowcharts reverse the sense of vertices and arcs. In a state diagram, the processing is associated with the arcs (transitions), whereas in a flowchart, it is associated with the vertices. A state machine is idle when it sits in a state waiting for an event to occur. A flowchart is busy executing activities when it sits in a node. The figure above attempts to show that reversal of roles by aligning the arcs of the state diagrams with the processing stages of the flowchart.
You can compare a flowchart to an assembly line in manufacturing because the flowchart describes the progression of some task from beginning to end (e.g., transforming source code input into object code output by a compiler). A state machine generally has no notion of such a progression. The door state machine shown at the top of this article, for example, is not in a more advanced stage when it is in the "closed" state, compared to being in the "opened" state; it simply reacts differently to the open/close events. A state in a state machine is an efficient way of specifying a particular behavior, rather than a stage of processing.
The distinction between state machines and flowcharts is especially important because these two concepts represent two diametrically opposed programming paradigms: event-driven programming (state diagrams) and structured programming (flowcharts). You cannot devise effective UML state machines without constantly thinking about the available events. In contrast, events are only a secondary concern (if at all) for flowcharts.
Различие между конечными автоматами и блок-схемами программ является очень важной вследствие наличия двух концепций, представляющих диаметрально противоположные принципы: программирование на основе событий (диаграммы состояния) и структурное программирование (блок-схемы программ). Вы не в состоянии разработать эффективные конечные автоматы УЯМ без обдумывания его связей с наличными событиями. И, наоборот, события могут явиться лишь второстепенной заботой для блок-схем программ.