ExamShortcut

Hardware, Memory & Number Systems

🔒 Log in to track
high importance7 formulas⚡ 14 shortcuts6 subtopics
All subtopics·Subtopic 3 of 6

Number systems: binary, octal, decimal, hexadecimal

🔒 Log in to track
⏱ 5 min read🧩 6 question types🎯 18 practice Q
The idea in one minute

A 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.

01

The four systems

The base is the number of different digits the system uses.

SystemBaseDigitsExample
Binary20, 11101
Octal80 to 765
Decimal100 to 991
Hexadecimal160 to 9, A to F2F

In hexadecimal, A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.

02

Any base to decimal

Each digit is worth digit × base^position. Count positions from 0 at the right.

(1101)2=1×8+1×4+0×2+1×1=13(1101)_2 = 1\times8 + 1\times4 + 0\times2 + 1\times1 = 13
  • (2F)16=2×16+15=47(2F)_{16} = 2\times16 + 15 = 47.
  • (67)8=6×8+7=55(67)_8 = 6\times8 + 7 = 55.

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.

03

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:

  1. 45 ÷ 2 = 22, remainder 1.
  2. 22 ÷ 2 = 11, remainder 0.
  3. 11 ÷ 2 = 5, remainder 1.
  4. 5 ÷ 2 = 2, remainder 1.
  5. 2 ÷ 2 = 1, remainder 0.
  6. 1 ÷ 2 = 0, remainder 1.

Reading upward gives (101101)2(101101)_2. Check: 32 + 8 + 4 + 1 = 45.

04

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.

  • (1101011)2(1101011)_2 becomes 001 101 011, which is 1, 5, 3. So it is (153)8(153)_8.
  • (11011011)2(11011011)_2 becomes 1101 1011, which is D, B. So it is (DB)16(DB)_{16}.

Rule: Octal uses 3-bit groups. Hex uses 4-bit groups. Always start from the right.

05

Ranges and valid digits

n bits hold 2n2^n different values, from 0 to 2n−12^n - 1. 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.
06

More worked pairs

Use these as anchors to test your answers.

  • (1010)2=8+2=10(1010)_2 = 8 + 2 = 10.
  • (1111)2=8+4+2+1=15(1111)_2 = 8 + 4 + 2 + 1 = 15.
  • (255)10=15×16+15=(FF)16(255)_{10} = 15\times16 + 15 = (FF)_{16}.
  • (128)10=(10000000)2(128)_{10} = (10000000)_2.
  • (100)8=64(100)_8 = 64, (20)16=32(20)_{16} = 32, (11)2=3(11)_2 = 3.
  • (10000)2=16(10000)_2 = 16, because only the 16 place holds a 1.
  • (777)8=7×64+7×8+7=511(777)_8 = 7\times64 + 7\times8 + 7 = 511.
07

Quick checks on the options

Strike out options before you calculate.

  1. An option with 8 or 9 is never octal.
  2. An option with G or beyond is never hexadecimal.
  3. 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.

08

Question types you will see

Each type: how to recognise it, the method step by step, and one question to try.

Type 1very common4 practice Q

Any base to decimal

How to spot it:

'Decimal value of', 'equivalent decimal' or a number written with a subscript base.

Method
  1. Write the position of each digit, from 0 at the right.

  2. Multiply each digit by base^position.

  3. For hex, change letters to numbers first (A = 10 to F = 15).

  4. Add the products.

Why it works:

Each place is worth a power of the base.

Try this

The decimal value of the binary number 110101 is...

Show solution
  1. The 1s sit at 32, 16, 4 and 1.

  2. 32 + 16 + 4 + 1 = 53.

Answer

53

Type 2very common4 practice Q

Decimal to any base

How to spot it:

'Binary equivalent of', 'convert decimal to octal' or 'to hex'.

Method
  1. Divide the number by the target base.

  2. Write the remainder. Divide the quotient again.

  3. Stop when the quotient is 0.

  4. Read the remainders bottom to top.

Why it works:

Each remainder is one digit of the new number, starting from the right.

Try this

The binary equivalent of decimal 45 is...

Show solution
  1. The remainders in order are 1, 0, 1, 1, 0, 1.

  2. Read them upward: 101101.

  3. Check: 32 + 8 + 4 + 1 = 45.

Answer

101101

Type 3very common2 practice Q

Binary to octal or hex by grouping

How to spot it:

'Binary number in octal' or 'in hexadecimal'.

Method
  1. Octal: group bits in 3s from the right. Hex: group in 4s.

  2. Pad the left with zeros.

  3. Convert each group to one digit.

  4. For hex, write 10 to 15 as A to F.

Why it works:

One octal digit is exactly 3 bits. One hex digit is exactly 4 bits.

Try this

The binary number 1101011 in octal is...

Show solution
  1. Group in 3s from the right: 001 101 011.

  2. The groups are 1, 5 and 3.

Answer

(153)8(153)_8

Type 4common3 practice Q

n-bit range and digit validity

How to spot it:

'How many values can n bits represent', 'largest number' or 'which is a valid octal number'.

Method
  1. n bits give 2n2^n different values.

  2. They run from 0 to 2n−12^n - 1.

  3. Octal digits are 0 to 7 only.

  4. Hex digits are 0 to 9 and A to F only.

Why it works:

Each extra bit doubles the number of values.

Try this

How many different values can be represented by 8 bits?

Show solution
  1. Each bit has 2 choices, so the count is 282^8.

  2. The largest value is one less: 255.

Answer

256 values (0 to 255)

Type 5common

Hex and binary conversions

How to spot it:

A number with letters A to F, or 'hexadecimal equivalent'.

Method
  1. Turn each hex digit into a number (A = 10 to F = 15).

  2. For hex to decimal, use digit × 16^position.

  3. For binary to hex, group in 4s from the right.

  4. Change each group back to a hex digit.

Why it works:

Hex is a short way to write binary, four bits at a time.

Try this

The binary number 11011011 in hexadecimal is...

Show solution
  1. Group in 4s: 1101 and 1011.

  2. 1101 is 13, which is D. 1011 is 11, which is B.

Answer

(DB)16(DB)_{16}

Type 6occasional

Largest values and anchors

How to spot it:

'Largest 3-digit octal', 'FF in decimal' or 'value of 10000'.

Method
  1. Use the top digit in every place (7 for octal, F for hex).

  2. Multiply out by the place values.

  3. Or use the anchors: FF is 255, 777 in octal is 511.

  4. Check by adding 1 to reach the next power.

Why it works:

Every base has one largest number for each number of digits.

Try this

What is the decimal value of the octal number 777?

Show solution
  1. 7 × 64 = 448.

  2. 7 × 8 = 56, and 448 + 56 + 7 = 511.

Answer

511

09

Formula sheet

Positional value
N=∑di⋅biN = \sum d_i \cdot b^{i}

digit d_i at position i (from 0, rightmost), base b

Decimal to base b
N=(…r2r1r0)b from repeated division by bN = (\ldots r_2 r_1 r_0)_b\ \text{from repeated division by } b

read remainders bottom to top

Grouping shortcuts
1 octal digit↔3 bits,1 hex digit↔4 bits1\ \text{octal digit} \leftrightarrow 3\ \text{bits},\quad 1\ \text{hex digit} \leftrightarrow 4\ \text{bits}

group binary from the RIGHT; pad with leading zeros

10

Shortcuts that save time

⚡ 3 and 4 grouping

Octal uses 3-bit groups. Hex uses 4-bit groups. Both start from the right. Pad the left with zeros. No division is needed.

Example

Write 11010111 in octal.

Show solution
  1. Group from the right: 011 010 111.

  2. Read each group: 3, 2, 7.

Answer

(327)8(327)_8

⚡ Hex letter wheel

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. So FF = 15 × 16 + 15 = 255, which is 11111111.

Example

Find the decimal value of C8 in hex.

Show solution
  1. C is 12.

  2. 12 × 16 + 8 = 200.

Answer

200

⚡ Power-of-2 positions

Memorise 1, 2, 4, 8, 16, 32, 64, 128. Then binary to decimal means adding the places that hold a 1.

Example

Convert 111010 to decimal.

Show solution
  1. The 1s are at 32, 16, 8 and 2.

  2. 32 + 16 + 8 + 2 = 58.

Answer

58

11

Mistakes to avoid

Where most students lose marks on this subtopic.

Mistake 01

Reading the remainders from top to bottom.

Read the remainders from bottom to top.

Mistake 02

Counting positions from 1 instead of 0.

The rightmost digit is position 0. Its value is digit × 1.

Mistake 03

Grouping bits from the left.

Group from the right and pad the left with zeros.

Mistake 04

Using 3-bit groups for hex or 4-bit groups for octal.

Octal is 3 bits per digit. Hex is 4 bits per digit.

Mistake 05

Treating F as 16.

F is 15. That is why FF is 255.

Mistake 06

Accepting 8 or 9 in an octal number.

Octal digits stop at 7. Such an option is wrong.

12

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.

13

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.