Information Technology Reference
In-Depth Information
4.1.4. Radix Complement
According to this system, a positive number is represented the same way as in the
sign-magnitude. However, a negative number is represented using the b's comp-
lement (for base b numbers). Consider, for example, the representation of the
number (
19) using 2's complement. In this case, the number 19 is first represented
as (010011). Then each digit is complemented, hence the name radix complement to
produce (101100). Finally a “1” is added at the least significant bit position to result
in (101101). Now, consider the 2's complement representation of the number (
2
18).
Since the number is positive, then it is represented as (010010), the same as in
the sign-magnitude case. Now, consider the addition of these two numbers. In this
case, we add the corresponding bits without giving special treatment to the sign
bit. The results of adding the two numbers produces (111111). This is the 2's comp-
lement representation of a (
þ
1), as expected. The main advantage of the 2's comp-
lement representation is that no special treatment is needed for the sign of the
numbers. Another characteristic of the 2's complement is the fact that a carry
coming out of the most significant bit while performing arithmetic operations is
ignored without affecting the correctness of the result. Consider, for example,
adding 2 19 (101101) and þ 26 (011010). The result will be (1)(000111), which
is correct (
2
þ
7) if the carry bit is ignored.
4.1.5. Diminished Radix Complement
This representation is similar to the radix complement except for the fact that no “1”
is added to the least significant bit after complementing the digits of the number, as
is done in the radix complement. According to this number system representation, a
(
18) is represented as (010010). If we
add these two numbers we obtain (111110), the 1's complement of a (
19) is represented as (101100), while a (
þ
2
1). The
main disadvantage of the diminished radix representation is the need for a correction
factor whenever a carry is obtained from the most significant bit while performing
arithmetic operations. Consider, for example, adding
2
3 (111100) to
þ
18 (010010)
2
TABLE 4.1 The 2's and the 1's Complement
Representation of an 8-Bit Number
Number
Representation
Example
2's Complement
x ¼ 0
0
0 (00000000)
0 , x , 256
x
77 (01001101)
2 128 x , 0
256 2 j x j
2 56 (11001000)
1's Complement
x ¼ 0
0 or 255
(11111111)
0 , x , 256
x
77 (01001101)
2 127 x , 0
255 2 j x j
2 56 (11000111)
Search WWH ::




Custom Search