刚刚开始接触VHDL,现在也设计一个可逆的计数器,输入是三个按键,一个复位清零,一个增加,一个减少,输出为4位的二进制数 这时我编的代码:
Library IEEE; Use IEEE.std_logic_1164.All; Use IEEE.std_logic_unsigned.All;
Entity test is port(up,down: in std_logic; reset: in std_logic; Q: buffer std_logic_vector(3 downto 0)); end Entity test;
Architecture art of test is begin process(up,reset)is begin if reset='0' then Q<="0000"; elsif(up'event and up='1') then if Q=9 then Q<="0000"; else Q<=Q+1; end if; end if; end process; process(down,reset)is begin if reset='0' then Q<="0000"; elsif(down'event and down='1') then if Q=0 then Q<="1001"; else Q<=Q-1; end if; end if; end process; end Architecture art;
编译的时候提示错误如图 请教高手如何解决?不胜感激! VHDL语言感觉好别扭啊! |