Subtractor is generally not needed
I'm not exactly sure what you're after, however I might point out
that computer systems are almost never designed with logic that
can both 'add' and 'subtract'. It simply isn't needed. We can
subtract simply by complementing the 'subtrahend' (number on the
bottom) and then adding. It gets us the same result and the
circuitry is simpler.
To illustrate, I give you some examples in decimal. Binary is
simpler, but decimal is more familiar to most of us.
(Unfortunately, we have ten fingers, so our numbering system
came about based on the number ten.)
The complement of an integer, for practical purposes, can be
based upon the size of the number, having a 'one' in the
position just larger than the largest value that we must deal
with and 'zeros' in the remaining positions. Thus if our
number range is "0 to 9", then the complement will be based on
the number "10"; if our range is 0 to 999 (or any other
value from 100 to 999) the complement will be based on the value
1000; etc. Partial examples are as follows:
10 1000 1,000,000
Number Complement Number Complement Number Complement
9 1 999 1 999,999 1
8 2 998 2 999,998 2
7 3 997 3 999,997 3
6 4 - - - -
5 5 - - - -
4 6 - - - -
3 7 3 997 3 999,997
2 8 2 998 2 999,998
1 9 1 999 1 999,998
0 10 0 1000 0 1,000,000
If we thus want to subtract two numbers, we simply take the
complement of the subtrahend, and add it. Thus for example:
7 7
-4 becomes +6
3
But what, you say, about the '1'? Remember, that the highest
value in this system is '9', so the one in the next highest
position "drops off the edge of the world. It doesn't exist
in our system. Probably a better example would be to subtract
4 from 7 in a system with 999,999 as its largest
necessary value. We would then have:
7 7
-4 then becomes +999,996
(1),000,003
Where that upper '1' is beyond the applicable range of the system,
so the value is simply "3". In a practical system, the range might
be much longer, so there might be a great number of "leading zeroes".
These are simply dropped, since they add no value. As another
example, in a six digit system (with 999,999 as maximum):
63,247 63,247
-34,567 we get +965,433
(1),028,680 which is: 28,680
The question then is, "How do we know the complement of the value
34,567 without having some huge conversion table. The answer
is to simply take the inversion of each digit, and then add one.
The inversions in the decimal system are:
9 - 0
8 - 1
7 - 2
6 - 3
5 - 4
4 - 5
3 - 6
2 - 7
1 - 8
0 - 9
Thus, the inversion of 34,567 is 65,432, and when we add '1'
we get 65,433, which when added gives us the correct
subtraction answer. In binary the rules are the same, except
that it is much easier. We simply invert (negate/not) all
the digits (by changing all "1's" to "0", and all "0's" to "1")
and then add "1". Thus, the complement of "101011" simply
becomes "010100 + 1 = 010101". We simply then "add" the two
values and the upper "1" simply carries right out of the
system. Some people talk about an "end around carry". You
may do so, but remember that that is simply a crutch".
It's a convenient way to explain what to do with the "1's"
but it is not really explanatory of what is happening. I
hope this gives some insight.