1.2 Text, sound and images

Test yourself on Text, sound and images 11 questions — drag-to-order, code completion, matching and multiple choice.
Start the quiz

Character Sets

Watch this lesson Video 1.2.1 · 6:55 · ASCII and Unicode — how a computer that only holds numbers stores letters

1. What is a Character Set?

A Character Set is a defined list of characters recognized by computer hardware and software. Each character is assigned a unique binary number (binary code).

Without a character set, a computer would just see a string of bits and wouldn't know if they represented a number, a sound, or the letter 'A'.

2. ASCII (American Standard Code for Information Interchange)

ASCII was the first widely used character set. It originally used 7 bits, providing $2^7$ ($128$) unique characters.

Example Mapping:
Character 'A' → Denary 65 → Binary 01000001
Character 'a' → Denary 97 → Binary 01100001
Character '!' → Denary 33 → Binary 00100001

Extended ASCII: Later updated to 8 bits ($2^8$), allowing for $256$ characters. This added mathematical symbols and some non-English characters.

3. Unicode

As computing went global, 256 characters weren't enough for languages like Chinese, Arabic, or Hindi. Unicode was created to represent every character in every language.

  • Uses 16 bits (65,536 characters) or 32 bits (over 4 billion characters).
  • The first 128 codes in Unicode are identical to ASCII, making it "backward compatible."
  • Includes Emojis and historical scripts (like Hieroglyphics).

4. ASCII vs. Unicode: Comparison

Feature ASCII Unicode
Bits per Character 7 or 8 bits 16 or 32 bits
Number of Characters 128 to 256 Over 1 million (currently)
Storage Requirements Low (1 byte per char) High (2 to 4 bytes per char)
Global Use English/Western only Universal (all languages)

5. Key Exam Terms

Character:
A single symbol (letter, number, or punctuation mark).
Alphanumeric:
Characters that include both letters and numbers.
Control Characters:
Non-printing characters that perform actions, such as "Shift," "Backspaced," or "Enter."
💡 Exam Tip: If an exam question asks why Unicode is better than ASCII, mention that it allows for global communication and supports multilingual applications, even though it requires more storage space.

Representing Text

Watch this lesson Video 1.2.2 · 6:26 · Turning characters into bits, and calculating what the file will cost

1. The Conversion Process

When you press a key on a keyboard, the computer does not "see" a letter. It follows a specific sequence to translate that physical action into digital data.

Key Pressed
(Physical Act)
Character Set Scan
(Lookup Table)
Unique Value
(Denary/Hex Code)
Binary String
(Stored in RAM)

2. Key Definitions

  • Character Set: A list of characters and the unique binary codes that represent each one.
  • Character: A single unit of information (letter, digit, space, or symbol).
  • String: A sequence of characters stored together (e.g., "Computer").

3. Calculating Text File Size

In the IGCSE exam, you may be asked to estimate the storage required for a piece of text. The logic is simple:

The Formula:

Total Size = Number of Characters × Bits per Character


Example: How much space does the word IGCSE take in standard 8-bit ASCII?
  • Number of characters: 5
  • Bits per character: 8
  • Total: $5 \times 8 = 40 \text{ bits}$ (or 5 Bytes)

4. Factors Affecting Text Storage

Two main factors change the size of a text file:

  1. Length of the Text: More characters = more bytes.
  2. The Character Set Used:
    • ASCII: Uses 1 byte per character. Small and efficient for English.
    • Unicode (UTF-16): Uses 2 bytes per character. Doubles the file size compared to ASCII but supports all languages.

5. Sorting and Comparison

Because every character has a numeric value, computers can "alphabetize" text by comparing their binary codes.

  • Since 'A' is 65 and 'B' is 66, the computer knows 'A' comes first.
  • Warning: In ASCII, uppercase letters have lower values than lowercase letters ('A' = 65, 'a' = 97). This means "Zebra" would technically be sorted before "apple" in a raw binary sort!
Exam Summary:

To represent text, a Character Set (like ASCII or Unicode) is used to assign a unique Binary value to every character. ASCII is limited to 256 characters (1 byte each), while Unicode allows for millions of characters (multiple bytes each) to support global languages and symbols.

Digital Images

Watch this lesson Video 1.2.3 · 6:49 · Pixels, colour depth, and calculating what an image costs to store

1. The Bitmap Concept

Most images on a computer are stored as Bitmaps. A bitmap image is composed of a grid of tiny dots called Pixels (short for Picture Elements).

In a 1-bit image, 0 = White, 1 = Black.

2. Key Terminology

Pixel
The smallest addressable element of a digital image.
Resolution
The number of pixels that make up an image (Width × Height). Higher resolution means more detail but larger file size.
Color Depth (Bit Depth)
The number of bits used to represent the color of a single pixel.

3. Color Depth Calculations

The number of colors available is calculated by 2n, where n is the bit depth.

Bit Depth Colors Available Usage
1-bit $2^1 = 2$ Monochrome (Black/White)
8-bit $2^8 = 256$ Basic web graphics
24-bit $2^{24} \approx 16.7$ Million "True Color" (8 bits each for R, G, B)

4. Estimating Image File Size

The Formula:

File Size (bits) = Resolution (W × H) × Color Depth


Example: An image is 1000 pixels wide, 500 pixels high, and uses 24-bit color.
  • Pixels: $1000 \times 500 = 500,000$
  • Size in bits: $500,000 \times 24 = 12,000,000 \text{ bits}$
  • Size in MiB: $12,000,000 \div 8 \div 1024 \div 1024 \approx 1.43 \text{ MiB}$

5. Metadata

An image file doesn't just contain pixel data. It also contains Metadata (data about data).

⚠️ Exam Alert: If you increase the Resolution OR the Color Depth, the file size will increase. This means it will take longer to download/upload and require more storage space.

Digital Sound

Watch this lesson Video 1.2.4 · 7:06 · Sampling a wave, and the two settings that decide quality and size

1. Analog vs. Digital

Sound is naturally Analog (a continuous wave). Computers are Digital (discrete binary). To store sound, we must convert the analog wave into digital data using an ADC (Analog-to-Digital Converter).

The Process: Sampling

The amplitude (height) of the sound wave is measured at regular intervals and recorded as a binary value.

||| | || | ||| | ||
Each bar represents a "sample" taken at a specific point in time.

2. Key Factors Affecting Sound Quality

A. Sample Rate (Frequency)

The number of samples taken per second, measured in Hertz (Hz).

  • High Sample Rate: More samples per second = Smoother, more accurate reproduction of the original wave.
  • Standard CD Quality: 44,100 Hz (44.1 kHz).

B. Sample Resolution (Bit Depth)

The number of bits used to store each sample. This determines how many different "levels" of volume (amplitude) can be recorded.

  • High Resolution: More bits per sample = Larger range of volumes and less "quantization" noise.

3. Calculating Sound File Size

The Formula:

File Size = Sample Rate (Hz) × Resolution (bits) × Time (seconds)


Example: A 10-second mono clip recorded at 44,100 Hz with 16-bit resolution.
  • Calculation: $44,100 \times 16 \times 10 = 7,056,000 \text{ bits}$
  • In MiB: $7,056,000 \div 8 \div 1024 \div 1024 \approx 0.84 \text{ MiB}$

4. Impact of Changing Settings

Action Impact on Quality Impact on File Size
Increase Sample Rate Higher (Better accuracy) Increases
Increase Sample Resolution Higher (Better dynamic range) Increases

5. Playback: The DAC

To hear the sound, the binary data must be converted back into an analog signal using a DAC (Digital-to-Analog Converter). This signal is then sent to an amplifier and speakers/headphones.

⚠️ Exam Tip: When describing the process, always use the word "intervals." "Samples of the sound wave amplitude are taken at regular intervals and stored as binary values." This is often a mark-earning phrase in IGCSE mark schemes.