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 = ~ ??? $ |
||||
| show 2 more comments |
|
Your answer is correct for $X+Y = 11101010$ Hint (Algorithm): $X-Y$
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$$ |
|||||||
|
|
For $Y-X$ you do it just like base $10$. In this case there are no borrows. For unsigned, there is no answer to $X-Y$ because negative numbers cannot be represented. $$\ \ \ 10110101\\ \underline{-00110101}\\\ \ \ 10000000$$ |
|||||||||
|
01-10and10-01in binary first, and then try to tackle your problem. – gt6989b Feb 20 at 23:57