I trying to make a simple VHDL program which consist of incrementing a std_logic_vector by one every time button A is pressed. When button B is pressed the value should be reset.
My idea was to do it like this
entity simple is
Port ( A : in std_logic;
B : in std_logic;
CLK : in std_logic;
debug : out std_logic_vector (7 downto 0));
end simple;
architecture Behavioral of simple is
signal state: std_logic_vector(7 downto 0) := "00000000";
begin
increment: process(state, A, B)
begin
if (B'event and B = '1') then
state <= "00000000";
end if;
if (A'event andA = '1') then
state <= std_logic_vector(unsigned(state)+1);
end if;
end process;
led_debug: process(CLK)
begin
debug <= state;
end process;
end Behavioral;
The problem is though i am getting a error - Bad synchronous description, which i cannot understand.