The radix (often referred to as base) \(r\) of a number system determines the number of distinct values (digits) that can be used to represent any arbitrary number. The radix point (or decimal point when 10 is the radix) distinguishes positive powers (integer part) of \(r\) from negative powers (fractional part) of \(r\).
In general, using \(n\) digits allows representation of positive integers in base \(r\) in the range from \(0\) to \(r^n - 1\) (or \(r^n\) possible values).
A digit is a single numerical symbol used to represent numbers.
\(\boxed{N = (d_{n - 1} \cdots d_{2}\,d_{1}\,d_{0}\,.\,d_{-1}\,d_{-2} \cdots d_{-m})_r}\)
where:
- \(r\) is the radix of number \(N\).
- \(d\) are digits of number \(N\) that range in value from \(0\) to \(r - 1\).
- \(n\) is the length of the integer part of number \(N\).
- \(m\) is the length of the fractional part of number \(N\).
In general, a number \(N\) expressed in a base \(r\) system has digits \(d\) multiplied by powers of \(r\).
Expanding the number \(N\) in a power series,
\(\displaystyle \left[N_\textrm{(integer part)}\right]_r = d_{n - 1} \cdot r^{n - 1} + \cdots + d_2 \cdot r^2 + d_1 \cdot r + d_0\)
\(\displaystyle \left[N_\textrm{(fractional part)}\right]_r = d_{-1} \cdot r^{-1} + d_{-2} \cdot r^{-2} + \cdots + d_{-m} \cdot r^{-m}\)
\(\boxed{N = \left[N_\textrm{(integer part)}\right]_r + \left[N_\textrm{(fractional part)}\right]_r = \sum_{i = 0}^{n - 1} d_i \cdot r^i + \sum_{j = 1}^{m} d_{-j} \cdot r^{-j}}\)
where:
- \(r\) is the radix of number \(N\).
- \(d_i\) and \(d_{-j}\) are digits of number \(N\) that range in value from \(0\) to \(r - 1\).
- \(n\) is the length of the integer part of number \(N\).
- \(m\) is the length of the fractional part of number \(N\).
For example, \(\displaystyle N = (1425.037)_{8}\)
\(\displaystyle N = (d_{3}d_{2}d_{1}d_{0}.d_{-1}d_{-2}d_{-3})_{8}\)
\(\displaystyle N = d_3 \cdot 8^3 + d_2 \cdot 8^2 + d_1 \cdot 8^1 + d_0 \cdot 8^0 + d_{-1} \cdot 8^{-1} + d_{-2} \cdot 8^{-2} + d_{-3} \cdot 8^{-3}\)
\(\displaystyle N = 1 \cdot 8^3 + 4 \cdot 8^2 + 2 \cdot 8^1 + 5 \cdot 8^0 + 0 \cdot 8^{-1} + 3 \cdot 8^{-2} + 7 \cdot 8^{-3}\)
If the power series is evaluated using decimal (base-10) arithmetic, the resulting value is a decimal number.
\(\displaystyle N = (1425.037)_{8} = \left(789.060546875\right)_{10}\)
Number-Base Conversion
Representations of a number in a different radix are said to be equivalent if they have the same decimal (base-10) representation.
For example, \(\displaystyle (0011)_8 = (1001)_2\)
\(\displaystyle 0 \times 8^3 + 0 \times 8^2 + 1 \times 8 + 1 = 1 \times 2^3 + 0 \times 2^2 + 0 \times 2 + 1 = (9)_{10}\)
The conversion of a number in base \(r\) to decimal (base-10) is done by expanding the number in a power series and adding all the terms as shown previously. If the number includes a radix point, it is necessary to separate the number into an integer part and fraction part, since each part must be converted differently.
Decimal Integer to a Number in Different Base
The conversion of a decimal integer \(N\) to a number in base \(r\) is done by dividing the number and all successive quotients by \(r\) and accumulating the remainders.
\(\boxed{N / r = Q + (d / r)}\)
\(\boxed{Q = \frac{N - d}{r}}\)
\(\boxed{d = N - Q \times r}\)
where:
- \(d\) is the remainder (digit in base \(r\)) of \(N / r\) that ranges in value from \(0\) to \(r - 1\).
- \(Q\) is the integer quotient of \(N / r\).
To convert the decimal integer \(N\) to a number in base \(r\). First, the decimal integer \(N\) is divided by base \(r\) to give an integer quotient \(Q\) and a remainder \(d\). Then, the integer quotient \(Q\) is divided by base \(r\) to give a new quotient and a remainder. The process is continued until the integer quotient \(Q\) becomes 0. The digits of the number in base \(r\) are obtained from the remainders.
For example, convert number \(N = (153)_{10}\) to a number in base \(r = 8\)
\(\displaystyle Q_0 = \frac{N - d_0}{r} = \frac{153 - d_0}{8} = 19\:\to\:d_0 = N - Q_0 \times r = 153 - 19 \times 8 = 1\)
\(\displaystyle Q_1 = \frac{Q_0 - d_1}{r} = \frac{19 - d_1}{8} = 2\:\to\:d_1 = Q_0 - Q_1 \times r = 19 - 2 \times 8 = 3\)
\(\displaystyle Q_2 = \frac{Q_1 - d_2}{r} = \frac{2 - d_2}{8} = 0\:\to\:d_2 = Q_1 - Q_2 \times r = 2 - 0 \times 8 = 2\)
\(\displaystyle N = (d_{2}d_{1}d_{0})_8 = (231)_8 = (153)_{10}\)
Decimal Fraction to a Number in Different Base
The conversion of a decimal fraction \(N\) to a number in base \(r\) is done by multiplying the number and all fraction part of successive products by \(r\) and accumulating the integers (integer part of the products).
\(\boxed{N \times r = d + F}\)
\(\boxed{F = (N \times r) - d}\)
\(\boxed{d = (N \times r) - F}\)
where:
- \(d\) is the integer part (digit in base \(r\)) of the product of \(N \times r\) that ranges in value from \(0\) to \(r - 1\).
- \(F\) is the fraction part of the product of \(N \times r\).
To convert decimal fraction \(N\) to a number in base \(r\). First, the decimal fraction \(N\) is multiplied by base \(r\) to give an integer \(d\) and a fraction \(F\). Then, the new fraction is multiplied by base \(r\) to give a new integer and a new fraction. The process is continued until the fraction becomes 0 or until the number of digits has sufficient accuracy. The digits of the number in base \(r\) are obtained from the integers (integer part of the products).
For example, convert number \(N = (0.6875)_{10}\) to a number in base \(r = 2\)
\(\displaystyle F_0 = (N \times r) - d_{-1} = (0.6875 \times 2) - d_{-1} = 0.375\:\to\:d_{-1} = (N \times r) - F_0 = (0.6875 \times 2) - 0.375 = 1\)
\(\displaystyle F_1 = (F_0 \times r) - d_{-2} = (0.375 \times 2) - d_{-2} = 0.75\:\to\:d_{-2} = (F_0 \times r) - F_1 = (0.375 \times 2) - 0.75 = 0\)
\(\displaystyle F_2 = (F_1 \times r) - d_{-3} = (0.75 \times 2) - d_{-3} = 0.5\:\to\:d_{-3} = (F_1 \times r) - F_2 = (0.75 \times 2) - 0.5 = 1\)
\(\displaystyle F_3 = (F_2 \times r) - d_{-4} = (0.5 \times 2) - d_{-4} = 0\:\to\:d_{-4} = (F_2 \times r) - F_3 = (0.5 \times 2) - 0 = 1\)
\(\displaystyle N = (0.d_{-1}d_{-2}d_{-3}d_{-4})_2 = (0.1011)_2 = (0.6875)_{10}\)