next up previous
Next: Bytes, Memory, Address Up: CS101 Lecture 3 Previous: Bits and Bytes

Decimal, Binary, Hexadecimal

The ``value'' of a n-digit number in decimal system

\begin{displaymath}
d_{n-1} d_{n-2} ... d_1 d_0 = \sum_{i=0}^{i=n-1} 10^i * d_i
\end{displaymath}

Example: 7842 = 1000 * 7 + 100 * 8 + 10 * 4 + 1 * 2

Similarly, a n-bit binary number has a ``value''

\begin{displaymath}
b_{n-1} b_{n-2} ... b_1 b_0 = \sum_{i=0}^{i=n-1} 2^i * d_i
\end{displaymath}

Example: 101010 = 32 * 1 + 16 * 0 + 8 * 1 + 4 * 0 + 2 * 1 + 1 * 0 = 42

Similarly, hexadecimal (base 16).

Example: 4A9C = 4096 * 4 + 256 * 10 + 16 * 9 + 1 * 12 = ??

More in next Quiz!



G. Sivakumar 2000-07-29