Level:
Correct: 0
Incorrect: 0
Marks: 0/0
Exam Practice
Course:
Topics:
OCR GCSE Computer Science (Paper 1) Smart practice A mixed round aimed at your weak spots
Unit 1
Systems architecture
Unit 2
Memory and storage
Unit 3
Computer networks, connections and protocols
Unit 4
Network security
Unit 5
Systems software
Unit 6
Ethical, legal, cultural and environmental impacts of digital technology
Avg
score:
–
Topics
done:
0/34

Characters and character sets

Practise 28 exam-style questions on Characters and character sets for OCR GCSE Computer Science (Paper 1). Write your answer as you would in the exam and get it marked in seconds against the mark scheme, point by point, with the Study Helper on hand if you get stuck.

  • 28 questions
  • 1–6 marks each
  • Instant marking
  • No sign-up needed
20 questions, marked as you go

Sample questions with model answers

Here are 4 of the questions in this topic, each with a model answer, an explanation of why it earns the marks and the mark scheme an examiner would use.

Question 1

1 mark

A new character set must be able to represent 40 different characters.

What is the minimum number of bits needed for each character?

Choose your answer.

  • 5
  • 6
  • 8
  • 40

Model answer

6

Explanation

Find the smallest n where 2ⁿ is at least 40. 2⁵ = 32 is too few, but 2⁶ = 64 is enough, so 6 bits are needed. 8 bits (as in ASCII) would work, but it is not the minimum.

Mark scheme
  1. 1 mark

    6

    5 bits give only 32 codes; 6 bits give 64. 8 bits would work but is not the minimum. More than one answer given = 0 marks

Question 2

2 marks

A program sorts names by comparing the ASCII codes of their letters, starting with the first letter.

The ASCII code for 'Z' is 90 and the ASCII code for 'a' is 97.

The program puts the name 'Zak' before the name 'amy'.

Explain why.

Model answer

The program compares the first letters, Z and a. The code for 'Z' is 90, which is lower than the code for 'a', 97, so 'Zak' is placed first. All the capital letters have lower codes than all the lowercase letters, so the program is sorting by code value rather than alphabetically.

Explanation

Computers compare text using the character codes. In ASCII the capital letters (65-90) all come before the lowercase letters (97-122), so any word starting with a capital comes before any word starting with a lowercase letter. This is why programs often convert text to one case before sorting.

Mark scheme
  1. 1 mark

    the first letters are compared and 'Z' (90) has a lower/smaller code than 'a' (97)

    must refer to the codes, not just the letters

  2. 1 mark

    (all) uppercase/capital letters have lower codes than (all) lowercase letters // the program sorts by code value, not alphabetically, so the case of the letter matters

    do not accept 'Z comes before a in the alphabet'

Question 3

3 marks

The table shows part of the ASCII character set. X and Y stand for missing values and ? stands for a missing character.

State the values of X and Y and the missing character.

Part of the ASCII character set. Table with columns "Character", "Denary code", "8-bit binary code". Character: d; Denary code: 100; 8-bit binary code: 01100100 | Character: g; Denary code: X; 8-bit binary code: Y | Character: ?; Denary code: 107; 8-bit binary code: 01101011.

Model answer

X: 'g' is 3 letters after 'd' (e, f, g), so X = 100 + 3 = 103.
Y: 103 = 64 + 32 + 4 + 2 + 1, so Y = 01100111.
Missing character: 107 is 7 more than 100 ('d'), and 7 letters after d is k, so the missing character is k.

Explanation

The lowercase letters have consecutive codes, so you can count on from the known code for 'd'. For Y, convert 103 to 8-bit binary; for the missing character, work out how far 107 is from a known code and count along the alphabet. Watch the case: 'k' and 'K' are different characters with different codes.

Mark scheme
  1. 1 mark

    X = 103

    'g' is 3 more than 'd' (100)

  2. 1 mark

    Y = 01100111

    the 8-bit binary for 103; must be 8 bits. Ecf: correct 8-bit conversion of an incorrect X

  3. 1 mark

    missing character = k (lowercase)

    107 is 7 more than 'd', and 7 letters after d is k. Do not accept a capital K - capital letters have different codes

Question 4

4 marks

Compare the ASCII and Unicode character sets.

In your answer, refer to the number of bits per character, the characters each can represent and the effect on file size.

Model answer

ASCII uses 7 bits per character (8 bits in extended ASCII), while Unicode uses more bits per character, such as 16 or 32. So ASCII can only represent 128 (or 256) characters, but Unicode can represent many thousands. ASCII covers mainly English letters, digits and punctuation, whereas Unicode can represent the characters of almost every language as well as symbols and emoji. Because Unicode uses more bits per character, the same text stored in Unicode gives a larger file than in ASCII - twice as large if Unicode uses 16 bits and ASCII 8.

Explanation

Each comparison point should say what is different about both character sets: bits per character, number of characters, range of languages and file size. The key link is that more bits per character allows more characters but makes files bigger. Writing only about one of the two character sets does not make a comparison.

Mark scheme
  1. 1 mark

    ASCII uses 7 bits (8 bits for extended ASCII) per character but Unicode uses more bits per character (16 / 32 / 16 or more)

    accept 'ASCII uses 8 bits' as stored in OCR exams; accept 'Unicode uses up to 32 bits'

  2. 1 mark

    ASCII can represent 128 (256 extended) characters but Unicode can represent many more (e.g. 65,536 with 16 bits / over a million)

  3. 1 mark

    ASCII covers mainly the English alphabet, digits and punctuation but Unicode can represent characters from (almost) all languages/alphabets, e.g. Chinese, Arabic, and symbols/emoji

  4. 1 mark

    the same text stored in Unicode takes more storage / gives a larger file than in ASCII (e.g. twice as large with 16 bits)

    'Unicode is bigger' on its own is not enough - must be the file size/storage

  5. 1 mark

    Unicode includes the ASCII characters // the first 128 Unicode codes are the same as ASCII

    max 4. A comparison needs both sides or a comparative word (more/fewer/larger)

Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.

Study Helper Hints first, answers after you try

Stuck on this one? Ask for a hint and I’ll point you in the right direction, without giving the answer away. Once you’ve checked your answer, I’ll show you how the marks are awarded.