The Decimal and Binary Number Systems

# The Decimal and Binary Number Systems

Before we start looking into the more involved stuff in the Numerical Analysis section, we must first establish a greater understanding of the decimal number system and the binary number system. We will first secure a foundation of the decimal number system which we are all too familiar with.

## The Decimal Number System

 Definition: The Decimal Number System is a number system for which every real number $x$ can be written in terms of the ten digits $0$, $1$, $2$, $3$, $4$, $5$, $6$, $7$, $8$, and $9$ as the sum of powers of $10$. A number in the decimal number system is said to be of base $10$ and to specify this we attach a subscript $10$ to $x$, written $(x)_{10}$.

We will specify the base of a number for the rest of this page and after that, we will will only specify the base of a number when the context is unclear.

For example, the number $(1539)_{10}$ is a decimal number, and we can decompose $(1539)_{10}$ into its respectively powers of $10$ as follows:

(1)
\begin{align} \quad (1539)_{10} = \left ( 1 \cdot 10^3 \right ) + \left ( 5 \cdot 10^2 \right ) + \left ( 3 \cdot 10^1\right ) + \left ( 9 \cdot 10^0 \right ) \end{align}

Similarly, we can decompose a decimal number that contains a fractional component similarly. For example, the number $(746.2901)_{10}$ can be written as the following sum:

(2)
\begin{align} \quad (746.2901)_{10} = \left ( 7 \cdot 10^2 \right ) + \left (4 \cdot 10^1 \right ) + \left (6 \cdot 10^0 \right ) + \left ( 2 \cdot 10^{-1} \right ) + \left (9 \cdot 10^{-2} \right ) + \left ( 0 \cdot 10^{-3} \right ) + \left (1 \cdot 10^{-4} \right ) \end{align}

In the case where we have a non-terminating decimal, for example, $\left ( \frac{1}{3} \right)_{10}$, then we can write this number as an infinite sum of powers of $10$:

(3)
\begin{align} \quad \left (\frac{1}{3} \right )_{10} = 0.333... = \left ( 3 \cdot 10^{-1} \right ) + \left ( 3 \cdot 10^{-2} \right ) + ... + \left ( 3 \cdot 10^{-n} \right ) + ... \end{align}

## The Binary Number System

We are most accustomed to using the decimal number system explained above, and the basic arithmetic associated with it, however, the binary number system is also extremely important - especially in computing. We will formally define the binary number system below. Note the similarities to the definition given for the decimal number system.

 Definition: The Binary Number System is a number system for which every real number $x$ can be written in terms of the two digits $0$ and $1$ as the sum of powers of $2$. A number written in the binary number system is said to be of base $2$, and to specify this we attach a subscript $2$ to $x$, written $(x)_{2}$.

With the binary number system, the only possibly digits to represent a real number $x$ are $0$'s and $1$'s, and the place holders for each digit correspond to powers of $2$. For example, consider the binary number $(1101)_2$. We note that:

(4)
\begin{align} \quad (1101)_2 = \left ( 1 \cdot 2^3 \right ) + \left ( 1 \cdot 2^2 \right ) + \left (0 \cdot 2^1 \right ) + \left ( 1 \cdot 2^0 \right ) = (13)_{10} \end{align}

Of course, binary numbers can also have fractional components. For example, consider the binary number $(101.0101)_2$ :

(5)
\begin{align} \quad (101.0101)_2 = \left ( 1 \cdot 2^2 \right ) + \left ( 0 \cdot 2^1 \right ) + \left ( 1 \cdot 2^0 \right ) + \left ( 0 \cdot 2^{-1} \right ) + \left ( 1 \cdot 2^{-2} \right ) + \left ( 0 \cdot 2^{-3} \right ) + \left ( 1 \cdot 2^{-4} \right ) = (5.3125)_{10} \end{align}