You are on page 1of 1

SUMADOR CON SIGNO:

--UN SUMADOR CON SIGNO GENERICO DE N-BITS


library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity adder is
generic(N: natural:=8);
port(
x0 : in std_logic_vector(N-1 downto 0);
x1 : in std_logic_vector(N-1 downto 0);
y : out std_logic_vector(N-1 downto 0);
);
end adder;
architecture arq_sum of adder is
begin
y<= std_logic_vector(unsigned(x0)+unsigned(x1));
end arq_sum;

You might also like