Page 67 - Engineering Digital Design
P. 67
38 CHAPTER 2 / NUMBER SYSTEMS, BINARY ARITHMETIC, AND CODES
2.5.1 Conversion of Integers
Since the polynomial form of Eq. (2.2) is a geometrical progression, the integer portion can
be represented in nested radix form. In source radix s, the nested representation is
n 2 1
N s = (a n- {s ^ + a n- 2s"- + • • • + a,* + a 0s°) s
(2.3)
for digits a, having integer values from 0 to n — 1. The nested radix form not only suggests
a conversion process, but also forms the basis for computerized conversion.
Consider that the number in Eq. (2.3) is to be represented in nested radix r form,
N r =
/m-l \
(2.4)
where, in general, m =£ n. Then, if the source number N s is divided by r, the results are of
the form
where Q is the integer quotient rearranged as (?o = b\ + r(b 2 + • • • + b m^\) • • •) and R is
the remainder RQ = bo. A second division by r yields Qo/r = Q\ + R\/r, where Q\ is
arranged as Q\ = b 2 + r(£ 3 + • • • + b m_\) • • -) r and R\ = b\. Thus, by repeated division
of the integer result Q { by r, the remainders yield (bo,b\,b 2, . . . ,b m_\} r in that order.
The conversion method just described, called the radix divide method, can be used to
convert between any two integers of different radices. However, the requirement is:
The arithmetic required by N s/r must be carried out in source radix, s.
Except for source radices 10 and 2, this creates a problem for humans.
Table 2.4 provides the recommended procedures for integer conversion by noncomputer
means. The radix divide method is suitable for use in computers only if they are programmed
to carry out the arithmetic in different radices. Notice the partitioning required for conversion
between binary and BCH and BCO integers.
The following two algorithms offer noncomputer methods for integer conversion:
Algorithm 2.1: N r *- N s Positive Integer Conversion
Use Eq. (2.2) and the substitution method with base 10 arithmetic to convert N s to #10,
then use the radix divide method and base 10 arithmetic to convert NIQ to N r.