对比 Moore 型与此前接触的 Mealy 型状态机差异
Error
[next-mdx-remote] error compiling MDX:
Expected a closing tag for `<br>` (5:33-5:37) before the end of `tableData`
3 | | **类型** | 输出驱动条件 | 典型代码实现(Verilog) | 直观示例(状态机波形) |
4 | | ----------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
> 5 | | **Moore 型** | 输出仅由**当前状态**决定 <br>(与输入无直接关联) | `always @(*) begin<br> case(state)<br> S0: out=1'b0;<br> S1: out=1'b1;<br> endcase<br>end` | 状态进入 `S1` 后,无论输入如何,输出固定为 `1` |
| ^
6 | | **Mealy 型** | 输出由**当前状态 + 当前输入**共同决定 | `always @(*) begin<br> case(state)<br> S0: out = in ? 1'b1 : 1'b0;<br> S1: out = in ? 1'b0 : 1'b1;<br> endcase<br>end` | 状态 `S0` 时,输入 `in=1` 则输出 `1`;`in=0` 则输出 `0` |
7 |
More information: https://mdxjs.com/docs/troubleshooting-mdx