Upon completing this lesson, you will be able to:
A number system is a structured way of representing numbers using a set of symbols. The most important concept is the base (or radix), which defines the number of unique digits used. The value of a digit depends not only on its face value but also on its position within the number.
Decimal (Base-$10$): This is the system we learn from childhood. Its base is $10$, meaning it uses ten digits $(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)$. Each position in a number represents a power of $10$. Consider the number $253$:
$$ (2 \times 10^2) + (5 \times 10^1) + (3 \times 10^0) = 200 + 50 + 3 = 253_{10} $$
Binary (Base-$2$): This is the native language of all digital computers. Its base is $2$, using only two digits $(0$ and $1)$. Each position in a number represents a power of $2$. A single binary digit is called a bit.
$$ (1 \times 2^3) + (1 \times 2^2) + (0 \times 2^1) + (1 \times 2^0) = 8 + 4 + 0 + 1 = 13_{10} $$
Hexadecimal (Base-$16$): This system is a human-friendly shorthand for binary. Its base is $16$, using sixteen symbols: the digits $0-9$ and the letters $A-F$ to represent values $10$ through $15$.
A=10, B=11, C=12, D=13, E=14, F=15$$ (10 \times 16^1) + (5 \times 16^0) = 160 + 5 = 165_{10} $$
To convert a decimal number to binary, repeatedly divide the number by $2$ and record the remainders. The binary equivalent is the sequence of remainders read from the bottom up.
Example:
Convert $42_{10}$ to binary
| Division | Quotient | Remainder |
|---|---|---|
| $42 \div 2$ | $21$ | $0$ |
| $21 \div 2$ | $10$ | $1$ |
| $10 \div 2$ | $5$ | $0$ |
| $5 \div 2$ | $2$ | $1$ |
| $2 \div 2$ | $1$ | $0$ |
| $1 \div 2$ | $0$ | $1$ |
Reading the remainders from the bottom (MSB - Most Significant Bit) to the top (LSB - Least Significant Bit) gives $101010_2$.
This is the most crucial conversion in computing. Since $16 = 2^4$, every group of four binary bits corresponds to exactly one hexadecimal digit.
Example: