signed binary numbers subtraction using 1's complement

Thread Starter

hunter6

Joined Feb 22, 2018
35
Untitled-1.jpg
My approach to the question is attached. Is it correct ?
upload_2018-9-23_16-35-32.png



(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:

WBahn

Joined Mar 31, 2012
30,082
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.
 
Top