library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_signed.all;
entity VHDL is
generic
(
DATA_WIDTH : natural := 8
);
port
(
b1 : in std_logic;
b2 : in std_logic;
result : out std_logic_vector((DATA_WIDTH-1) downto 0)
);
end entity;
architecture rtl of VHDL is
signal result_l :std_logic_vector((DATA_WIDTH-1) downto 0);
begin
process(b1,b2)
begin
if (b1='1') then
result_l<=result_l+'1';
elsif (b2='1') then
result_l <=result_l-'1';
end if;
end process;
result<=result_l;
end rtl;