Information Technology Reference
In-Depth Information
fractional part conversion may not terminate after a finite number of repeated mul-
tiplications. Therefore, the process may have to be terminated after a number of
steps, thus leading to some acceptable approximation.
Example
Consider the conversion of the decimal number 67.575 into binary.
Here r 1 ¼
0.575. For the integral part X int , a repeated
division by 2 will result in the following quotients and remainders:
10, r 2 ¼
2, X int ¼
67, and X f ¼
Quotient
33
16
8
4
2
1
0
Remainder
1
1
0
0
0
0
1
Therefore the integral part in radix r 2 ¼
(1000011). A similar method can
be used to obtain the fractional part (through repeated multiplication):
2isX int ¼
Fractional part
0.150
0.300
0.600
0.200
0.400
0.800
0.600
0.200
...
Carry over bit
1
0
0
1
0
0
1
1
...
The fractional part is X f ¼
). Therefore, the resultant representation
of the number 67.575 in binary is given by (1000011.10010011
(.10010011
...
...
).
4.1.2. Negative Integer Representation
There exist a number of methods for representation of negative integers. These
include the sign-magnitude, radix complement, and diminished radix complement.
These are briefly explained below.
4.1.3. Sign-Magnitude
According to this representation, the most significant bit (of the n bits used to
represent the number) is used to represent the sign of the number such that a “1”
in the most significant bit position indicates a negative number while a “0” in the
most significant bit position indicates a positive number. The remaining (n
1)
bits are used to represent the magnitude of the number. For example, the negative
number (
18) is represented using 6 bits, base 2 in the sign-magnitude format, as
follows (110010), while a (
2
18) is represented as (010010). Although simple, the
sign-magnitude representation is complicated when performing arithmetic opera-
tions. In particular, the sign bit has to be dealt with separately from the magnitude
bits. Consider, for example, the addition of the two numbers
þ
19
(110011) using the sign-magnitude representation. Since the two numbers carry
different signs, then the result should carry the sign of the larger number in
magnitude, in this case the (
þ
18 (010010) and
2
19). The remaining 5-bit numbers are subtracted
2
(10011
10010) to produce (00001), that is, (
1).
2
2
Search WWH ::




Custom Search