Repeat Exercise, this time using appropriate expressions and rules for ones’-complement addition.
Exercise
Given an integer x in the range −2n−1 ≤ x ≤ 2n−1 − 1, we define [x] to be the two’s-complement representation of x, expressed as a positive number: [x] = x if x ≥ 0 and [x] = 2n − |x| if x<0, where |x| is the absolute value of x. Let y be another integer in the same range as x. Prove that the two’s-complement addition rules given in Section 2.6 are correct by proving that the following equation is always true:
[x + y] = [x] + [y] modulo 2n
(Hints: Consider four cases based on the signs of x and y. Without loss of generality, you may assume that |x| ≥ |y|.)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.