10 min read
Introduction
Why computers need other number systems, what you will be able to do by the end, and the notation used in this course.
A Strange Number on the Screen
What You Will Be Able to Do
- Explain place value and what a number base is.
- Explain why computers use binary.
- Convert between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) in every direction.
- Show your working in clear tables that you can copy into a report.
- Recognise where binary, octal and hex appear in real systems.
How We Write the Base
The digits 10 mean ten in decimal, but two in binary and sixteen in hexadecimal. To avoid confusion we write the base as a small number after the value, called a subscript:
| Written | Read as | Value in decimal |
|---|---|---|
| 10₁₀ | "one-zero, base ten" | 10 |
| 10₂ | "one-zero, base two" | 2 |
| 10₈ | "one-zero, base eight" | 8 |
| 10₁₆ | "one-zero, base sixteen" | 16 |
In programming you will also see prefixes instead of subscripts: 0b for binary (0b1010), 0o for octal (0o17) and 0x for hexadecimal (0x7F3A).
Number base converter
Binary (2)
100000010011010110001000
Octal (8)
40232610
Decimal (10)
8467848
Hex (16)
813588
Working: write each hex digit as 4 bits
| 8 | 1 | 3 | 5 | 8 | 8 |
| 1000 | 0001 | 0011 | 0101 | 1000 | 1000 |
Answer: 81358816 = 1000000100110101100010002 = 1000000100110101100010002 (leading zeros dropped)
Practice
More lessons in Number Systems · Next: Place Value and Number Bases
