For unsigned integers $ X = 00110101 $ and $ Y = 10110101 $, determine the following values:
$ X + Y = (\text{My answer is}) ~ 11101010 $.
$ X - Y = ~ ??? $
$ Y - X = ~ ??? $
For unsigned integers $ X = 00110101 $ and $ Y = 10110101 $, determine the following values:
$ X + Y = (\text{My answer is}) ~ 11101010 $.
$ X - Y = ~ ??? $
$ Y - X = ~ ??? $
Your answer is correct for $X+Y = 11101010$
Hint (Algorithm): $X-Y$
Determine $Y’s$ $2’s$ complement $X+$ (2’s complement of $Y$)
If $X \ge Y$, an end carry will result. Discard the end carry.
If $X \lt Y$, no end carry will result. To obtain the answer in a familiar form, take the 2’s complement of the sum and place a negative sign in front.
You may want to display in a different form, but you did not specify (hint: convert the first answer to 2's complement form).
$$X - Y = -10000000 ~~\text{and}~~ Y - X = 10000000$$