Question: Prove the validity of the simple rule for finding the 2s complement of a number, which was presented in Section 3.3. Recall that the rule

Prove the validity of the simple rule for finding the 2’s complement of a number, which was presented in Section 3.3. Recall that the rule states that scanning a number from right to left, all 0s and the first 1 are copied; then all remaining bits are complemented.


Section 3.3

In the decimal system the sign of a number is indicated by a + or − symbol to the left of the most-significant digit. In the binary system the sign of a number is denoted by the left-most bit. For a positive number the left-most bit is equal to 0, and for a negative number it is equal to 1. Therefore, in signed numbers the left-most bit represents the sign, and the remaining n − 1 bits represent the magnitude, as illustrated in Figure 3.7. It is important to note the difference in the location of the most-significant bit (MSB). In unsigned numbers all bits represent the magnitude of a number; hence all n bits are significant in defining the magnitude. Therefore, the MSB is the left-most bit, bn−1. In signed numbers there are n − 1 significant bits, and the MSB is in bit position bn−2.

MSB Sign 0 denotes + 1 denotes - bn-\ (a) Unsigned number


MSB Sign 0 denotes + 1 denotes - bn-\ (a) Unsigned number bn-1 b-2 Magnitude MSB Magnitude (b) Signed number b b bo bo

Step by Step Solution

3.39 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To prove the validity of the simple rule for finding the 2s complement of a number we need to show t... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!