VIVADO 2014.4 如何编写mealy状态机并测试
1. 题干描述:
Design a sequence detector implementing a Mealy state machine using
three always blocks. The Mealy state machine has one input (ain) and
one output (yout). The output yout is 1 if and only if the total
number of 1s received is divisible by 3 (hint: 0 is inclusive,
however, reset cycle(s) do not count as 0- see in simulation waveform
time=200). Develop a testbench and verify the model through a
behavioral simulation.
即需要实现mealy状态机,该状态机有一个输入(0/1)和一个输出(0/1)。只有累计输入1的个数为3的倍数才会输出1(0个1也输出1)。
2. 理想的仿真波形图:

3.绘制mealy状态机

4.新建项目
请务必保持硬件配置(芯片选项:xc7a35tcpg236-1)正确,其他的选项按新建项目的默认选项来即可
最后一步的图:

5.新建约束文件
新建文件的地方(项目窗口的左侧):

在弹出来的窗口里选择:

然后在弹出来的地方选择新建一个约束文件:

自己取名字就行,然后把代码拷贝进去:
## Switches
set_property PACKAGE_PIN V17 [get_ports {
ain}]
set_property IOSTANDARD LVCMOS33 [get_ports {
ain}]
set_property PACKAGE_PIN R2 [get_ports {
clk}]
set_property IOSTANDARD LVCMOS33 [get_ports {
clk}]
## LEDs
set_property PACKAGE_PIN U16 [get_ports

本文详细介绍了如何在VIVADO 2014.4中设计和测试一个Mealy状态机。通过三个always块实现,状态机有一个输入ain和一个输出yout,当输入1的总数能被3整除时,输出yout为1。文章提供了理想的仿真波形图、状态机绘制过程、项目创建步骤、约束文件和设计文件的编写,以及仿真测试的完整流程。
最低0.47元/天 解锁文章
491

被折叠的 条评论
为什么被折叠?



