vhdl code for full adder
Dear Sumant, there are countless types of adders, what kind do you want. pls specify. Nevertheless, I paste a fulladder code here
Kr,
avi
http://www.vlsiip.com
Library ieee;
Use ieee.std_logic_1164.all;
ENTITY fulladder IS
PORT( A,B,Cin : IN std_logic;
sum,Cout: OUT std_logic);
END ENTITY;
ARCHITECTURE functional OF fulladder IS
BEGIN
PROCESS(A,B,Cin)
BEGIN
If (Cin = '0' and A = '0' and B = '0' ) then
sum<= '0'; Cout <= '0';
elsif(Cin = '0' and A = '0' and B = '1') then
sum <= '1' ; Cout <= '0';
elsif(Cin = '0' and A = '1' and B = '0' ) then
sum <= '1' ; Cout <= '0';
elsif(Cin = '0' and A = '1' and B = '1' ) then
sum<= '0'; Cout <= '1';
elsif(Cin = '1' and A = '0' and B = '0' ) then
sum <= '1' ; Cout <= '0';
elsif(Cin = '1' and A = '0' and B = '1' ) then
sum<= '0'; Cout <= '1';
elsif(Cin = '1' and A = '1' and B = '0' ) then
sum<= '0'; Cout <= '1';
elsif(Cin = '1' and A = '1' and B = '1' ) then
sum <= '1' ; Cout <= '1';
else
sum <= 'X' ; Cout <= 'X';
end if;
END PROCESS;
END functional;