米利 v/s。摩尔

发布于 2024-09-28 12:54:58 字数 38 浏览 2 评论 0原文

Mealy 和 Mealy 之间有什么区别?摩尔型有限状态机?

What is the difference between Mealy & Moore type of finite state machines?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

千年*琉璃梦 2024-10-05 12:54:58

在摩尔机器中,产生的输出仅与机器的当前状态相关联。相反,在 Mealy 机器中,它与状态和特定输入相关联。

从实际的角度来看,输出被放置在摩尔机的状态上(因此每个状态都有其输出),而在后者上,您在转换上有输出(因此输出由当前状态和传出转换决定) )

In a Moore machine the output produced is associated to the current state of the machine and on it only. In a Mealy machine, instead, it is associated to both a state and a specific input.

From a practical point of view you have that output is placed on states in a Moore machine (so every state has its ouput), while on the latter you have outputs on transitions (so an ouput is decided from the current state AND the outgoing transition)

苍风燃霜 2024-10-05 12:54:58

摩尔机器输出仅是机器状态的函数,
机器的输出是机器状态及其输入的函数。

Moore machine output is a function only of the state of the machine,
Mealy machine output is a function of the state of the machine and its inputs.

萌逼全场 2024-10-05 12:54:58

举例/轶事解释。

也许用一个例子和一个轶事可以最好地说明这一点:我讨厌机场,也讨厌去机场,但我喜欢在飞机上:

  1. 状态:在出租车

    事件:支付票价,然后转换到下一个状态:)

  2. 状态:在休息室

    事件:等待2小时,然后转换到下一个状态:)

  3. 状态:在飞机上

但结果是什么?

  • 在 Mealy 机器中,前面的状态会产生影响 - 如何到达该状态非常重要。

  • 在摩尔机器中,如何达到特定状态并没有什么区别。

让我们在上面添加一个结果来创建状态机的摩尔表示:

状态机的摩尔表示示例:

  1. 状态:在出租车中

    活动:支付票价,然后转至下一个
    状态)。 (结果:不高兴)。

  2. 状态:在休息室

    事件:等待2小时,然后过渡到下一个状态)(结果:不高兴)

  3. 状态:在飞机上(结果:高兴)。

对于摩尔表示,结果直接与状态相关。对于 Mealy 表示 - 特定的结果/输出取决于你来自哪里。例如,如果我可以不用打车和在休息室等待就能到达飞机,那我会很高兴。输入会产生影响。你来自哪里很重要。 Mealy 表示状态机允许将其显示在图中。换句话说,在转换期间,输出/结果显示在状态之外。

Explanation by Example / Anecdote.

This is perhaps best illustrated with an example and an anecdote: I hate airports, and getting to them, but I love being on the plane:

  1. State: In Taxi

    (Event: pay the fare, and then transition to the next state:)

  2. State: In Lounge

    (Event: wait 2 hours, and transition to the next state: )

  3. State: In Plane

But what is the outcome?

  • In a Mealy machine, the preceding state makes a difference - how you get there is very important.

  • In a Moore machine, how you get to a particular state makes no difference.

Let's add an outcome to the above to create a Moore representation of a state machine:

Example of a Moore Representation of a State Machine:

  1. State: In Taxi

    (Event: pay fare and then transition to the next
    state). (Outcome: unhappy).

  2. State: In Lounge

    (Event: wait 2 hours, and then transition to the next state) (outcome: unhappy)

  3. State: In Plane (outcome: happy).

With a Moore representation the outcome is attached directly to the state. With a Mealy representation - the particular outcome/output depends on where you have come from. For example, if I can get to the plane without having to catch a taxi and wait in the lounge, then I would be happy. Inputs make a difference. The where you come from is important. A Mealy representation state machine allows for this to be shown in the diagram. In other words, the output/outcome is shown OUTSIDE the state, during the transition.

失退 2024-10-05 12:54:58

摩尔机是离散动力系统,可以使用 TLA+ 语法表示,如下所示

/\ x[k + 1] = f[x[k], u[k]]
/\ y[k] = g[x[k]]

: code>x 状态,u 输入,y 输出,f 描述转换关系(离散动态),< code>g 输出映射(此处为状态标签),k 表示时间(序列中的索引)。

Mealy 机的形式稍微更通用:

/\ x[k + 1] = f[x[k], u[k]]
/\ y[k] = g[x[k], u[k]]

请注意,现在 g 不再是状态标签,而是边缘标签。

它们等价,特别是 Moore 机器是严格因果关系的,而 Mealy 机器则不是。

有关更多详细信息,请参阅 Lee 和 Seshia,嵌入式系统简介,LeeSeshia.org,第 58 页。

Moore machines are discrete dynamical systems which can be expressed using TLA+ syntax as follows:

/\ x[k + 1] = f[x[k], u[k]]
/\ y[k] = g[x[k]]

where x the state, u the input, y the output, f describes the transition relation (discrete dynamics) and g the output map (here a state labeling) and k denotes time (index in the sequence).

A Mealy machine is of a slightly more general form:

/\ x[k + 1] = f[x[k], u[k]]
/\ y[k] = g[x[k], u[k]]

Note that now g is not a state labeling any more, it is an edge labeling.

They are not equivalent, in particular Moore machines are strictly causal, whereas Mealy machines are not.

For more details, refer to Lee and Seshia, Introduction to Embedded Systems, LeeSeshia.org, page 58.

烟花肆意 2024-10-05 12:54:58

Moore 仅在有效时钟脉冲后发生变化,Melay 在每个时钟沿后发生变化(“如果外部输入发生变化”)

Moore changes only after active clock pulse and Melay changes after every clock edges ("if external input changes ")

国产ˉ祖宗 2024-10-05 12:54:58
  • Mealy机器输出取决于当前状态当前输入 摩尔输出仅取决于当前状态

  • 一般Mealy机比Moore发热状态

  • Mealy输出在时钟边沿发生变化,但Moore输出在逻辑完成后立即发生变化。

    < /里>

  • Mealy 对输入的反应更快需要摩尔登录来解码输出,因为它有更多的电路延迟

  • Mealy machine output depend on both upon current state and current input whereas Moore output depend only the current state.

  • Generally Mealy machine has fever state than Moore machine.

  • Mealy Output changes at the clock edged but Moore output change as soon as logic is done.

  • Mealy react faster to input whereas Moore login is needed to decode the output since it has more circuits delays.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文