I have to design a 1-bit binary adder/subtractor unit that can both add or subtract two input values A and B depending on a control input C (it is assumed that two's complement is used).
Also, the adder/subtractor has an additional input \$C_{in}\$ for a previous borrow or carry. When subtraction is to be performed and the borrow input is 1, an additional subtraction of 1 is to be done. There are two outputs, one for the borrow/carry and one for the sum.
How would the corresponding circuit look like?
I thought that (because in two's complement \$ A - B = A + (\bar{B} + 1)\$),
\$ A - B - C_{in} = A + \bar{B} + 1 - C_{in} = A + \bar{B} + \overline{C_{in}} \$
So is it correct that when doing subtraction, all I have to do is invert B and \$C_{in}\$ and feed these inverted values to the inputs of a normal full adder?
Also, how would I construct a 4-bit adder/subtractor from those single 1 bit adder-subtractor cells?