Thursday, 31 May 2018

Full subtractor using VHDL programming language |



PROGRAM:

library IEEE;
use IEEE.STD_LOGIC_1164.all;

entity full_subtractor is
     port(
         a : in STD_LOGIC;
         b : in STD_LOGIC;
         c : in STD_LOGIC;
         difference : out STD_LOGIC;
         borrow : out STD_LOGIC
         );
end full_subtractor;

architecture full_subtractor_arc of full_subtractor is
begin

    difference <= a xor b xor c;
    borrow <= ((not a) and b) or
               (b and c) or
               (c and (not a));

end full_subtractor_arc;
 

No comments:

Post a Comment