0% found this document useful (0 votes)
13 views1 page

Half Adder Structural

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Half Adder Structural

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

INFOOP2R.WIX.

COM/OP2R

HALF SUBTRACTOR VHDL CODE USING STRUCTURAL MODELING

library IEEE; Library declaration

use IEEE.STD_LOGIC_1164.ALL; Std_logic_1164. package for std_logic (predefined data types).

--------------------------------------------

entity half_adder is Entity declaration….

Port ( a, b: in STD_LOGIC; a, b: - input port bits (bits to be


sum ,carry: out STD_LOGIC); added)
end half_adder; sum, carry: - output port bits
---------------------------------------------

architecture Behavioral of half_adder is


----------------------------------------------
component xor_1 is
Port ( o,p : in STD_LOGIC;
 Component (Ex-or, And, Not)
q : out STD_LOGIC);
declaration.
end component;  These components are describing the
component and_1 is structure view of half adder.
Port ( x,y : in STD_LOGIC;
z : out STD_LOGIC);
end component;
-----------------------------------------------
 Architecture statement’s part
begin (Architecture body).
X1: xor_1 port map (a, b, sum);  Components are port mapped to
x2: and_1 port map (a, b, carry); perform the circuit (adder) operation.
end Behavioral;
-----------------------------------------------

RTL VIEW:- OUT PUT WAVEFORMS:-

INFOOP2R.WIX.COM/OP2R

You might also like