OCR J277 GCSE Computer Science · 1.2 Memory and Storage

Stretch tasks Storing Characters: ASCII and Unicode

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

This or That

Pixel the cat asks 8 questions. Each has two answers: pick the right one.

  • Two answers to every question
  • A fish treat for every right answer
  • Streaks win Pixel shades, then a party hat

About 4 minutes

Task 3

Memory Match

Flip the cards two at a time to match each term card to its meaning card.

  • 12 cards: each term has a meaning
  • One peek at every card
  • Combo points for pairs found in a row

6 pairs, about 4 minutes

Task 4

Sort It

Sort each statement into the right box, like the tick-box tables in the exam.

  • 10 cards to sort into 3 boxes
  • Drag a card, tap a box or press its number
  • Combo points for cards sorted in a row

10 cards, about 4 minutes

The games need JavaScript. Every question is below, with the answers at the end.

Read the lesson: Storing Characters: ASCII and Unicode

Storing Characters: ASCII and Unicode: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. What is a character set?

    • A list of characters, each with a unique binary code
    • The fonts installed on a computer
    • The keys on a keyboard
    • A type of compression
  2. How many bits does standard ASCII use per character?

    • 16
    • 32
    • 7
    • 8
  3. If A is 65 in ASCII, what is the code for E?

  4. The character '5' is stored as the number 5.

    • True
    • False
  5. How many characters can standard ASCII represent?

    • Over a million
    • 128
    • 256
    • 65,536
  6. Which TWO are advantages of Unicode over ASCII?

    Tick 2.

    • It only needs 7 bits
    • It can represent almost every written language
    • It includes emoji and mathematical symbols
    • It makes text files smaller
    • It uses fewer bits per character
  7. The first 128 Unicode codes are the same as ASCII.

    • True
    • False
  8. Why are Unicode text files larger than ASCII ones?

    • Unicode stores every font
    • Unicode files cannot be compressed
    • Each character uses more bits
    • Unicode adds pictures to text
  9. If a is 97 in ASCII, what is the code for d?

  10. Extended ASCII uses 8 bits. How many characters does that give?

    • 512
    • 1,000
    • 256
    • 128
  11. Order these by bits per character, fewest first.

    Number these 1 to 3.

    • Extended ASCII
    • Unicode
    • ASCII
  12. Why must two computers use the same character set?

    • So they run the same operating system
    • So codes turn back into the same characters
    • So they can share a printer
    • So their files are the same size

Quiz Challenge, round 2: Quick Fire

  1. Explain why computers need a character set. [2 marks]

  2. A is 65 in ASCII. Calculate the ASCII code for the letter K and explain how you worked it out. [2 marks]

  3. Give one advantage and one disadvantage of Unicode compared with ASCII. [2 marks]

  4. In a program, "5" + "3" gives "53", but 5 + 3 gives 8. Explain why. [2 marks]

Quiz Challenge, round 3: Big Think

  1. A website lets customers from around the world write reviews. Explain why it should store text in Unicode rather than ASCII. [4 marks]

  2. Compare ASCII and Unicode. [6 marks]

This or That: tick the right answer

  1. Which can store a Chinese character?

    • Unicode
    • ASCII
  2. If Z is 90 in ASCII, what is Y?

    • 91
    • 89
  3. Which uses fewer bits for the same English text?

    • ASCII
    • Unicode
  4. What is the ASCII code for a space?

    • 0
    • 32
  5. Lower case a is 97. Is upper case A higher or lower?

    • Higher: it is 129
    • Lower: it is 65
  6. Is the character '7' the same as the number 7?

    • Yes: both are stored as 7
    • No: its ASCII code is 55
  7. Did Unicode make old ASCII text unreadable?

    • No: ASCII is its first 128 codes
    • Yes: it changed every code
  8. What must be agreed for a text message to arrive correctly?

    • The screen size
    • The character set

Memory Match: match each term to its meaning

TermMeaning
A ASCII1 8 bits, 256 characters
B Extended ASCII2 Characters with their unique binary codes
C Unicode3 Code 65 in ASCII
D Character set4 7 bits, 128 characters
E Character code5 16 or more bits, over a million characters
F A6 The number given to one character

Sort It: tick one box in each row

True of ASCII only, Unicode only, or both?

StatementASCII onlyUnicode onlyBoth
Covers English letters and basic symbols only
Stores A as code 65
Makes files larger for the same English text
Can store emoji
Uses 7 bits per character
Can store Chinese, Arabic and Greek
Stores characters in order, so B is one more than A
Gives each character a unique binary code
Uses 16 or more bits per character
Has exactly 128 characters
Answers

Round 1: Quiz Blitz

  1. A list of characters, each with a unique binary code Every character gets a number, and the number is stored in binary.
  2. 7 7 bits give 2 to the power 7 = 128 characters. Extended ASCII uses 8.
  3. 69 A 65, B 66, C 67, D 68, E 69. Count carefully: off by one is the classic slip.
  4. False The character '5' has ASCII code 53. That is why "5" + "3" gives "53".
  5. 128 7 bits give 128 codes. 256 is extended ASCII.
  6. It can represent almost every written language; It includes emoji and mathematical symbols Unicode covers over a million characters, but it uses more bits, so files are bigger.
  7. True So old ASCII text is still valid Unicode.
  8. Each character uses more bits 16 or more bits per character instead of 7 or 8.
  9. 100 a 97, b 98, c 99, d 100.
  10. 256 2 to the power 8 is 256.
  11. ASCII → Extended ASCII → Unicode 7 bits, then 8 bits, then 16 or more.
  12. So codes turn back into the same characters With different sets, every message would arrive as gibberish.

Round 2: Quick Fire

    • Computers only store binary, so each character is given a unique code
    • Devices must agree on the same set so text is shown correctly
    Model answer

    Computers can only store binary, so each character is given a unique binary code. Devices must agree on the same character set, or text sent from one would be shown as gibberish on another.

    • K is 75
    • Letters are in order, and K is 10 letters after A
    Model answer

    K is 75. Letters are stored in order, and K is 10 letters after A, so its code is 65 + 10 = 75.

    • Advantage: far more characters, so almost every language and emoji
    • Disadvantage: more bits per character, so larger files
    Model answer

    Advantage: Unicode can represent over a million characters, so it covers almost every written language. Disadvantage: it uses more bits per character, so text files are larger.

    • The quoted values are characters or strings, not numbers
    • So + joins them together: concatenation
    Model answer

    "5" and "3" are strings of characters, not numbers, so + joins them together, which is concatenation, giving "53". Without the quotes they are numbers, so + adds them to give 8.

Round 3: Big Think

    • ASCII uses 7 bits, so it only has 128 characters
    • ASCII only covers English and basic symbols
    • Unicode covers almost every written language, such as Chinese and Arabic
    • Unicode also has emoji
    • So names with accents are stored and displayed correctly
    Model answer

    ASCII uses 7 bits, so it only has 128 characters, which covers English and basic symbols only. Customers from around the world will write in many languages, such as Chinese, Arabic and Greek, and use accents in their names. Unicode can represent over a million characters, covering almost every written language and emoji too, so every review would be stored and displayed correctly.

    • ASCII uses 7 bits per character
    • ASCII has 128 characters
    • Extended ASCII uses 8 bits for 256 characters
    • Unicode uses 16 bits or more per character
    • Unicode has over a million characters, covering almost every language
    • Unicode files are larger for the same text
    • The first 128 Unicode codes are the same as ASCII
    Model answer

    ASCII uses 7 bits per character, so it can represent 128 characters: English letters, digits, punctuation and control characters. Extended ASCII uses 8 bits for 256 characters. Unicode uses 16 bits or more per character, so it can represent over a million characters, covering almost every written language as well as emoji. The first 128 Unicode codes are the same as ASCII, so ASCII text is still valid. The drawback of Unicode is that it uses more bits per character, so the same text gives larger files that need more storage and bandwidth.

This or That

  1. Unicode ASCII's 128 characters cover English only. Unicode covers almost every writing system.
  2. 89 Y comes just before Z, so it is one less.
  3. ASCII ASCII needs 7 bits a character. Unicode needs 16 or more.
  4. 32 A space is a character too, with code 32.
  5. Lower: it is 65 Upper case letters come first in ASCII: A is 65 and a is 97.
  6. No: its ASCII code is 55 The digit characters start at 48 for '0', so '7' is 55.
  7. No: ASCII is its first 128 codes Unicode kept ASCII's codes, so ASCII text is still valid.
  8. The character set Both devices must turn the same codes into the same characters.

Memory Match

  • A 4 ASCII: 7 bits, 128 characters
  • B 1 Extended ASCII: 8 bits, 256 characters
  • C 5 Unicode: 16 or more bits, over a million characters
  • D 2 Character set: Characters with their unique binary codes
  • E 6 Character code: The number given to one character
  • F 3 A: Code 65 in ASCII

Sort It

  1. ASCII only Covers English letters and basic symbols only That is ASCII's big limit, and the reason Unicode was created.
  2. Both Stores A as code 65 Unicode's first 128 codes are the same as ASCII.
  3. Unicode only Makes files larger for the same English text More bits for every character means a bigger file.
  4. Unicode only Can store emoji Emoji are in Unicode, not ASCII.
  5. ASCII only Uses 7 bits per character Standard ASCII uses 7 bits. Unicode uses 16 or more.
  6. Unicode only Can store Chinese, Arabic and Greek Unicode covers almost every writing system.
  7. Both Stores characters in order, so B is one more than A Both keep letters in a logical order, which is why you can count on from A.
  8. Both Gives each character a unique binary code Every character set does that.
  9. Unicode only Uses 16 or more bits per character More bits per character is how Unicode fits so many in.
  10. ASCII only Has exactly 128 characters 2 to the power 7 is 128. Unicode has over a million.