In this adder-subtractor design with the "M" input as the flag for subtraction, 0 minus 0 seems to provide the incorrect Cout. Let's assume that we're only using one full adder here (ignore A1/B1, A2/B2, A3/B3) for simplicity, and M
=1
, A0
=0
, A1
=0
:
The full adder will get the inputs of:
0 (B0) XOR 1 (M)
= 1
0 (A0)
= 0
1 (M)
= 1
This results in 1
+1
=0
, with Cout
= 1
- but Cout
should equal 0 for a full adder:
I think inverting the final Cout
will provide the correct result, but everywhere I look online for this adder-subtractor circuit has no inverter for the final Cout
. Is this circuit supposed to have an inverter at the final Cout
to fix this problem?