Data Representation and Multimedia: Question 2

Syllabus 1.1, 1.2, 1.3

Structured AS 6 marks

A payroll system stores employee reference numbers and displays employee names using a character set.

(a) Convert the denary number 259 to Binary Coded Decimal (BCD). Show the 4-bit binary code for each denary digit separately. [2]

(b) The system originally stored each employee name using the standard 7-bit ASCII code. State how many bits this uses per character, and calculate the maximum number of different characters that 7-bit ASCII can represent. [2]

(c) The payroll system is updated so that employee names can include Chinese and Arabic characters as well as English characters, all within the same document. Explain why Unicode is more suitable than extended (8-bit) ASCII for this purpose. [2]

Show worked solution Hide worked solution

Worked solution

Part (a): Converting 259 to BCD

BCD encodes each denary digit separately as its own 4-bit binary group (0000 to 1001), rather than converting the whole number to ordinary binary.

259 has three digits: 2, 5 and 9.

  • Digit 2 -> 0010
  • Digit 5 -> 0101
  • Digit 9 -> 1001

Writing the three 4-bit groups in order gives the BCD code:

0010 0101 1001

[2 marks]: [1] for all three digits correctly converted to 4-bit binary groups, [1] for the groups placed in the correct order (hundreds, tens, units) with correct 4-bit padding on each.

Part (b): 7-bit ASCII capacity

Standard ASCII uses 7 bits per character.

With 7 bits, the number of different bit patterns, and so the number of different characters that can be represented, is:

2^7 = 2 x 2 x 2 x 2 x 2 x 2 x 2 = 128

So 7-bit ASCII can represent a maximum of 128 different characters. [2 marks]: [1] for stating 7 bits, [1] for the correct calculated value 128.

Part (c): Why Unicode suits multilingual text

Extended ASCII uses 8 bits per character, giving only 256 possible codes in total. That is enough for the basic Latin alphabet plus one extra set of symbols or accented letters, but nowhere near enough to hold separate codes for Chinese characters, Arabic script and English letters all at once. Different extended ASCII “code pages” would be needed for each language, and a single document could not correctly mix them.

Unicode instead uses a much larger set of code points (built from more bits, using encoding schemes such as UTF-8 and UTF-16), large enough to give every character in every major world script its own unique, unambiguous code. This means Chinese, Arabic and English characters can all be represented correctly within the same character set, and so within the same document, which is exactly what the updated payroll system needs.

[2 marks]: [1] for identifying that Unicode has far more code points/uses more bits than extended ASCII, [1] for linking this to being able to represent multiple different scripts/languages within a single document.

Final answers

  • (a) 0010 0101 1001
  • (b) 7 bits; 128 characters
  • (c) Unicode has far more code points than extended ASCII, so it can represent characters from multiple different scripts (e.g. Chinese, Arabic, English) within the same document, which 256-code extended ASCII cannot.