Hardware, Memory & Number Systems
🔒 Log in to trackNumber systems: binary, octal, decimal, hexadecimal
🔒 Log in to trackA number system is a way of writing numbers with a fixed set of digits. Computers use binary (base 2). People use decimal (base 10). Octal (base 8) and hexadecimal (base 16) are short ways to write binary. Every conversion in the exam follows one of three moves: multiply and add, divide and read upward, or group bits.
The four systems
The base is the number of different digits the system uses.
| System | Base | Digits | Example |
|---|---|---|---|
| Binary | 2 | 0, 1 | 1101 |
| Octal | 8 | 0 to 7 | 65 |
| Decimal | 10 | 0 to 9 | 91 |
| Hexadecimal | 16 | 0 to 9, A to F | 2F |
In hexadecimal, A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
Any base to decimal
Each digit is worth digit × base^position. Count positions from 0 at the right.
- .
- .
Tip: Learn the powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. Then binary to decimal is just adding the places that hold a 1.
Decimal to any base
Divide again and again by the new base. Write each remainder. Read the remainders from bottom to top.
For 45 in binary:
- 45 ÷ 2 = 22, remainder 1.
- 22 ÷ 2 = 11, remainder 0.
- 11 ÷ 2 = 5, remainder 1.
- 5 ÷ 2 = 2, remainder 1.
- 2 ÷ 2 = 1, remainder 0.
- 1 ÷ 2 = 0, remainder 1.
Reading upward gives . Check: 32 + 8 + 4 + 1 = 45.
Grouping shortcut for octal and hex
One octal digit is 3 bits. One hex digit is 4 bits. Make groups from the right. Pad the left with zeros.
- becomes 001 101 011, which is 1, 5, 3. So it is .
- becomes 1101 1011, which is D, B. So it is .
Rule: Octal uses 3-bit groups. Hex uses 4-bit groups. Always start from the right.
Ranges and valid digits
n bits hold different values, from 0 to . So 8 bits hold 256 values, from 0 to 255.
- FF in hex is 255. It is the largest 8-bit value.
- 777 in octal is 511. It is the largest 3-digit octal number.
- An octal number never has 8 or 9.
- A hex number never has a letter after F.
More worked pairs
Use these as anchors to test your answers.
- .
- .
- .
- .
- , , .
- , because only the 16 place holds a 1.
- .
Quick checks on the options
Strike out options before you calculate.
- An option with 8 or 9 is never octal.
- An option with G or beyond is never hexadecimal.
- A binary number ending in 0 is even. One ending in 1 is odd.
Watch: Check the source base first. A digit that does not exist in that base means the option is wrong.
Question types you will see
Each type: how to recognise it, the method step by step, and one question to try.
Any base to decimal
'Decimal value of', 'equivalent decimal' or a number written with a subscript base.
Write the position of each digit, from 0 at the right.
Multiply each digit by base^position.
For hex, change letters to numbers first (A = 10 to F = 15).
Add the products.
Each place is worth a power of the base.
The decimal value of the binary number 110101 is...
Show solutionHide solution
The 1s sit at 32, 16, 4 and 1.
32 + 16 + 4 + 1 = 53.
53
Decimal to any base
'Binary equivalent of', 'convert decimal to octal' or 'to hex'.
Divide the number by the target base.
Write the remainder. Divide the quotient again.
Stop when the quotient is 0.
Read the remainders bottom to top.
Each remainder is one digit of the new number, starting from the right.
The binary equivalent of decimal 45 is...
Show solutionHide solution
The remainders in order are 1, 0, 1, 1, 0, 1.
Read them upward: 101101.
Check: 32 + 8 + 4 + 1 = 45.
101101
Binary to octal or hex by grouping
'Binary number in octal' or 'in hexadecimal'.
Octal: group bits in 3s from the right. Hex: group in 4s.
Pad the left with zeros.
Convert each group to one digit.
For hex, write 10 to 15 as A to F.
One octal digit is exactly 3 bits. One hex digit is exactly 4 bits.
The binary number 1101011 in octal is...
Show solutionHide solution
Group in 3s from the right: 001 101 011.
The groups are 1, 5 and 3.
n-bit range and digit validity
'How many values can n bits represent', 'largest number' or 'which is a valid octal number'.
n bits give different values.
They run from 0 to .
Octal digits are 0 to 7 only.
Hex digits are 0 to 9 and A to F only.
Each extra bit doubles the number of values.
How many different values can be represented by 8 bits?
Show solutionHide solution
Each bit has 2 choices, so the count is .
The largest value is one less: 255.
256 values (0 to 255)
Hex and binary conversions
A number with letters A to F, or 'hexadecimal equivalent'.
Turn each hex digit into a number (A = 10 to F = 15).
For hex to decimal, use digit × 16^position.
For binary to hex, group in 4s from the right.
Change each group back to a hex digit.
Hex is a short way to write binary, four bits at a time.
The binary number 11011011 in hexadecimal is...
Show solutionHide solution
Group in 4s: 1101 and 1011.
1101 is 13, which is D. 1011 is 11, which is B.
Largest values and anchors
'Largest 3-digit octal', 'FF in decimal' or 'value of 10000'.
Use the top digit in every place (7 for octal, F for hex).
Multiply out by the place values.
Or use the anchors: FF is 255, 777 in octal is 511.
Check by adding 1 to reach the next power.
Every base has one largest number for each number of digits.
What is the decimal value of the octal number 777?
Show solutionHide solution
7 × 64 = 448.
7 × 8 = 56, and 448 + 56 + 7 = 511.
511
Formula sheet
digit d_i at position i (from 0, rightmost), base b
read remainders bottom to top
group binary from the RIGHT; pad with leading zeros
Shortcuts that save time
Octal uses 3-bit groups. Hex uses 4-bit groups. Both start from the right. Pad the left with zeros. No division is needed.
Write 11010111 in octal.
Show solutionHide solution
Group from the right: 011 010 111.
Read each group: 3, 2, 7.
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. So FF = 15 × 16 + 15 = 255, which is 11111111.
Find the decimal value of C8 in hex.
Show solutionHide solution
C is 12.
12 × 16 + 8 = 200.
200
Memorise 1, 2, 4, 8, 16, 32, 64, 128. Then binary to decimal means adding the places that hold a 1.
Convert 111010 to decimal.
Show solutionHide solution
The 1s are at 32, 16, 8 and 2.
32 + 16 + 8 + 2 = 58.
58
Mistakes to avoid
Where most students lose marks on this subtopic.
Reading the remainders from top to bottom.
Read the remainders from bottom to top.
Counting positions from 1 instead of 0.
The rightmost digit is position 0. Its value is digit × 1.
Grouping bits from the left.
Group from the right and pad the left with zeros.
Using 3-bit groups for hex or 4-bit groups for octal.
Octal is 3 bits per digit. Hex is 4 bits per digit.
Treating F as 16.
F is 15. That is why FF is 255.
Accepting 8 or 9 in an octal number.
Octal digits stop at 7. Such an option is wrong.
Quick revision
Read this the night before the exam.
Bases: binary 2 (0, 1), octal 8 (0 to 7), decimal 10, hex 16 (0 to 9, A to F).
To decimal: digit × base^position, positions from 0 at the right.
From decimal: divide by the base, read remainders bottom to top.
Octal is 3-bit groups. Hex is 4-bit groups. Group from the right.
F = 15. FF = 255. 8 bits give 256 values (0 to 255).
Octal has no 8 or 9. Hex has nothing after F.
Practice: 18 questions
Sets of 10, mixed across the question types above. Every answer has a step-by-step explanation.
Topic test · 10 questions
Suggested time 6 min · wrong answers go to your mistake notebook automatically.