• Practice
  • About 14 min
  • 5 practice questions

Number-system traps and a mixed problem set

Avoid the common slips with invalid digits, grouping, complements and bit counts, then work a mixed set of exam-style problems.

If something looks wrong, please tell us.

Most marks lost in number-system questions come from a small set of avoidable slips, not from hard mathematics. This lesson lists the traps and then works mixed problems so that you can practise spotting them before they cost you.

The traps

  • Invalid digits. A binary number cannot contain 2 or more; an octal number cannot contain 8 or 9; a hexadecimal number may use only 0 to 9 and A to F.
  • Grouping from the wrong side. For whole numbers group bits in threes (octal) or fours (hex) starting at the right, and pad with zeros on the left. In the fractional part, group starting from the point and pad zeros on the right.
  • Number of values or largest value. n bits give 2^n different values, but the largest unsigned value is 2^n minus 1.
  • Complements. The one's complement flips bits. The two's complement flips bits and adds 1.
  • Leading zeros. 0011 and 11 are the same value, but the width matters for complements.
  • Carry rules. In binary, 1 + 1 = 10 (write 0, carry 1) and 1 + 1 + 1 = 11 (write 1, carry 1).

Mixed worked problems

Problem 1. Convert 10110111 to octal. Group in threes from the right and pad on the left: 010 110 111, which is 2, 6, 7. The octal number is 267. Check in decimal: 2 × 64 + 6 × 8 + 7 = 128 + 48 + 7 = 183, and the binary 10110111 is 128 + 32 + 16 + 4 + 2 + 1 = 183. In hexadecimal the same number is 1011 0111, which is B7: 11 × 16 + 7 = 183.

Problem 2. Add 1100 and 111 in binary. Align on the right: 1100 + 0111. Column by column from the right: 0 + 1 = 1; 0 + 1 = 1; 1 + 1 = 10, write 0 carry 1; 1 + 0 + carry 1 = 10, write 0 carry 1; the final carry gives 1. The sum is 10011. Check: 12 + 7 = 19 and 10011 = 16 + 2 + 1 = 19.

Problem 3. How many bits are needed to give a different code to each of 1000 items? 2^9 = 512 is too small and 2^10 = 1024 is enough, so 10 bits are needed.

Problem 4. What is the largest unsigned number with 5 bits, and how many values are possible? Five ones is 11111 = 2^5 minus 1 = 31, and there are 2^5 = 32 values (0 to 31).

Check the digits, check the grouping, and always verify the answer by converting back to decimal.

A five-step checking routine

  • Is every digit legal for the stated base?
  • Did I group or carry from the correct side?
  • Is the answer in the right range for its bit count?
  • Does the answer have the right parity?
  • Can I convert back to decimal quickly to confirm?

Key takeaways. Most errors are about digit validity, grouping side, off-by-one in bit counts and the missing +1 in the two's complement. A five-second verification in decimal catches nearly all of them.

Check your understanding

  1. 1. Which of these is NOT a valid octal number?

    1. 7071
    2. 6400
    3. 3518
    4. 1234
    Show answer

    Answer: C. Octal digits are 0 to 7. 3518 contains an 8, so it is not valid.

  2. 2. Convert the binary number 10110111 to octal.

    1. 267
    2. 177
    3. 543
    4. 237
    Show answer

    Answer: A. Grouping in threes from the right with padding gives 010 110 111, which is 2, 6, 7: octal 267 (decimal 183).

  3. 3. How many bits are required to give a different code to each of 1000 items?

    1. 8
    2. 9
    3. 11
    4. 10
    Show answer

    Answer: D. 2^9 = 512 is less than 1000, while 2^10 = 1024 is enough. So 10 bits are needed.

  4. 4. Add 1100 and 111 in binary. What is the sum?

    1. 10001
    2. 10101
    3. 10011
    4. 11001
    Show answer

    Answer: C. 12 + 7 = 19, which is 16 + 2 + 1 = 10011. Column working: 0+1=1, 0+1=1, 1+1=10, 1+0+1=10, carry 1.

  5. 5. What is the largest unsigned number that can be stored in 5 bits?

    1. 32
    2. 31
    3. 30
    4. 16
    Show answer

    Answer: B. Five ones equal 2^5 minus 1 = 31. There are 32 different values from 0 to 31.

Sign in to keep track of the lessons you finish.

Next lesson → Final self-assessment: number systems

Privacy · Terms · Refunds · Delivery