|
我将process(a) 改成process(a,b) 在波形图里设置了b恒为0,为什么波形图会发生如此大的变化。b不变不是没影响吗?求解答啊 这个困扰了我2天的问题 以下为源程序,没改之前波形相当正常
Library IEEE;
Use IEEE.STD_LOGIC_1164.ALL;
entity shouhj is
port
(
-- Input ports
a,b : in std_logic;
-- Output ports
x,y,z : out std_logic
);
end shouhj;
architecture arch of shouhj is
TYPE all_state IS(s0,s1,s2,s3,s4);
SIGNAL state:all_state;
-- Declarations (optional)
begin
p1 ROCESS(a)
BEGIN
IF ( a='1' ) THEN
CASE state IS
WHEN s0=> state<=s1;
WHEN s1=> state<=s2;
WHEN s2=> state<=s3;
WHEN s3=> state<=s4;
WHEN s4=> state<=s0;
WHEN OTHERS=> NULL;
end case;
end if;
end process p1;
p2 ROCESS(state)
begin
CASE state IS
WHEN s0=> x<='0';y<='0';z<='0';
WHEN s1=> x<='1';y<='1';z<='0';
WHEN s2=> x<='1';y<='0';z<='0';
WHEN s3=> x<='1';y<='1';z<='0';
WHEN s4=> x<='1';y<='1';z<='1';
WHEN OTHERS=> NULL;
end case;
end process p2;
end arch; |
|