Altera_Forum
Honored Contributor
9 years agoSynchronization on falling and rising edges
Hi, I need help .
I need to synchronize to the falling and rising edge encoder signal "A" . Both these edges need to work with the signal "count". I have this error : Error (10028): Can't resolve multiple constant drivers for net "number[0]" at encoder.vhd(62) My 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(11 downto 0):=(others=>'0')); end encoder; architecture main of encoder is signal count: unsigned(11 downto 0):=(others=>'0'); begin ld:process(A) begin 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; ld1:process(A) begin if falling_edge(A) then if B='1' then number<=number + 1; end if; if B='0' then number<=number - 1 ; end if; end if; end process; end main; this is signal of encoder http://3.bp.blogspot.com/_qwqti0pxucw/tjbvdoimaxi/aaaaaaaaauk/m6on7fybr0o/s1600/encoding.png