Ch 1 · 1 Information Representation · AS & A Level Computer Science 9618

Topic 1 of 2 in Information Representation and Communication — AS & A Level Computer Science 9618 — 87 lessons.

Introduction

All data in a computer, numbers, text, images and sound, is stored as binary. At A Level you need to handle several number representations, explain exactly how images and sound are encoded, and choose suitable compression. (Syllabus topic 1: sections 1.1–1.3.)

Key ideas — 1.1 (a) Binary magnitudes and prefixes

Storage is often sold in decimal units (a "1 TB" drive is 10^12 bytes) while operating systems report binary units, which is why the drive appears as about 931 GiB.

🧑‍🏫 Teacher's explanation

Imagine you are measuring distance. In the metric system, 'kilo' always means exactly 1,000. This is like how decimal prefixes work in computing (kilo, mega, giga). However, computers don't think in powers of 10; they think in powers of 2. Because 2^10 (1024) is very close to 10^3 (1000), people used to use 'kilo' to mean 1024, which caused massive confusion.

📖 Definitions

🔍 Worked example — Easy

Convert 2^20 bytes into the appropriate binary prefix unit.

🔍 Worked example — Standard

A file is 5 imes 10^9 bytes. Calculate its size in decimal gigabytes (GB).

🔍 Worked example — Exam-style

A hard drive has a capacity of 2 TB. The operating system uses binary prefixes. Calculate the capacity in TiB (tebibytes) to 2 decimal places.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

Key ideas — 1.1 (b) Number systems and representations

Uses of hexadecimal: MAC addresses, colour codes, memory addresses and dumps, assembly language, error codes, URLs encoding: shorter and less error-prone than binary for humans.

🧑‍🏫 Teacher's explanation

Imagine you are organizing a massive library. If you label every book with a long string of 0s and 1s, it would take forever to read. Instead, you use a shorthand (Hexadecimal) to make it readable. If you want to represent money, you might want to treat every digit separately to avoid rounding errors (BCD), rather than treating the whole number as one big chunk.

📖 Definitions

🔍 Worked example — Easy

Convert the denary number 45_10 into Binary Coded Decimal (BCD).

🔍 Worked example — Standard

Perform the binary subtraction 1010_2 - 0110_2 using Two's Complement (4-bit).

🔍 Worked example — Exam-style

A computer uses 8-bit Two's Complement. Convert the denary number -53 into 8-bit binary.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

Key ideas — 1.1 (c) Binary arithmetic and overflow

🧑‍🏫 Teacher's explanation

Think of binary arithmetic like a car's odometer. If you are driving and the odometer only has 3 digits, once you hit 999 and drive one more mile, it rolls over to 000. The '1' that should have gone to the thousands place is lost because there is no slot for it. In computer science, we call this 'overflow'.

📖 Definitions

🔍 Worked example — Easy

Perform binary addition: 1011_2 + 0110_2.

🔍 Worked example — Exam-style

Using 8-bit signed two's complement, calculate 85_10 + 50_10 and determine if overflow occurs.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

(a) Convert the denary number -13 into 8-bit two's complement binary. [2] (b) Perform the addition of 10_10 and 5_10 using 8-bit two's complement. Show your working. [2] (c) Explain why the addition of 120_10 and 10_10 results in an overflow error in this 8-bit system. [2] [6 marks]

Key ideas — 1.1 (d) Character sets

Each character is represented by a binary code according to a character set:

🧑‍🏫 Teacher's explanation

Imagine you are organizing a massive international library. If you only have a small notebook with 128 slots, you can only store basic English words. This is like ASCII. If you get a slightly bigger notebook with 256 slots, you can add some accented letters for French or Spanish—this is Extended ASCII. But what if you want to store every single language in the world, including emojis? You need a massive, multi-volume encyclopedia. This is Unicode.

📖 Definitions

🔍 Worked example — Easy

A character set uses 7 bits per character. Calculate the total number of unique characters that can be represented.

🔍 Worked example — Standard

In a specific ASCII-based system, the character 'B' is represented by the denary value 66. Using the fact that characters are consecutive, determine the denary value for the character 'F'.

🔍 Worked example — Exam-style

A text file contains 500 characters. Each character is encoded using Unicode (UTF-8) where each character uses 2 bytes. Calculate the total file size in bytes.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

(a) Calculate the total number of unique characters that can be represented. [1] (b) Explain why a system would use Unicode instead of standard 7-bit ASCII. [2] [3 marks]

Key ideas — 1.2 (a) Bitmap images

A bitmap image is a grid of pixels; each pixel's colour is stored as a binary number.

🧑‍🏫 Teacher's explanation

Imagine a mosaic made of tiny square tiles. Each tile is a single 'pixel'. If you want to describe the whole mosaic to a friend, you can't just say 'it's a picture of a cat'; you have to tell them how many tiles wide and tall it is, and exactly what colour each individual tile is.

📖 Definitions

🔍 Worked example — Easy

Calculate the file size in bytes for a monochrome (1-bit) bitmap image with a resolution of 100 × 100 pixels.

🔍 Worked example — Standard

A bitmap image has a resolution of 800 × 600 pixels and a colour depth of 24 bits. Calculate the file size in Megabytes (MB). Assume 1 MB = 10^6 bytes.

🔍 Worked example — Exam-style

An image is increased from a colour depth of 8 bits to 16 bits. The resolution remains 1024 × 768. Calculate the percentage increase in file size.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

(a) Calculate the file size of this image in Megabytes (MB). (b) Explain one effect on the image quality if the colour depth was reduced to 1 bit. [3 marks]

Key ideas — 1.2 (b) Vector graphics

A vector graphic stores the image as a drawing list: a list of drawing objects (lines, circles, rectangles, curves, text), each with properties (coordinates, dimensions, line colour, fill colour, line thickness). The image is recalculated from these each time it is displayed.

🧑‍🏫 Teacher's explanation

Imagine you want to describe a simple red circle to a friend. You could give them a giant grid of tiny colored tiles and tell them exactly which tiles are red (this is like a bitmap). Or, you could simply say, "Draw a red circle with a radius of 5cm at the center of the page" (this is like a vector).

📖 Definitions

🔍 Worked example — Easy

Identify the three components required to define a single 'drawing object' in a vector graphic.

🔍 Worked example — Standard

A vector graphic contains a single circle. The drawing list stores the following: CIRCLE, CENTER(50,50), RADIUS(20), COLOR(BLUE). If the user scales the image by a factor of 2, what are the new coordinates of the center and the new radius?

🔍 Worked example — Exam-style

Compare a bitmap image and a vector graphic for a company logo that will be used on both a small business card and a massive roadside billboard. Which format is most appropriate and why?

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

(a) State whether the designer should use a bitmap or a vector format for the logo. [1] (b) Justify your answer in (a) by explaining the effect of scaling on the chosen format. [2] [3 marks]

Key ideas — 1.2 (c) Sound

Sound is an analogue signal (continuous). To store it as digital data, it is sampled:

🧑‍🏫 Teacher's explanation

Imagine you are trying to draw a smooth, curvy mountain range on a piece of graph paper. If you only draw a dot every 10cm, your drawing will look like a jagged, blocky mess. If you draw a dot every 1mm, your drawing will look almost exactly like the real mountain.

📖 Definitions

🔍 Worked example — Easy

Calculate the file size in bits for a mono sound recording with a sampling rate of 8000 Hz, a sampling resolution of 8 bits, and a duration of 5 seconds.

🔍 Worked example — Standard

A stereo sound file has a sampling rate of 44,100 Hz, a sampling resolution of 16 bits, and a duration of 10 seconds. Calculate the file size in Megabytes (MB). Assume 1 MB = 10^6 bytes.

🔍 Worked example — Exam-style

An engineer increases the sampling resolution from 8 bits to 16 bits while keeping the sampling rate and duration constant. Explain the effect on the file size and the sound quality.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

Key ideas — 1.3 Compression

Compression reduces file size, so files need less storage and transmit faster using less bandwidth (important for streaming and web pages).

🧑‍🏫 Teacher's explanation

Imagine you are sending a long text message to a friend. If you write "I am going to the park, I am going to the park, I am going to the park", it takes a long time to type and a lot of space. If you instead write "I am going to the park (x3)", you have compressed the message. You haven't lost the meaning, but you've used fewer characters.

📖 Definitions

🔍 Worked example — Easy

A simple text string is represented as: WWWWWWWWWWBBBBBBBBBBBBWWWW. Apply Run-length encoding (RLE) to this string.

🔍 Worked example — Standard

A bitmap image has a row of 10 pixels. The color values are: 5, 5, 5, 5, 5, 8, 8, 8, 2, 2. Use RLE to compress this row. How many values are stored in the compressed version?

🔍 Worked example — Exam-style

A sound file is being compressed using lossy compression. The engineer decides to reduce the sampling rate from 44,100 Hz to 22,050 Hz. Explain the impact of this on the file size and the quality of the sound.

⚠️ Common errors

🧠 Quick check 1

🧠 Quick check 2

🎯 Exam question

(a) State one reason why the developer should use compression on these photos. [1] (b) The developer decides to use lossy compression for the photos. Explain why lossy compression is more suitable for this application than lossless compression. [2] [3 marks]

Worked example

Example 1. Find the file size, in KiB, of a 1200 × 800 image with a colour depth of 24 bits.

🔍 Worked example — Standard

Represent the integer -42 in 8-bit two's complement.

🔍 Worked example — Exam-style

A bitmap image has a file size of 1.2 MiB. The resolution is 1000 × 1000 pixels. Calculate the colour depth in bits.

⚠️ Common errors

Common mistakes

Practice

Answers: (1) 2 × 2^20 = 2 097 152 bytes; 2 × 10^6 = 2 000 000 bytes. (2) 45 = 00101101; −60 = 11000100; sum 11110001 = −15. ✓ (3) Each denary digit is stored separately, so it can be sent directly to its own display segment, and decimal values are represented exactly. (4) Vector: scales without loss of quality (or smaller file for simple shapes); bitmap: photographs with complex colour detail. (5) 44 100 × 16 × 2 × 180 = 254 016 000 bits = 31 752 000 bytes ≈ 30.3 MiB. (6) Lossy compression permanently removes data; any change to a program's instructions would stop it working correctly.

Summary

All chapters in Information Representation and Communication

  1. 1 Information Representation
  2. 2 Communication