levo

Data Types and Number Representation

Character sets: ASCII and Unicode

  • 1 thing to know
  • Component 01

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.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

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

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

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

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

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

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

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.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

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