A-Level Computer Science: Character Sets, Error Checking, Compression and Encryption

This material covers the coding side of data representation in A level Computer Science: how characters become numbers, how a receiver can tell that bits were damaged on the way, how data is made smaller, and how it is hidden from anyone without the key. It is for Year 12 and Year 13 students who want practice on the short calculations and explanations these topics bring.

The quiz has twelve questions and gives every piece of data inside the question. It starts with character codes: the difference between the character '7' and the number 7, the one-bit difference between a capital and a lower-case letter in ASCII, and why Unicode was needed. Four questions deal with errors: finding the byte that breaks even parity, decoding bits sent three times by majority voting, calculating a product-code check digit with alternating weights of 1 and 3, and following a checksum that catches a corrupted value. Two compression questions encode a row with run-length encoding and a sentence with a small dictionary. The last three are about encryption: decrypting a Caesar cipher, encrypting a byte with a Vernam key using XOR, and the exact conditions under which a one-time pad is perfectly secure.

Every explanation shows the working (counting 1s, the weighted sum, each shifted letter, each XORed bit) and says what the tempting wrong answer missed.

The flashcards cover ASCII, Unicode, character codes of digits, parity, majority voting, checksums, check digits, lossless and lossy compression, run-length and dictionary methods, the vocabulary of ciphers, why a Caesar cipher is weak, the Vernam cipher and computational security.

The written work has eight longer tasks to answer on paper: comparing ASCII with Unicode, setting a parity bit and explaining what parity cannot do, comparing majority voting, checksums and check digits, encoding a string with run-length encoding and judging when it helps, choosing lossy or lossless compression for three kinds of file, encrypting with a Caesar shift and explaining how it is broken, a full Vernam encryption and decryption, and comparing perfect with computational security. Each task has a model answer and the points a marker would look for.

There is also a short oral practice with an examiner, who gives all the data in each question, asks one question at a time and gives brief feedback at the end.

The content is based on the information coding, compression and encryption sections of the A level specifications, for example AQA 7517 sections 4.5.5 and 4.5.6 (including the Caesar and Vernam ciphers) and OCR H446 section 1.3.1 and 1.4.1 (run-length and dictionary coding, ASCII and Unicode).

  • Distinguish the character code of a digit from its pure binary value
  • Explain ASCII and Unicode and why Unicode was introduced
  • Apply parity, majority voting, checksums and check digits to given data
  • Encode data with run-length and dictionary-based compression
  • Compare lossy and lossless compression for different kinds of file
  • Encrypt and decrypt with Caesar and Vernam ciphers and explain perfect and computational security

Practice material written by Zestly, based on the information coding, compression and encryption content of the A level Computer Science specifications (for example AQA 7517 sections 4.5.5 and 4.5.6, OCR H446 sections 1.3.1 and 1.4.1).

Sample question

How is the digit 7 stored as an ASCII character, compared with the number 7 stored in 8-bit pure binary?

See the answer

Character 00110111, number 00000111

The character '7' has the ASCII code 55, which is 00110111; the digit characters '0' to '9' have codes 48 to 57. The number 7 in pure binary is 00000111. The two bit patterns differ, which is why a digit typed as text has to be converted before arithmetic.

← Computer Science

↑ A-Level