数字逻辑自动售卖机功能方针没问题,时序仿真没输出

qq_41030699 2017-11-26 09:48:49
library ieee;
use ieee.std_logic_1164.all;
entity Sell is
port ( clk,rst:in std_logic;--clk
A,B: in std_logic;
Y,Z:out std_logic);
end Sell;

architecture struct of Sell is
type state is (S0,S1,S2,S3);
signal S:state;
begin
process (clk,rst)
begin
if rst='1' then
S<=S0;

elsif (clk'event and clk='1') then
case S is
when S0 =>
if (A='0' AND B='1') then
S<=S1;
Y<='0';Z<='0';
elsif (A='1' AND B='0') then
S<=S2;
Y<='0';Z<='0';
else
Y<='0';Z<='0';
end if;
when S1 =>
if (A='0' AND B='1') then
S<=S2;
Y<='0';Z<='0';
elsif (A='1' AND B='0') then
S<=S0;
Y<='1';Z<='0';
else
S<=S1;
end if;
when S2 =>
if (A='0' AND B='1') then
S<=S0;
Y<='1';Z<='0';
elsif (A='1' AND B='0') then
S<=S0;
Y<='1';Z<='1';
else
S<=S2;
end if;
when S3 =>
S <= S0;
when others =>
S<=S0;
end case;
end if;
end process;
end struct;
...全文
244 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

3,424

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧