Figure 5.1 depicts a "number wheel" representation of our 4-bit
number system. The figure shows the binary numbers and their decimal integer
equivalents, assuming that the numbers are interpreted as sign and magnitude.
The largest positive number we can represent in three data bits is +7 =
23 - 1. By a similar calculation, the smallest negative number is -7. Zero
has two different representations, even though +0 and -0 don't make much
sense mathematically.
Adding two positive or two negative numbers is straightforward.
We simply perform the addition and assign the result the same sign as the
original operands. When the signs of the two operands are not the same,
addition becomes more complex. In this case, we should subtract the smaller
magnitude from the larger. The resulting sign is the same as that of the
number with the larger magnitude.
This is what makes arithmetic operations with sign and
magnitude numbers so cumbersome-any adder circuit must also include a subtractor
and a comparator. Because of this burdensome complexity, hardware designers
have proposed other schemes for representing negative -numbers.
Ones Complement Numbers A ones
complement approach represents the positive numbers just as in the
sign and magnitude system. The only difference is in how it represents negative
numbers.
We use the following procedure to derive a negative ones
complement integer, denoted , from a positive integer,
denoted N. If the word length is n bits ( n
= 4 in our case) , then = ( 2n -
1) - N. For example, in a 4-bit system, +7 is represented
as 0111. We compute -7 as
|