0.2: Binary numbers
1 Applying the conversion scheme at pages 6-7 the binary representation of
(a) $64$ is
$$ \begin{array}{ r c r c r c | c } \phantom{0}64 & \div & 2 & = & \phantom{0}32 & \text{R} & 0 \\ 32 & \div & 2 & = & 16 & \text{R} & 0 \\ 16 & \div & 2 & = & 8 & \text{R} & 0 \\ 8 & \div & 2 & = & 4 & \text{R} & 0 \\ 4 & \div & 2 & = & 2 & \text{R} & 0 \\ 2 & \div & 2 & = & 1 & \text{R} & 0 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$and reading from bottom-to-up direction $(64)_{10}$ $=$ $(1000000)_2$.
(b) Binary representation of $17$ is
$$ \begin{array}{ r c r c r c | c } \phantom{0}17 & \div & 2 & = & \phantom{00}8 & \text{R} & 1 \\ 8 & \div & 2 & = & 4 & \text{R} & 0 \\ 4 & \div & 2 & = & 2 & \text{R} & 0 \\ 2 & \div & 2 & = & 1 & \text{R} & 0 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$so $(17)_{10} = (10001)_2$.
(c) Binary representation of $79$ is
$$ \begin{array}{ r c r c r c | c } \phantom{0}79 & \div & 2 & = & \phantom{0}39 & \text{R} & 1 \\ 39 & \div & 2 & = & 19 & \text{R} & 1 \\ 19 & \div & 2 & = & 9 & \text{R} & 1 \\ 9 & \div & 2 & = & 4 & \text{R} & 1 \\ 4 & \div & 2 & = & 2 & \text{R} & 0 \\ 2 & \div & 2 & = & 1 & \text{R} & 0 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$so $(79)_{10} = (1001111)_2$.
(d) Binary representation of $227$ is
$$ \begin{array}{ r c r c r c | c } 227 & \div & 2 & = & 113 & \text{R} & 1 \\ 113 & \div & 2 & = & 56 & \text{R} & 1 \\ 56 & \div & 2 & = & 28 & \text{R} & 0 \\ 28 & \div & 2 & = & 14 & \text{R} & 0 \\ 14 & \div & 2 & = & 7 & \text{R} & 0 \\ 7 & \div & 2 & = & 3 & \text{R} & 1 \\ 3 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$so $(227)_{10} = (11100011)_2$.
2
(a) If
$$ \left( \frac{1}{8} \right)_{10} = (0.125)_{10} $$then
$$ \begin{array}{ l c c c l c c } 0.125 & \times & 2 & = & 0.25 & + & 0 \\ 0.25 & \times & 2 & = & 0.5 & + & 0 \\ 0.5 & \times & 2 & = & 0.0 & + & 1 \end{array} $$so $(0.125)_{10} = (0.001)_2$.
(b) Similarily, because
$$ \frac{7}{8} = 1 - \frac{1}{8} = 1 - 0.125 = 0.875, $$then
$$ \begin{array}{ l c c c l c c } 0.875 & \times & 2 & = & 0.75 & + & 1 \\ 0.75 & \times & 2 & = & 0.5 & + & 1 \\ 0.5 & \times & 2 & = & 0.0 & + & 1 \end{array} $$thenceworth $(0.875)_{10} = (0.111)_2$.
(c) Expressing $35/16$ as a decimal by using the long division algorithm leads to a real number $2.1875$, so to binarize the number means binarizing the $2.0$ and $0.1875$ separately,
$$ \begin{array}{ r c r c r c | c } 2 & \div & 2 & = & 0 & \text{R} & 0 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$and
$$ \begin{array}{ l c c c l c c } 0.1875 & \times & 2 & = & 0.375 & + & 0 \\ 0.375 & \times & 2 & = & 0.75 & + & 0 \\ 0.75 & \times & 2 & = & 0.5 & + & 1 \\ 0.5 & \times & 2 & = & 0.0 & + & 1 \end{array} $$so $(2.1875)_{10} = (10.0011)_2$.
(d) Becasue $31/64 = 0.484375$, so
$$ \begin{array}{ l c c c l c c } 0.484375 & \times & 2 & = & 0.96875 & + & 0 \\ 0.96875 & \times & 2 & = & 0.9375 & + & 1 \\ 0.9375 & \times & 2 & = & 0.875 & + & 1 \\ 0.975 & \times & 2 & = & 0.75 & + & 1 \\ 0.75 & \times & 2 & = & 0.5 & + & 1 \\ 0.5 & \times & 2 & = & 0.0 & + & 1 \end{array} $$meaning that $(0.484375)_{10} = (0.011111)_2$.
3 Next exercises show only the steps and solutions.
(a) $(10.5)_{10} = (1010.1)_2$:
$$ \begin{array}{ r c r c r c c } 10 & \div & 2 & = & 5 & \text{R} & 0 \\ 5 & \div & 2 & = & 2 & \text{R} & 1 \\ 2 & \div & 2 & = & 1 & \text{R} & 0 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$$$ \begin{array}{ r c r c r c c } 0.5 & \times & 2 & = & 0.0 & + & 1 \\ 0.0 & \times & 2 & = & 0.0 & + & 0 \end{array} $$(b) $(1/3)_{10} = (0.\bar{3})_{10} = (0.\bar{01})_2$:
$$ \begin{array}{ c c r c c c c } 0.\bar{3} & \times & 2 & = & 0.\bar{6} & + & 0 \\ 0.\bar{6} & \times & 2 & = & 0.\bar{3} & + & 1 \\ 0.\bar{3} & \times & 2 & = & 0.\bar{6} & + & 0 \\ 0.\bar{6} & \times & 2 & = & 0.\bar{3} & + & 1 \\ 0.\bar{3} & \times & 2 & = & 0.\bar{6} & + & 0 \\ 0.\bar{6} & \times & 2 & = & 0.\bar{3} & + & 1 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \end{array} $$(c) $(5/7)_{10} = (0.\bar{714285})_{10} = (0.\bar{10})_2$:
$$ \begin{array}{ l c r c l c c } 0.\bar{714285} & \times & 2 & = & 0.\bar{42857} & + & 1 \\ 0.\bar{42857} & \times & 2 & = & 0.\bar{857142} & + & 0 \\ 0.\bar{714285} & \times & 2 & = & 0.\bar{42857} & + & 1 \\ 0.\bar{42857} & \times & 2 & = & 0.\bar{857142} & + & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \end{array} $$(d) $(12.8)_{10} = (0.\bar{1100})_2$:
$$ \begin{array}{ r c r c r c c } 12.0 & \div & 2 & = & 6 & \text{R} & 0 \\ 6 & \div & 2 & = & 3 & \text{R} & 0 \\ 3 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$$$ \begin{array}{ l c r c l c c } 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \end{array} $$(d) $(55.4)_{10} = (110010.\overline{0110})_2$:
$$ \begin{array}{ r c r c r c c } 55.0 & \div & 2 & = & 25 & \text{R} & 0 \\ 25 & \div & 2 & = & 12 & \text{R} & 1 \\ 12 & \div & 2 & = & 6 & \text{R} & 0 \\ 6 & \div & 2 & = & 3 & \text{R} & 0 \\ 3 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$$$ \begin{array}{ l c r c l c c } 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \end{array} $$(f) $(0.1)_{10} = (0.\overline{001})_2$:
$$ \begin{array}{ l c r c l c c } 0.1 & \times & 2 & = & 0.2 & + & 0 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \end{array} $$4
(a) $(11.25)_{10} = (1111.01)_2$:
$$ \begin{array}{ r c r c r c c } 11.0 & \div & 2 & = & 5 & \text{R} & 1 \\ 5 & \div & 2 & = & 2 & \text{R} & 1 \\ 2 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$$$ \begin{array}{ l c r c l c c } 0.25 & \times & 2 & = & 0.5 & + & 0 \\ 0.50 & \times & 2 & = & 0.0 & + & 1 \\ \end{array} $$(b) $(2/3)_{10} = (0.\bar{6})_{10} = (0.100)_2$:
$$ \begin{array}{ l c r c l c c } 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \end{array} $$(c) $(3/5)_{10} = (0.6)_{10} = (0.\bar{100})_2$:
$$ \begin{array}{ l c r c l c c } 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \end{array} $$(d) $(3.2)_{10} = (11.001\bar{0011})_2$:
$$ \begin{array}{ r c r c r c c } 3.0 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$$$ \begin{array}{ l c r c l c c } 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ \end{array} $$(e) $(30.6)_{10} = (11110.\bar{100})_2$:
$$ \begin{array}{ r c r c r c c } 30.0 & \div & 2 & = & 15 & \text{R} & 0 \\ 15 & \div & 2 & = & 7 & \text{R} & 1 \\ 7 & \div & 2 & = & 3 & \text{R} & 1 \\ 3 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \\ \end{array} $$$$ \begin{array}{ l c r c l c c } 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.2 & \times & 2 & = & 0.4 & + & 0 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \end{array} $$(f) $(99.9)_{10} = (1000010.1\bar{110})_2$:
$$ \begin{array}{ r c r c r c c } 99.0 & \div & 2 & = & 33 & \text{R} & 0 \\ 33 & \div & 2 & = & 16 & \text{R} & 1 \\ 16 & \div & 2 & = & 8 & \text{R} & 0 \\ 8 & \div & 2 & = & 4 & \text{R} & 0 \\ 4 & \div & 2 & = & 2 & \text{R} & 0 \\ 2 & \div & 2 & = & 1 & \text{R} & 0 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$$$ \begin{array}{ l c r c l c c } 0.9 & \times & 2 & = & 0.8 & + & 1 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ 0.8 & \times & 2 & = & 0.6 & + & 1 \\ 0.6 & \times & 2 & = & 0.2 & + & 1 \\ 0.4 & \times & 2 & = & 0.8 & + & 0 \\ \end{array} $$5 – 6
If
$$ \pi = 3.141592653589793 $$then
$$ \begin{array}{ r c r c r c c } 3 & \div & 2 & = & 1 & \text{R} & 1 \\ 1 & \div & 2 & = & 0 & \text{R} & 1 \end{array} $$and
so $\pi$ in binary when computing its first fifteen digits are
$$ \phantom{.} \ (11.00101000011111)_{10} \ . $$Similarily, since
$$ e = 2.718281828459045\cdots $$so ignoring numbers after the 15th digit of $e$, it can be seen that for $(2.0)_{10}$,
$$ \begin{array}{ r c r c r c c } 2 & \div & 2 & = & 0 & \text{R} & 1 \\ 0 & \div & 2 & = & 0 & \text{R} & 0 \end{array} $$and for the decimal part
which means that $e$ approximated to first fifteen digits is
$$ \phantom{.} \ (01.101101111110000)_2 \ . $$7
(a)
(b)
(c)
…
(d)
…
(e)
…
(f)
…
(g)
…
(g)
…
8
…