0
\$\begingroup\$

I've been trying to convert a full adder to a full subtractor using an inverter. I tried using not gates at the B input ( in A B Cin ) and also using it in the outputs but the final answers are not matching.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I suggest that you write out the truth tables for the full adder and full subtractor, compare the minterms that produce a `1' output, and look for input variables that are complemented between the two sets. \$\endgroup\$ Commented Feb 15, 2019 at 12:40

1 Answer 1

3
\$\begingroup\$

Inverting all bits gives you the ones complement and I assume you want to work in twos-complement format.

To make a number negative in twos-complement format you can do a ones-complement (invert all bits) followed by addition of 1.

Thus you can convert an adder to a subtractor using the two's complement but that requires another adder :-).

However there is a trick you can use sometimes: if your adder has an unused carry-in port you can use that to perform the extra "add-one".

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.