Altera_Forum
Honored Contributor
9 years agoError (10822)
Hello, please help me with this problem.
Code: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity encoder is port( clk:in std_logic; A:in std_logic; B:in std_logic; number:buffer unsigned(7 downto 0)); end encoder; architecture main of encoder is --signal number: unsigned (7 downto 0):=(others=>'0'); begin --led<=number; process(A,B) begin if falling_edge(A) then if B='0' then number<=number + 1; end if; if B='1' then number<=number - 1 ; end if; end if; if rising_edge(A) then if B='0' then number<=number - 1; end if; if B='1' then number<=number + 1 ; end if; end if; end process; end main; thanks