1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL;
ENTITY fulladder IS PORT (a,b,ci:IN STD_LOGIC; s,co:OUT STD_LOGIC); END fulladder;
ARCHITECTURE Structural OF fulladder IS COMPONENT decoder3_8 PORT(i:in std_logic_vector(2 downto 0); y:out std_logic_vector(7 downto 0)); END COMPONENT;
COMPONENT nand_2 PORT (a,b,c,d:in std_logic; out_y:out std_logic); END COMPONENT; SIGNAL zl,xl,cl,vl,bl,nl,ml:STD_LOGIC;
BEGIN U1:decoder3_8 PORT MAP (i(0)=>a,i(1)=>b,i(2)=>ci, y(1)=>zl,y(2)=>xl,y(4)=>cl,y(7)=>vl,y(3)=>bl,y(5)=>nl,y(6)=>ml); U2:nand_2 PORT MAP(a=>zl,b=>xl,c=>cl,d=>vl, out_y=>s); U3:nand_2 PORT MAP(a=>bl,b=>nl,c=>ml,d=>vl, out_y=>co); END Structural;
|