You are on page 1of 1

library IEEE;

use IEEE. STD_LOGIC_1164.ALL;


use IEEE. STD_LOGIC_UNSIGNED.ALL;
entity calculadora is
port(
num1 :in STD_LOGIC_VECTOR(3 downto 0);
num1 :in STD_LOGIC_VECTOR(3 downto 0);
masmenos:out STD_LOGIC;
resultado:out STD_LOGIC_VECTOR(3 downto 0);
End calculadora;
architecture Behavioral of calculadora is
begin
resultado <= (num1 - num2) when masmenos='1' else (num1 + num2);
End Behavioral;

You might also like