Experiment6 VHDL
Experiment6 VHDL
Experiment6 VHDL
15
entityadd_fun_overload is
Port ( a : in bit_VECTOR (7 downto 0);
b : in bit_VECTOR (7 downto 0);
z : out bit_VECTOR (7 downto 0);
a1: in integer;
z1:out integer);
endadd_fun_overload;
architecture Behavioral of add_fun_overload is
begin
z<= addition(a,b);
z1<=addition(a,a1);
end Behavioral;
Fun_Overload
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.ALL;
useIEEE.STD_LOGIC_unsigned.ALL;
usework.bit_pack.all; --contains vec2int convertion
packageFun_Overload is
function addition(add1, add2:bit_vector) return bit_vector;
function addition(add1:bit_vector;add2:integer) return integer;
endFun_Overload;
Conclusion: The VHDL program for Subprogram overloading was studied and successfully implemented.