Page 1035 - The Mechatronics Handbook
P. 1035

36.6 Number Conversion from One Base to Another


                                 The method of using series polynomial expansions for converting numbers from one base to another is
                                 illustrated in Table 36.5.
                                   Evaluation of polynomials is more efficiently done with the nested form. The nested form is obtained
                                 from the series form by successive factoring of the variable from all terms in which it appears as
                                 shown in Table 36.6. The number of multiplications to evaluate the nested form increases linearly
                                 with the order of the polynomial, whereas the number of multiplications to evaluate the series form
                                 increases with the square of the order.
                                   Conversion of integers between bases is more easily done using the lower order polynomials, Table 36.6(b),
                                 obtained by nesting. The least significant digit of the number in the new base is the remainder obtained
                                 after dividing the number in the old base by the new radix. The next least significant digit is the remainder
                                 obtained by dividing the first reduced polynomial by the new radix. The process is repeated until the most
                                 significant digit in the new base is obtained as the remainder, when the new radix no longer fits into the last
                                 reduced polynomial. This is more compactly represented with the arithmetic notation shown in Table 36.7
                                 along with the same examples used to illustrate the polynomial series method.

                                   TABLE 36.5  Series Polynomial Method for Converting Numbers Between Bases
                                                                            Sample Conversion From
                                   Method                    A Lower to a Higher Base    A Higher to a Lower Base
                                                                            0
                                                                  2
                                                                                                    0
                                                                                             1
                                                                       1
                                   1. Express number in polynomial  101.1 2  = 1 x 2  + 0 × 2  + 1 × 2  + 1 × 2 -1  36.5 10  = 3 × 10  + 6 × 10  + 5 × 10 -1
                                    form in the given base
                                                                                                     0
                                                                                           1
                                   2. Convert radix and coefficients  = 1 × 4 + 0 × 2 + 1 × 1 + 1 × 0.5  = 11 × 1010  + 110 × 1010  + 101 × 1010 -1
                                    to the new base
                                   3. Evaluate terms in the new                    = 11 × 1010 + 110 + 101/1010
                                    base                 = 4 + 0 + 1 + 0.5         = 11110 + 110 + .1
                                   4. Add the terms      101.1 2  = 5.5 10         36.5 10  = 100100.1 2
                                           TABLE 36.6  Nested Polynomials
                                           (a) Nested Polynomial via Iterated Factoring  (b) Lower Order Polynomials
                                                                       2
                                           N = N n −1 R n−1  + N n− 2 R n −2  + ··· + N 2 R + N 1 R + N 0  N = N (1)  R + N 0
                                                                                            (2)
                                           N = (N n−1 R n−2  + N n−2 R n−3  + ··· + N 2 R + N 1 )R + N 0  N  (1)  = N R  + N 1
                                           N = ((N n−1 R n−3  + N n−2 R n− 4  + ··· + N 2 )R + N 1 )R + N 0  N  (2)  = N (3)  R + N 2
                                                                                             ·
                                                         .                                   · ·
                                                         .
                                                         .                                     )
                                                                                             n   3
                                                                                        −
                                                                                      N  (n   2) = N  ( −  R + N n−2
                                                     R
                                           N = (··· (N n −1 ) + N n− 2 )R + ··· + N 2 )R + N 1 )R + N 0  N  (n−1)  = N n −1
                                               TABLE 36.7  Radix Divide Method for Converting Numbers Between Bases
                                                                        Sample Conversion From
                                               Method         A Higher to a Lower Base  A Lower to a Higher Base
                                               RN                236 10
                                               R N  (1)  N 0     2 18       0
                                               R N  (2)  N 1     2 9        0         12 2012
                                                                                            3
                                                   (3)
                                               R N    N 2        2 4        1         12  2       1
                                                                                      12 102     11
                                                                 2 2        0
                                                  · ·
                                                  ·               2 1        0        12  0  2
                                               RN  (n−1)  N n−2     0  1
                                                                                       2012 3 = 214 5
                                               R 0    N n−1       36 10 = 100100 2
                                 ©2002 CRC Press LLC
   1030   1031   1032   1033   1034   1035   1036   1037   1038   1039   1040