专业编程基础技术教程

网站首页 > 基础教程 正文

状态机的使用 状态机原理图

ccvgpt 2024-10-31 12:43:49 基础教程 13 ℃

本文介绍状态机和使用verilog实现的三种方式,若有错误之处,欢迎指出,感谢。


状态机的使用 状态机原理图

主要内容

状态机简介

Introduction to State Machines

三种方式和编码

Three ways and coding

状态机的置位和复位

Set and reset the state machine

状态机简介

状态机分为moore和mealy型,二者不同在于输出仅由前一个状态影响还是由前一个状态和输入信号影响,画出状态转移图然后再写出状态机。

The state machine is divided into moore and mealy types. The difference between the two is that the output is only affected by the previous state or by the previous state and the input signal. Draw the state transition diagram and then write the state machine.

三种方式和编码

编码常用二进制码,格雷码(相邻两个状态的编码只有一位不同),独热码(仅仅检测单独的一位就可以确定当前的状态):

Commonly used binary code for encoding, Gray code (only one bit is different in the encoding of two adjacent states), one-hot code (only one single bit can be detected to determine the current state):


方式分为一,二,三段式:

一段式:仅用一个always,将状态寄存器,组合逻辑,以及输出得到。

The method is divided into one, two and three sections:

One-segment: use only one always, get the status register, combinational logic, and output.


二段式:一个always用作状态寄存器,另一个得到每个状态的组合逻辑和输出。

Two-stage: one is always used as a state register, and the other gets the combinatorial logic and output of each state.


三段式:则用三个always将三个功能的分开。

Three-stage: use three always to separate the three functions.


状态机的置位和复位

同步:与时钟有关,当置位或复位信号到来时需要等待时钟信号到来才可以进行操作。

Synchronization: It is related to the clock. When the set or reset signal arrives, it needs to wait for the arrival of the clock signal before the operation can be performed.


异步:与时钟无关,当置位或复位信号到来理解进行对应操作。

Asynchronous: independent of the clock, when the set or reset signal arrives, the corresponding operation is performed.

参考资料:

《Verilog数字系统设计教程》作者:夏宇闻

百度

翻译:谷歌翻译

最近发表
标签列表