Question bank › GCSE › GCSE Computer Science › Memory and storage

Characters: ASCII and Unicode

10 questions41 marksabout 50 min

Answer on paper first, then reveal the mark scheme one mark at a time.

1Grade 6–75 marks

The ASCII code for the character D is 68, which is stored as 01000100 in 8-bit ASCII.

(a) State the 8-bit binary code for the character G. [1]

(b) State what is meant by a character set. [1]

(c) A text file contains 2 000 characters. Calculate the size of the file, in kilobytes, if each character is stored using 16-bit Unicode. Show your working. [2]

(d) Explain why Unicode is used instead of ASCII for a website that is read in many countries. [1]

2Grade 1–33 marks

In ASCII the lower-case letter a has the denary code 97, stored as 01100001 in 8 bits.

(a) State the denary ASCII code for the letter c. [1]

(b) State the 8-bit binary ASCII code for the letter b. [1]

(c) A student types a smiley-face emoji into a message. State why this character cannot be stored using ASCII. [1]

3Grade 1–33 marks

A character set gives every character a unique binary code. The number of bits used for each code limits how many characters the set can hold.

(a) A small character set uses 5 bits per character. Calculate the maximum number of different characters it can represent. [1]

(b) The original version of ASCII used 7 bits per character. State the number of characters this allows. [1]

(c) Describe the effect on the size of a text file if the number of bits used for each character is doubled. [1]

Stuck on Characters: ASCII and Unicode?

Get it sorted in a free 30-minute session

We work through your weakest questions on this topic on Zoom. I reply the same day.

4Grade 4–54 marks

A text message contains 150 characters.

(a) Calculate the size of the message in bytes if it is stored using 8-bit ASCII. [1]

(b) The same message is instead stored using a version of Unicode that uses 32 bits per character. Calculate the size of the message in bytes. Show your working. [2]

(c) State how many times larger the Unicode version is than the ASCII version. [1]

5Grade 4–54 marks

Character codes in ASCII are logically ordered. The upper-case letter M has the denary code 77 and the lower-case letter m has the denary code 109.

(a) State the denary ASCII code for the upper-case letter P. [1]

(b) Give the 8-bit binary ASCII code for the upper-case letter P. [1]

(c) A program needs to convert any upper-case letter into its lower-case version. Using the codes given above, describe how the program can do this. [2]

6Grade 4–54 marks

A vending machine display uses its own 4-bit character set. Part of the character set is shown in the diagram.

(a) The display receives the codes 0111 0100 1011 1100. State the word that is shown. [1]

(b) State the maximum number of characters this character set can hold. [1]

(c) The manufacturer wants to add all 26 upper-case letters, the 10 digits and a space to the character set. Explain, with a calculation, the minimum number of bits per character that would be needed. [2]

Part of the 4-bit character setCodeCharacterCodeCharacter0100E0101F0110G0111H1000I1001J1010K1011L1100M1101N
7Grade 6–74 marks

A company saves a document containing Greek and Arabic text. When a colleague opens the file in a program that only understands ASCII, the Greek and Arabic letters appear as question marks.

(a) Explain why the Greek and Arabic letters are not displayed correctly. [2]

(b) The document is re-saved using Unicode and displays correctly. Give one disadvantage of storing the document in Unicode rather than ASCII. [1]

(c) State one similarity between ASCII and Unicode. [1]

8Grade 6–74 marks

The function ASC(c) returns the ASCII code of a character and CHR(n) returns the character with ASCII code n. In ASCII, upper-case letters have consecutive codes from A = 65 to Z = 90.

word = input()
output = ""
for i = 0 to word.length - 1
    code = ASC(word[i]) + 2
    output = output + CHR(code)
next i
print(output)

(a) State the output when the user enters CAB. [1]

(b) State the denary value of code when the character being processed is Y. [1]

(c) Explain why the program does not produce a letter for the input Y. [2]

9Grade 6–75 marks

A games company designs its own character set for in-game chat. It needs to represent 500 different characters, including letters, accented letters and emojis.

(a) Calculate the minimum number of bits needed for each character code. Show your working. [2]

(b) The company decides to store each character in a whole number of bytes. State the number of bytes used per character. [1]

(c) A chat log contains 1 200 characters. Calculate the size of the chat log in kilobytes using your answer to (b). [2]

10Grade 8–95 marks

A program sorts a list of names into alphabetical order by comparing the ASCII codes of their characters, starting with the first character. The list ["banana", "Cherry", "apple"] is sorted and the result is ["Cherry", "apple", "banana"].

In ASCII, A = 01000001 and a = 01100001.

(a) Explain why Cherry is placed before apple even though C comes after a in the alphabet. [2]

(b) Describe how the program could be changed so that the names are sorted in true alphabetical order. [1]

(c) Using the two binary codes given, explain how a single bit distinguishes an upper-case letter from its lower-case version in ASCII. [2]

Stuck on this topic?

Book a free 30-minute session on WhatsApp and we'll find exactly which step is costing you the marks. Or build a timed paper on it.

Free 30-minute session