Moore vs. Mealy Machine

slides from https://inst.eecs.berkeley.edu/~cs150/fa05/Lectures/07-SeqLogicIIIx2.pdf

[GPT 3.5]

A Mealy machine can have fewer states than a Moore machine because in a Mealy machine, the output depends on both the current state and the input, whereas in a Moore machine, the output depends only on the current state. This means that in a Mealy machine, states can be merged if they produce the same output for the same input, even if they transition to different states. In a Moore machine, states cannot be merged if they produce the same output, but transition to different states.

Here's an example to illustrate this:

Let's say we want to design a machine that detects a sequence of two consecutive 1's in a binary input. We can implement this using both a Mealy machine and a Moore machine.

**Mealy machine:**

In this Mealy machine, the state `q3` outputs a 1 when the input is 1, indicating that the sequence `11` has been detected. The output of `q3` depends on both the current state and the input. However, `q2` and `q3` produce the same output for input 0, so we can merge them into a single state.

**Moore machine:**

In this Moore machine, the state `q1/q0` outputs a 1 when the sequence `11` has been detected. The output of `q1/q0` depends only on the current state, not the input. However, we cannot merge `q0/q0` and `q0/q1` because they produce different outputs.

As we can see, the Mealy machine has fewer states than the Moore machine because we were able to merge `q2` and `q3` in the Mealy machine, but we couldn't do so in the Moore machine.

==> output is not dependent on input, but next state still is

with the merging rule stated in the beginning:

(starting from the Moore diagram, but change it to a Mealy first, then)

E is merged into B

D is merged into C

both outputs are dependent on states only

use registered Mealy to improve output safety

which makes it Moore Machine, without a decoder for output

see the slides for extended examples.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值