Wednesday 18 December 2013

FULL ADDER / FULL SUBTRACTOR USING MODE CONTROL

library ieee;
use ieee.std_logic_1164.all;
Entity FA_FS is
port( M , A , B ,C : in std_logic;
            SUM / DIFF ,CARRY / BORW :out std_logic );
end FA_FS;
Architecture Behavioral of  FA_FS is
begin
process( M , A , B ,C )
begin
if M='0' then
if A='0' then SUM / DIFF <=B xor C ; CARRY / BORW<=B and C;
else SUM / DIFF <=B xnor C ; CARRY / BORW<=B nand C;
end if;
else
if A='0' then SUM / DIFF <=B xor C ; CARRY / BORW<=B nand C;
else SUM / DIFF <=B xnor C ; CARRY / BORW<=B and C;
end if;
end if;
end process;

end Behavioral;

No comments:

Post a Comment