4 Mart 2016 Cuma

VHDL FULL ADDER

VHDL FULL ADDER PROGRAMİNG SOURCE CODE 
----------------------------------------------------------------------------------
-- Company: Siirt Üniversty
-- Engineer: Ozay tunctan bil.Müh
-- Create Date:    14:19:47 03/04/2016 
-- Design Name: Full adder
-- Module Name:    AND_KAPISI - Behavioral 
-- Project Name: full adder
-- Target Devices: 
-- Tool versions: 
-- Description: 
-- Dependencies: 
-- Revision: 1.5
-- Revision 0.01 - File Created
-- Additional Comments: 
----------------------------------------------------------------------------------
-----And kapısı Tasarımı
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity AND_KAPISI is
port(ve_g1:in std_logic;
     ve_g2:in std_logic;
     ve_cikis:out std_logic);
end AND_KAPISI;
architecture veriAkisi of AND_KAPISI is
begin
process(ve_g1,ve_g2)
begin
ve_cikis<=ve_g1 and ve_g2;
end process;
end veriAkisi;
----------------------------------------------------------------------------------------
----xor kapısı tasırımı
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity XOR_KAPISI is
port(xor_g1:in std_logic;
     xor_g2:in std_logic;
     xor_cikis:out std_logic);
end XOR_KAPISI;
architecture veriAkisi of XOR_KAPISI is
begin
process(xor_g1,xor_g2)
begin 
xor_cikis<=xor_g1 xor xor_g2;

end process;
end veriAkisi;


---------------------------------------------------------------------------------------
----Veya kapısı tasırımı
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity VEYA_KAPISI is
port(veya_g1:in std_logic;
     veya_g2:in std_logic;
     veya_cikis:out std_logic);
end VEYA_KAPISI;
architecture veriAkisi of VEYA_KAPISI is
begin
process(veya_g1,veya_g2)
begin 
veya_cikis<=veya_g1 or veya_g2;

end process;
end veriAkisi;
----------------------------------------------------------------------------------------
---half adder yarı toplayıcı devresi tasarımı
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity YARI_TOPLAYICI is
port(yt_g1:in std_logic;
     yt_g2:in std_logic;
     yt_elde:out std_logic;
 yt_toplam:out std_logic);
end YARI_TOPLAYICI;
architecture yapisal of YARI_TOPLAYICI is
component AND_KAPISI is
port(ve_g1:in std_logic;
     ve_g2:in std_logic;
     ve_cikis:out std_logic);
end component;
component XOR_KAPISI is
port(xor_g1:in std_logic;
     xor_g2:in std_logic;
     xor_cikis:out std_logic);
end component;
begin 
block1:AND_KAPISI port map(ve_g1=>yt_g1,ve_g2=>yt_g2,ve_cikis=>yt_elde);
block2:XOR_KAPISI port map(xor_g1=>yt_g1,xor_g2=>yt_g2,xor_cikis=>yt_toplam);
end yapisal;
-----------------------------------------------------------------------------------------------------
-----Tam toplayıcı devresinin tasarımı
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity TAM_TOPLAYICI is
port(tt_g1:in std_logic;
     tt_g2:in std_logic;
 tt_Cin:in std_logic;
 tt_elde:out std_logic;
 tt_toplam:out std_logic
    );
end TAM_TOPLAYICI;
architecture yapisal of TAM_TOPLAYICI is
component YARI_TOPLAYICI is
port(yt_g1:in std_logic;
     yt_g2:in std_logic;
     yt_elde:out std_logic;
 yt_toplam:out std_logic);
end component;
component VEYA_KAPISI is
port(veya_g1:in std_logic;
     veya_g2:in std_logic;
     veya_cikis:out std_logic);
end component;
signal ve_signal:std_logic;
signal xor_signal:std_logic;
signal yt_signal:std_logic;
begin
Block1:YARI_TOPLAYICI port map(yt_g1=>tt_g1,yt_g2=>tt_g2,yt_elde=>ve_signal,yt_toplam=>xor_signal);
Block2:YARI_TOPLAYICI port map(yt_g1=>xor_signal,yt_g2=>tt_Cin,yt_elde=>yt_signal,yt_toplam=>tt_toplam);
Block3:VEYA_KAPISI port map(veya_g1=>ve_signal,veya_g2=>yt_signal,veya_cikis=>tt_elde);
end yapisal;