jojo12
Newbie
If anyone can help it would be greatly appreciated.
I can't figure out how to specify a in the code to not get the error.
I'm getting this error for all a's (a(3), a(2), a(1), a(0))
I can't figure out how to specify a in the code to not get the error.
I'm getting this error for all a's (a(3), a(2), a(1), a(0))
Error (10028): Can't resolve multiple constant drivers for net "a[3]" at counter.vhd(20)
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 library ieee; use ieee.std_logic_unsigned.all; use ieee.std_logic_1164.all; entity counter is port (x : in std_logic_vector (3 downto 0); clk : in std_ulogic; y : out std_logic_vector (3 downto 0)); end entity counter; architecture code_behavior of counter is signal a: std_logic_vector (3 downto 0); begin process (clk) begin if rising_edge (clk) then a<= x; end if; end process; process (x) begin if rising_edge (clk) then if x < "1001" then y<=(a+"0001"); a<= a + "0001"; elsif x > "1001" then y<=(a-"0001"); a <= a - "0001"; else y<= "1001"; end if; end if; end process; end architecture;
Last edited by a moderator: