ASCII & Unicode

Computer Science: OCR GCSE, topic 1.2.25

American Standard Code for Information Interchange

The American Standard Code for Information Interchange (ASCII) character set is the most common character set.

7-bit

7-bit

  • Initially, each character in ASCII was represented by a seven-bit binary code.
  • That means there was a maximum of 128 characters.
  • This was enough to include all commonly used letters and symbols in the English language.
  • When each letter is represented by seven bits, an 8-bit system can use the extra bit as a check digit.
8-bit

8-bit

  • An extended ASCII uses all 8 bits.
  • The additional bit allows for an extra 128 characters to be represented.
  • With that extension, most Western languages can use the same character set.
  • Note: In your exam, the representation of ASCII will use 8 bits.

Unicode

Unicode is a character set which was released because of the need to standardise character sets internationally.

Unicode

Unicode

  • Unicode aims to represent every possible character in the world.
  • The most common form of Unicode is UTF-8 and uses between eight and 32 bit binary codes to represent each character.
Compatability

Compatability

  • The first 256 characters in Unicode are identical to extended ASCII, which makes it backwards compatible with documents encoded using older character sets.
  • Characters may not be recognised or displayed correctly if the computer it is being read on is using a different character set from the computer it was created on.
Types of characters

Types of characters

  • Unicode represents characters from all major alphabets of the world.
  • Unicode is also used to represent emojis!

Logical Ordering

Both ASCII and Unicode store characters in a logical, numerical order.

ASCII - example

ASCII - example

  • Denary
  • 'A' = 65
  • 'B' = 66
  • 'a' = 97
  • 'b' = 98
  • Hex
  • 'A' = 41
  • 'B' = 42
  • 'a' = 61
  • 'b' = 62
Unicode - examples

Unicode - examples

  • 'A' = U+0391
  • 'B' = U+0392
  • 'a' = U+0061
  • 'b' = U+0062
Notes

Notes

  • The codes for uppercase letters are different from the codes for lowercase letters.
  • The character for 'B' will be one more than the character code for 'A', and so on.

Test yourself on ASCII & Unicode

  • Why are the first 256 characters in Unicode identical to extended ASCII?

  • What characters are supported by Unicode?

  • Which of these can be represented using Unicode?

Practise this topic for free