

ASCII & Unicode
Unit 5 Summary - part 1



ASCII has 128 characters and 7 bits of binary.

An example of finding ASCII codes.




Unicode is invented because ASCII doesn't support these:
1. Other languages' writings.
2. Vowels & consonants accents.
3. icons, emoticons, emojis
Every letter we type can be ASCII or Unicode.
ASCII is included in Unicode, that's why Python uses Unicode.


To find a character's Unicode, use ord on Python:
​
Character = input("Enter a single character: ")
if len(Character)>1:
Character = Character[0]
print("the character", Character, "has the ASCII or Unicode value", ord(Character))
​
​
To find a Unicode's character, use chr on Python:
Code = input("Enter a Unicode value: ")
Code = int(Code)
print("The Unicode value", Code, "represents the character",chr(Code))

Oxford AQA IGCSE 2019

10.1.
The ASCII code of the character 'A' is 65 in decimal.
A memory location contains the binary pattern 1000101 This binary pattern is for an ASCII code.
What character does this binary pattern represent? [1 mark]
​
__________________________________________________________________________________
​
Answer:
Put the binary in this table:

Start calculating every top row that has 1 in it: 64+4+1 = 69
If A is 65, that means 69 is E.

10.2.
State two advantages of Unicode compared to ASCII. [2 marks]
​
__________________________________________________________________________________
​
Alternative answers:
-
Can represent more characters / can represent special characters
-
Can represent alphabets with lots of characters / can represent multiple/different alphabets;
-
Unlike ASCII, Unicode is consistent across countries;

Oxford AQA IGCSE 2020

11.1.
The ASCII character code for a is 1100001
Complete the table below to show how the string cab would be encoded as a bit pattern using ASCII. [2 marks]
​
__________________________________________________________________________________
​

Answers:
You don't need to calculate
"a" = 1100001
Always add from the right. To add 1, change the right 0 into 1, and change the end right to 0.
"b" = 1100010
​
The same goes to c. To add 1, change the right 0 into 1.
"c" = 1100011

11.2.
How many different characters can be encoded using ASCII? [1 mark]
​
__________________________________________________________________________________
​
Answers:
Normal ASCII only has 7 bits. The answer is 128. Remember this.
​
Because if you start creating this column:
Put all 1 in all columns, you'll get this calculation:
64+32+16+8+4+2+1 = 127 and one more character of index number 0, so it's 128.

Oxford AQA IGCSE Specimen Paper
1.6.
ASCII uses 7 bits to represent a character. How many different characters can be represented using ASCII? [1 mark]
​
Final Answer:
__________________________________________________________________________________
​
​
1.7.
How many extra bits would be needed to represent twice as many characters as ASCII can represent? [1 mark]
​
Final Answer:
__________________________________________________________________________________

Oxford AQA IGCSE Mock Paper
1.3.
The ASCII code of the letter ‘A’ is 65 in decimal.
What is the ASCII code of the letter ‘D’ in binary? [1 mark]
​
__________________________________________________________________________________

