Number bases
Binary and hexadecimal: the numbers computers use.
Pen and paper is fine · no calculator needed why?
Opens at level 25.
the lesson
Read the lesson
The idea
Our numbers are base 10: each place is worth ten times the place to its right. Other bases work the same way with a different multiplier.
Binary (base 2) uses only the digits 0 and 1, and its places are 1, 2, 4, 8, 16, 32 and so on, doubling from the right. Computers use it because a switch is either off or on.
Hexadecimal (base 16) needs sixteen digits, so after 9 come the letters A to F for 10 to 15. Its places are 1, 16, 256 and so on.
Techniques
Add the places that are on
- Write the place values over the digits: 1 on the right, doubling as you go left.
- Add the place values that have a 1 under them.
worked example
What is the binary number 1 0 1 1 0 1 in decimal? Its digits are spaced out for reading.
- Places from the right: 1, 2, 4, 8, 16, 32.
- The 1s sit under 32, 8, 4 and 1.
- 32 + 8 + 4 + 1 = 45.
Answer: 45
Take the biggest power of 2
- Find the largest power of 2 that fits, and take it away.
- Repeat with what is left until nothing remains.
- Write 1 in each place you used and 0 in the others, largest place first.
- 37 is 32 + 4 + 1, which gives the digits 1 0 0 1 0 1.
worked example
Write 6 in binary.
- 6 = 4 + 2.
- Places 4, 2 and 1 get 1, 1 and 0.
- So 6 is 110 in binary.
Answer: 110
Sixteens and ones
- Swap each letter for its value: A is 10, B 11, C 12, D 13, E 14, F 15.
- Two digits: the left one counts sixteens and the right one counts ones.
- Three digits: the places are 256, 16 and 1.
worked example
What is hexadecimal 3C in decimal?
- C is 12.
- 3 × 16 + 12 = 48 + 12 = 60.
Answer: 60
Tips by skill
- TipBinary to decimal: Label the places 1, 2, 4, 8 and so on from the right, then add the places holding a 1.
- TipDecimal to binary: Take away the largest power of 2 that fits, again and again. Each power used is a 1; every other place is 0.
- TipHexadecimal: Letters stand for 10 to 15. The places from the right are 1, 16 and 256: multiply and add.
Watch out for
- Reading binary place values from the wrong end. The rightmost digit is always the 1s place.
- Writing a binary answer backward. The largest place comes first. If you halve repeatedly instead, read the remainders from last to first.
- Treating hexadecimal places as tens. 2F is 2 sixteens and 15 ones, which is 47, not 35.
skills · practice stats
-
Binary to decimal not tried yet
worked example
What is the binary number 10011 in decimal?
Answer: 19
- Place values from the right: 1, 2, 4, 8, 16.
- The places with a 1: 16 + 2 + 1 = 19.
-
Decimal to binary not tried yet
worked example
Write 68 in binary.
Answer: 1000100
- Take the largest powers of 2 that fit: 68 = 64 + 4.
- Places 64, 32, 16, 8, 4, 2, 1 get 1 0 0 0 1 0 0, so 68 is 1000100 in binary.
-
Hexadecimal not tried yet
worked example
What is hexadecimal A75 in decimal?
Answer: 2,677
- Hexadecimal places are 256, 16 and 1.
- A75 = A (10) × 256 + 7 × 16 + 5 = 2,560 + 112 + 5 = 2,677.
rest ladder
- 1 day
- 3 days
- 7 days
- 14 days
- 30 days
- 60 days
- mastered · every 90 days