0
1.0kviews
Write VHDL program for Subtractor?
1 Answer
written 6.3 years ago by |
VHDL Code for a Full Subtractor
Library ieee;
use ieee.std_logic_1164.all;
entity full_sub is
port(a,b,c:in bit; sub,borrow:out bit);
end full_sub;
architecture data of full_sub is
begin
sub<= a xor b xor c;
borrow <= ((b xor c) and (not a)) or (b and c);
end data;
Waveforms