Computer Science · Ch 2 — Encoding Schemes and Number System
Conversion between Number Systems
2.3
Conversion between Number Systems
We now know the four number systems used in the context of computers. The natural next step is learning to convert a number from one system to another, which is essential for understanding how numbers are represented inside a computer.
Why conversion matters — each system has its own role:
- The decimal system is the one most commonly used by humans.
- Digital systems understand only binary numbers.
- Octal and hexadecimal exist to simplify the binary representation so that we can read and manage it.
Moving between these worlds is therefore a constant necessity, and the following subsections build the complete toolkit:
- 2.3.1 — Decimal to other number systems: the repeated-division method (divide by the base, collect remainders bottom-to-top), applied to binary, octal and hexadecimal.
- 2.3.2 — Other number systems to decimal: the positional-value method (multiply each symbol by base^position and add).
- 2.3.3 — Binary to octal/hexadecimal and vice-versa: the shortcut of grouping bits — 3 at a time for octal, 4 at a time for hexadecimal — and substituting groups directly. …