会VHDL语言的帮帮我吧!看看下面程序有问题没,帮我运行一下。谢谢啦……
LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYmooreISPORT(clk,data:INSTD_LOGIC;zo:OUTS...
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY moore IS
PORT( clk, data:IN STD_LOGIC;
zo :OUT STD_LOGIC);
END moore;
ARCHITECTURE a OF moore IS
TYPE STATE IS (S1,S2,S3,S4,S5,S6,S7,S8);
SIGNAL pstate :STATE;
BEGIN
PROCESS(clk)
BEGIN
IF (clk’EVENT AND clk=‘1’) THEN
CASE pstate is
WHEN S1=> IF data=‘1’ THEN pstate<=S2; ELSE pstate<=S1;
END IF;
WHEN S2=> IF data=‘1’ THEN pstate<=S3; ELSE pstate<=S1;
END IF;
WHEN S3=> IF data=‘1’ THEN pstate<=S4; ELSE pstate<=S1;
END IF;
WHEN S4=> IF data=‘0’ THEN pstate<=S5; ELSE pstate<=S4;
END IF;
WHEN S5=> IF data=‘0’ THEN pstate<=S6; ELSE pstate<=S2;
END IF;
WHEN S6=> IF data=‘1’ THEN pstate<=S7; ELSE pstate<=S1;
END IF;
WHEN S7=> IF data=‘0’ THEN pstate<=S8; ELSE pstate<=S3;
END IF;
WHEN S8=> IF data=‘1’ THEN pstate<=S2; ELSE pstate<=S1;
END IF;
END CASE;
END IF;
END PROCESS;
zo<=‘1’ WHEN pstate=s8 ELSE ‘0’;
END a; 展开
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY moore IS
PORT( clk, data:IN STD_LOGIC;
zo :OUT STD_LOGIC);
END moore;
ARCHITECTURE a OF moore IS
TYPE STATE IS (S1,S2,S3,S4,S5,S6,S7,S8);
SIGNAL pstate :STATE;
BEGIN
PROCESS(clk)
BEGIN
IF (clk’EVENT AND clk=‘1’) THEN
CASE pstate is
WHEN S1=> IF data=‘1’ THEN pstate<=S2; ELSE pstate<=S1;
END IF;
WHEN S2=> IF data=‘1’ THEN pstate<=S3; ELSE pstate<=S1;
END IF;
WHEN S3=> IF data=‘1’ THEN pstate<=S4; ELSE pstate<=S1;
END IF;
WHEN S4=> IF data=‘0’ THEN pstate<=S5; ELSE pstate<=S4;
END IF;
WHEN S5=> IF data=‘0’ THEN pstate<=S6; ELSE pstate<=S2;
END IF;
WHEN S6=> IF data=‘1’ THEN pstate<=S7; ELSE pstate<=S1;
END IF;
WHEN S7=> IF data=‘0’ THEN pstate<=S8; ELSE pstate<=S3;
END IF;
WHEN S8=> IF data=‘1’ THEN pstate<=S2; ELSE pstate<=S1;
END IF;
END CASE;
END IF;
END PROCESS;
zo<=‘1’ WHEN pstate=s8 ELSE ‘0’;
END a; 展开
4个回答
展开全部
没什么大问题,就是有的地方没有在英文状态下输入,下面的是已经改好的,基液并搏衡物且编译通过
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY moore IS
PORT (clk,data: IN STD_LOGIC;
zo :OUT STD_LOGIC);
END moore;
ARCHITECTURE a OF moore IS
TYPE STATE IS (S1,S2,S3,S4,S5,S6,S7,S8);
SIGNAL pstate :STATE;
BEGIN
PROCESS(clk)
BEGIN
IF (clk'EVENT AND clk='1') THEN
CASE pstate is
WHEN S1=> IF data='1' THEN pstate<=S2; ELSE pstate<=S1;
END IF;
WHEN S2=> IF data='1' THEN pstate<=S3; ELSE pstate<=S1;
END IF;
WHEN S3=> IF data='1' THEN pstate<=S4; ELSE pstate<=S1;
END IF;
WHEN S4=> IF data='0' THEN pstate<=S5; ELSE pstate<=S4;
END IF;
WHEN S5=> IF data='0' THEN pstate<=S6; ELSE pstate<=S2;
END IF;
WHEN S6=> IF data='1' THEN pstate<=S7; ELSE pstate<=S1;
END IF;
WHEN S7=> IF data='0' THEN pstate<=S8; ELSE pstate<=S3;
END IF;
WHEN S8=> IF data='1' THEN pstate<拦侍=S2; ELSE pstate<=S1;
END IF;
END CASE;
END IF;
END PROCESS;
zo<='1' WHEN pstate=s8 ELSE '0';
END a;
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY moore IS
PORT (clk,data: IN STD_LOGIC;
zo :OUT STD_LOGIC);
END moore;
ARCHITECTURE a OF moore IS
TYPE STATE IS (S1,S2,S3,S4,S5,S6,S7,S8);
SIGNAL pstate :STATE;
BEGIN
PROCESS(clk)
BEGIN
IF (clk'EVENT AND clk='1') THEN
CASE pstate is
WHEN S1=> IF data='1' THEN pstate<=S2; ELSE pstate<=S1;
END IF;
WHEN S2=> IF data='1' THEN pstate<=S3; ELSE pstate<=S1;
END IF;
WHEN S3=> IF data='1' THEN pstate<=S4; ELSE pstate<=S1;
END IF;
WHEN S4=> IF data='0' THEN pstate<=S5; ELSE pstate<=S4;
END IF;
WHEN S5=> IF data='0' THEN pstate<=S6; ELSE pstate<=S2;
END IF;
WHEN S6=> IF data='1' THEN pstate<=S7; ELSE pstate<=S1;
END IF;
WHEN S7=> IF data='0' THEN pstate<=S8; ELSE pstate<=S3;
END IF;
WHEN S8=> IF data='1' THEN pstate<拦侍=S2; ELSE pstate<=S1;
END IF;
END CASE;
END IF;
END PROCESS;
zo<='1' WHEN pstate=s8 ELSE '0';
END a;
11
2024-11-21 广告
2024-11-21 广告
VSIM软件模拟是上海允若信息科技有限公司提供的一项专业服务。我们利用VSIM软件,为客户提供高精度的模拟环境,帮助他们在虚拟空间中测试和验证各种复杂系统。无论是通信系统、网络系统还是其他工程系统,VSIM都能提供详尽的模拟结果,助力客户优...
点击进入详情页
本回答由11提供
展开全部
运行了,楼上说的对薯含,把分给上面吧,把单引号和开头一个括号换成英文的就行了,还有你的运行环境是什么,我用的是quartus 8.0,如果编译环境不一样可能结果会有猛手核不同枝掘
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
3个警告!无所谓啦,小场面!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
帮你运行了,没有错误也没有警告!!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询