Skip to content

9618 · 1.1

Data Representation — practice questions

Practice and worked examples for 9618 Data Representation. Short previews only — attempt the full question in MarkScheme against the official scheme.

Worked example 1

A computer stores a positive integer as an 8-bit binary number. Convert the denary number 173 into: (i) 8-bit binary, and (ii) hexadecimal.

Show solution outline

(i) To convert 173 to binary, we find the largest power of 2 that fits into it and work down. Place values: 128, 64, 32, 16, 8, 4, 2, 1

173 - 128 = 45. So, we have a 1 in the 128s place. 1....... 45 is less than 64. So, a 0 in the 64s place. 10...... 45 - 32 = 13. So, a 1 in the 32s place. 101..... 13 is less than 16. So, a 0 in the 16s place. 1010.... 13 - 8 = 5. So, a 1 in the 8s place. 10101... 5 - 4 = 1. So, a 1 in the 4s place. 101011.. 1 is less than 2. So, a 0 in the 2s place. 1010110. 1 - 1 = 0. So, a 1 in the 1s place. 10101101

Answer (i): 10101101

(ii) To convert to hexadecimal, we split the 8-bit binary number into two 4-bit nibbles. 1010 | 1101

Convert each nibble to denary/hex: 1010₂ = (8 + 2) = 10₁₀ = AA₁₆ 1101₂ = (8 + 4 + 1) = 13₁₀ = DD₁₆

Combine the two hex digits.

Answer (ii): AD₁₆

Worked example 2

Represent the denary number -58 as an 8-bit two's complement binary number.

Show solution outline
  1. Find the 8-bit binary for +58: Place values: 128, 64, 32, 16, 8, 4, 2, 1 58 = 32 + 16 + 8 + 2 So, +58 is 00111010₂.
  2. Invert the bits (One's Complement): 00111010 becomes 11000101.
  3. Add 1: 11000101
  •    1
    

11000110

Answer: 11000110

Verification (optional but good practice): The MSB has a place value of -128. The other bits are positive. -128 + 64 + 4 + 2 = -128 + 70 = -58. The answer is correct.