--------------------------------------------------------- -- sumador de ancho de palabra variable -- --------------------------------------------------------- LIBRARY ieee ; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; ENTITY sumador IS GENERIC( WIDTH: integer ); PORT( A : IN STD_LOGIC_VECTOR(WIDTH-1 downto 0); B : IN STD_LOGIC_VECTOR(WIDTH-1 downto 0); S : OUT STD_LOGIC_VECTOR(WIDTH-1 downto 0) ); END sumador; ARCHITECTURE struct OF sumador IS BEGIN S <= A + B; END struct;