# signed binary numbers subtraction using 1's complement

#### hunter6

Joined Feb 22, 2018
35

My approach to the question is attached. Is it correct ?

(Moderator's note: If at all possible please use the lowest resolution that provides a useful image. Image reduced in size and contrast enhanced my moderator.)

Last edited by a moderator:

#### MrChips

Joined Oct 2, 2009
25,919
First step is to extend B to match the resolution of A
B = 0101111.1
becomes
B = 0101111.10

#### WBahn

Joined Mar 31, 2012
26,398
View attachment 160395
My approach to the question is attached. Is it correct ?
As is often the case, you can check if the result is correct from the result itself.

Expressed in good old base-10, what is A and what is B? What is C = A - B? Now how is C expressed in 1's complement?

Strictly speaking, your starting values for A and B are ambiguous. All signed-integer binary representations require a known, fixed width. Since A and B are different widths, we can't make the normal assumption that they are written in the proper width. Without being able to make that assumption, there is no reason to assume that the leading 1 in A is the msb of the representation.