levo

Data Types and Number Representation

Character sets: ASCII and Unicode

  • 1 thing to know
  • Component 01
Start revising · £5/month

Overview

Recall questions on character sets, standard and extended ASCII, control codes, working out codes and sorting by code, character digits versus numbers, why Unicode was needed, UTF-8, storage costs, and garbled text between machines.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Numbers

What is a character set, and how do ASCII and Unicode differ?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a character set?

    Model answer

    An agreed table that maps every character to a unique binary code number. It lets text be stored and transmitted as numbers, and because the mapping is a published standard, a file written on one machine is read as the same characters on another. If two systems assume different character sets the same bytes come out as different symbols, which is why text can appear as garbage.

  2. 2

    How many bits does standard ASCII use, and how many characters does that give?

    Model answer

    Seven bits, giving 2 to the power 7 = 128 different codes, numbered 0 to 127. In practice each character is stored in a whole byte with the eighth bit set to zero, or historically used as a parity bit for error detection.

  3. 3

    What is extended ASCII?

    Model answer

    A version that uses all eight bits of the byte, giving 256 codes. The first 128 are the same as standard ASCII and the extra 128 hold additional symbols such as accented letters and box-drawing characters. The problem is that several incompatible versions of the upper half existed, so the same byte meant a different character depending on which national variant the machine was using.

  4. 4

    What is in the first 32 codes of ASCII?

    Model answer

    Control characters rather than printable symbols. They are instructions to the receiving device, such as carriage return, line feed, tab, backspace and the bell. They date from teleprinters, and several are still in everyday use, since a text file's line endings are control characters.

  5. 5

    The letter 'A' has ASCII code 65. What is the code for 'K', and how did you work it out without a table?

    Model answer

    75. The upper case letters are in alphabetical order with consecutive codes, and K is the eleventh letter, so it is ten places after A. 65 + 10 = 75. The same trick works for lower case, where 'a' is 97, and for digits, where the character '0' is 48.

  6. 6

    Why is it useful that the ASCII codes for the letters run in an unbroken alphabetical sequence?

    Model answer

    It means text can be sorted alphabetically by comparing code numbers, with no lookup table needed, and it means you can test whether a character is a letter by checking whether its code lies between the codes for A and Z. It also makes arithmetic on characters meaningful, such as adding a fixed amount to shift a letter along the alphabet, which is how a Caesar cipher is implemented.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Data Types and Number Representation, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.