Estoy tratando de hacer un contador arriba / abajo en un tablero Basys. Pero tengo algunos problemas que no puedo resolver.
Mi código:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity counter is
Port (
clock : in STD_LOGIC;
clock_osc : in STD_LOGIC;
reset : in STD_LOGIC;
count_start : in STD_LOGIC;
count_out : out STD_LOGIC_VECTOR (3 downto 0);
AN1 : out STD_LOGIC;
AN2 : out STD_LOGIC;
AN3 : out STD_LOGIC;
AN4 : out STD_LOGIC
);
end counter;
architecture Behavioral of counter is
signal count : std_logic_vector (3 downto 0);
signal count2 : std_logic_vector (3 downto 0);
begin
countupdown: process (clock, reset, count_start)
begin
if (reset = '0') then
count <= "0000";
count2 <= "0000";
elsif (clock='1' and clock'event) then
if (count_start = '0') then
count <= count + 1;
else
count2 <= count2 - 1;
end if;
end if;
end process;
count_out<= count when (clock_osc = '1') else count2;
AN1<='0' when (clock_osc='1') else '1';
AN2<='0' when (clock_osc='1') else '1';
AN3<='1' when (clock_osc='1') else '0';
AN4<='1' when (clock_osc='1') else '0' ;
end Behavioral;
Los errores:
ERROR:HDLParsers:808 - "C:/Users/sana4/Desktop/uni/Digital Design/Counter3/counter.vhd" Line 75. + can not have such operands in this context.
ERROR:HDLParsers:808 - "C:/Users/sana4/Desktop/uni/Digital Design/Counter3/counter.vhd" Line 79. - can not have such operands in this context.