library ieee; use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use work.GatePackage.all;

entity Adder_4bit is
 port(A, B : in std_logic_vector(4 downto 0);
    S  : out std_logic_vector(4 downto 0));
end Adder_4bit;

architecture bd of Adder_4bit is
 procedure pr_add(x,y : std_logic_vector;
           z: out std_logic_vector) is
 begin
  z := x + y;
 end pr_add;
begin
 process(A, B)
  variable sum : std_logic_vector(4 downto 0);
 begin
  pr_add(A, B, sum);   -- 이부분에서 왜 (A,B,S)로 안쓰고 (A,B,sum sum을 따로 왜만들었을까요?? 바로  (A,B,S)로 하면 안되나요?
  S <= sum;
 end process;
end bd;