Fadder
Fadder
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity fuladd is
Port(
a : in STD_LOGIC;
b : in STD_LOGIC;
cin : in STD_LOGIC;
end fuladd;
begin
process(a, b, cin)
begin
aa := "0" & a;
bb := "0" & b;
end process;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity ripple_carry_adder is
port(
s_3 : in std_logic;
end ripple_carry_adder;
( a : in STD_LOGIC;
b : in STD_LOGIC;
cin : in STD_LOGIC;
);
end component;
begin
x1 : fuladd port map (a=> s_1(0),b=> s_2(0), cin=> s_3, sum=>s_out(0), cout=> carry(0));
x2 : fuladd port map (a=> s_1(1),b=> s_2(1), cin=> carry(0), sum=>s_out(1), cout=> carry(1));
x3 : fuladd port map (a=> s_1(2),b=> s_2(2), cin=> carry(1), sum=>s_out(2), cout=> carry(2));
x4 : fuladd port map (a=> s_1(3),b=> s_2(3), cin=> carry(2), sum=>s_out(3), cout=> carry(3));
end struct;