logo

Cambridge IGCSE Computer Science revision notes

Text, sound and images Revision Notes

Cambridge IGCSE revision notes for Text, sound and images.

At a glance

revision notes

Resource type

Topic

Text, sound and images

CambridgeIGCSEComputer ScienceData representation

Complete revision guide 1 of 3

How Computers Represent Text Using Character Sets

This note explains how text is represented in computers by converting characters into binary using character sets such as ASCII and Unicode. It covers the reasons for this representation, the differences between ASCII and Unicode, and the implications for processing and storage.

Syllabus source

Section 3, Topic 1.2, page 12, objective 1.2.1

Open source document ↗

What you should be able to do

  • ✓Understand why text must be converted into binary for computer processing.
  • ✓Explain how ASCII encodes characters using 7 bits and its limitations.
  • ✓Describe how Unicode extends character representation to support multiple languages and symbols.
  • ✓Compare ASCII and Unicode in terms of character range and bit requirements.
  • ✓Recognise the practical impact of using Unicode on storage and processing.
1

Why Computers Represent Text in Binary

Computers operate using binary data, which consists of sequences of 0s and 1s. To process text, which humans read as letters, digits, and symbols, computers must convert these characters into binary form. This conversion allows text to be stored, manipulated, and transmitted digitally.

Each character is assigned a unique binary code according to a character set. This standardisation ensures that text data is interpreted consistently across different devices and software.

For example, the letter 'A' might be represented as 01000001 in binary, which corresponds to a specific code in a character set. Without such a system, computers would not understand how to represent or display text.

  • Text must be converted into binary for computer processing.
  • Character sets assign unique binary codes to each character.
  • Standardisation ensures consistent interpretation of text data.
2

The ASCII Character Set and Its Features

ASCII (American Standard Code for Information Interchange) is one of the earliest character sets developed to represent text in computers. It uses 7 bits to encode each character, allowing for 2^7 = 128 unique codes.

These 128 codes include uppercase and lowercase English letters (A-Z, a-z), digits (0-9), common punctuation marks, and some control characters like newline and carriage return.

Because ASCII uses only 7 bits, it is efficient in terms of storage and processing. However, it is limited to basic English characters and cannot represent accented letters, symbols from other languages, or emojis.

  • ASCII uses 7 bits per character, supporting 128 characters.
  • Includes English letters, digits, punctuation, and control codes.
  • Limited to basic Latin characters; cannot represent international symbols.
  • Efficient for simple English text but insufficient for global use.
3

Unicode: Extending Character Representation

Unicode was developed to overcome ASCII's limitations by providing a universal character set that includes characters from most of the world's writing systems, as well as symbols, emojis, and special characters.

Unicode assigns a unique code point to each character, which can require more bits than ASCII. Common Unicode encodings include UTF-8, UTF-16, and UTF-32, which use variable or fixed numbers of bits per character.

For example, UTF-8 uses 8 bits for standard ASCII characters but can use up to 32 bits for less common characters. This flexibility allows Unicode to represent over a million different characters, supporting global communication and modern digital text needs.

  • Unicode supports a vast range of characters from many languages and symbols.
  • Uses variable-length encoding schemes like UTF-8, UTF-16, and UTF-32.
  • Requires more bits per character than ASCII, increasing storage needs.
  • Enables representation of emojis, accented letters, and non-Latin scripts.
4

Comparing ASCII and Unicode

ASCII and Unicode differ mainly in the number of characters they can represent and the number of bits used per character.

ASCII is limited to 128 characters using 7 bits, making it suitable for basic English text but inadequate for internationalisation.

Unicode supports over a million characters, requiring more bits per character, which increases file sizes and processing requirements but allows for comprehensive text representation worldwide.

  • ASCII: 7 bits, 128 characters, limited to basic English.
  • Unicode: variable bits (8 to 32), over a million characters, supports global scripts and symbols.
  • Unicode increases storage and processing demands compared to ASCII.
  • Choice depends on application needs: ASCII for simple text, Unicode for multilingual and symbol-rich text.
5

Practical Implications of Using Unicode

Using Unicode allows software and systems to handle text in any language, which is essential in today's globalised world.

However, because Unicode characters can require more bits, files containing Unicode text are often larger than ASCII equivalents, affecting storage and transmission.

Programmers and system designers must consider encoding when processing text data to avoid errors such as misinterpreted characters or data corruption. For example, reading a Unicode file as ASCII can result in incorrect characters being displayed.

  • Unicode enables global text representation, including emojis and symbols.
  • Larger bit requirements increase file size and processing time.
  • Correct encoding handling is essential to prevent text errors.
  • Systems must support Unicode to ensure compatibility with international text.

At-a-glance summary

Comparison table

AspectASCIIUnicodeExample
Bits per character7 bitsVariable: 8 to 32 bitsASCII 'A' = 01000001; Unicode '😊' uses multiple bytes
Character range128 charactersOver 1,000,000 charactersASCII covers English letters; Unicode covers Chinese, Arabic, emojis
Languages supportedBasic EnglishMost world languages and symbolsASCII cannot represent 'ñ'; Unicode can
Storage impactSmaller filesLarger files due to more bitsUnicode text files are bigger than ASCII ones

Active recall

Quick check

1. Why do computers convert text into binary?

Because computers process data in binary, text must be converted into binary codes so it can be stored, transmitted, and manipulated digitally.

2. How many characters can ASCII represent and how many bits does it use?

ASCII represents 128 characters using 7 bits per character.

3. What advantage does Unicode have over ASCII?

Unicode can represent a much larger range of characters from many languages and symbols, including emojis, by using more bits per character.

4. What is a practical consequence of Unicode requiring more bits per character?

Text files using Unicode are generally larger and require more storage and processing resources than ASCII files.

Complete revision guide 2 of 3

How and Why Computers Represent Sound: Sample Rate and Sample Resolution

This note explains the process by which computers convert sound waves into binary data, focusing on the roles of sample rate and sample resolution. It details how these factors affect sound quality and file size, providing clear examples and practical calculations to support understanding.

Syllabus source

Section 3, Topic 1.2, page 12, objective 1.2.2

Open source document ↗

What you should be able to do

  • ✓Understand the process of converting sound waves into digital binary data through sampling.
  • ✓Explain the meaning of sample rate and how it influences sound quality and file size.
  • ✓Describe sample resolution (bit depth) and its impact on recording accuracy and data size.
  • ✓Calculate the file size of a digital sound recording given sample rate, sample resolution, duration, and number of channels.
  • ✓Recognise the trade-offs between sound quality and file size when adjusting sample rate and resolution.
1

Introduction to Digital Sound Representation

Sound in the real world is an analogue wave, continuously varying in air pressure. Computers, however, can only process discrete binary data (0s and 1s). To handle sound, computers convert these continuous waves into digital form through a process called sampling.

Sampling involves measuring the amplitude (height) of the sound wave at regular intervals. Each measurement is then converted into a binary number, allowing the computer to store and manipulate the sound digitally.

This conversion enables sound to be stored, edited, and transmitted by computers, but the quality of the digital sound depends heavily on how the sampling is done. Two key factors are sample rate and sample resolution.

  • Sound waves are continuous analogue signals.
  • Computers require discrete binary data to process sound.
  • Sampling converts analogue sound into digital binary data.
  • Quality depends on sampling parameters.
2

Sample Rate: Frequency of Sampling

Sample rate is the number of times per second the sound wave is measured. It is measured in hertz (Hz), where 1 Hz equals one sample per second.

For example, a sample rate of 44,100 Hz (44.1 kHz) means the sound wave is sampled 44,100 times every second. This is the standard sample rate for audio CDs.

A higher sample rate captures more detail from the original sound wave, allowing more accurate reproduction of high-frequency sounds. Conversely, a low sample rate may miss important details, causing the sound to lose clarity or introduce distortion known as aliasing.

  • Sample rate is measured in samples per second (Hz).
  • Higher sample rates capture more sound detail.
  • Standard CD quality uses 44,100 Hz.
  • Low sample rates reduce sound quality and can cause distortion.
3

Sample Resolution: Bit Depth of Each Sample

Sample resolution, also called bit depth, is the number of bits used to represent each individual sample's amplitude.

For example, a sample resolution of 8 bits means each sample can have 2^8 = 256 possible amplitude values. A 16-bit resolution allows 2^16 = 65,536 values, providing much finer detail in representing the sound's loudness at each sample point.

Higher bit depths reduce quantisation error, which is the difference between the actual analogue amplitude and its digital representation. This results in clearer, more accurate sound with less noise and distortion.

  • Sample resolution is the number of bits per sample.
  • Higher bit depth means more precise amplitude representation.
  • 8-bit allows 256 levels; 16-bit allows 65,536 levels.
  • Higher resolution reduces quantisation noise.
4

Effect on Sound Quality and File Size

Increasing either sample rate or sample resolution improves the accuracy and quality of the digital sound recording. However, this also increases the amount of data generated, leading to larger file sizes.

The size of a digital sound file can be calculated using the formula:

File size (bits) = Sample rate (samples/second) × Sample resolution (bits/sample) × Duration (seconds) × Number of channels (e.g., 2 for stereo).

  • Higher sample rate and resolution improve sound quality.
  • Larger values increase file size proportionally.
  • File size depends on sample rate, resolution, duration, and channels.
  • Example: A 3-minute stereo recording at 44,100 Hz and 16-bit resolution:
  • File size = 44,100 × 16 × 180 × 2 = 254,016,000 bits ≈ 30.25 MB (using 8 bits per byte and 1024 bytes per KiB).
5

Practical Example and Calculation

Consider a mono (single channel) recording lasting 10 seconds, sampled at 8,000 Hz with 8-bit resolution.

Calculate the file size in bits: File size = 8,000 samples/second × 8 bits/sample × 10 seconds × 1 channel = 640,000 bits.

Convert bits to bytes: 640,000 bits ÷ 8 = 80,000 bytes ≈ 78.13 KiB (since 1 KiB = 1024 bytes).

  • Mono recording: 10 seconds, 8,000 Hz, 8-bit.
  • File size = 8,000 × 8 × 10 × 1 = 640,000 bits.
  • In bytes: 640,000 ÷ 8 = 80,000 bytes.
  • In KiB: 80,000 ÷ 1024 ≈ 78.13 KiB.
6

Summary and Trade-offs

Digital sound quality depends on sample rate and sample resolution. Higher values improve fidelity but increase file size and storage requirements.

Choosing appropriate values depends on the application: telephone audio uses low sample rates and resolutions to save bandwidth, while professional music recording uses high values for quality.

Understanding these concepts helps in making informed decisions about sound recording and storage in computing.

  • Sample rate and resolution balance quality and file size.
  • Higher values mean better sound but larger files.
  • Application determines suitable sampling parameters.
  • Knowledge aids efficient sound data handling.

At-a-glance summary

Comparison table

AspectDefinitionExampleExam Use
Sample RateNumber of samples taken per second from the sound wave44,100 Hz means 44,100 samples per secondExplain how increasing sample rate improves sound quality but increases file size
Sample ResolutionNumber of bits used to represent each sample's amplitude16-bit resolution allows 65,536 amplitude levelsDescribe how higher bit depth reduces quantisation noise
File Size CalculationFormula to find size of digital sound dataFile size = sample rate × bit depth × duration × channelsCalculate file size given sampling parameters
Trade-offsBalancing sound quality against storage requirementsHigher sample rate and resolution improve quality but increase file sizeDiscuss why different applications use different sampling settings

Active recall

Quick check

1. What does sample rate measure in digital sound?

The number of times per second the sound wave is sampled, measured in hertz (Hz).

2. How does increasing sample resolution affect sound quality?

It increases the number of amplitude levels per sample, reducing quantisation noise and improving accuracy.

3. Calculate the file size in bits for a 5-second stereo recording at 22,050 Hz sample rate and 16-bit resolution.

File size = 22,050 × 16 × 5 × 2 = 3,528,000 bits.

4. Why do higher sample rates and resolutions increase file size?

Because more samples per second and more bits per sample generate more data to store.

Complete revision guide 3 of 3

How and Why Computers Represent Images: Resolution and Colour Depth

This note explains how computers represent images using pixels converted into binary, the role of resolution and colour depth in image quality and file size, and includes worked examples and practical considerations.

Syllabus source

Section 3, Topic 1.2, page 13, objective 1.2.3

Open source document ↗

What you should be able to do

  • ✓Understand that images are made up of pixels, each represented in binary form.
  • ✓Explain how resolution, defined by the number of pixels, affects image quality and file size.
  • ✓Describe colour depth as the number of bits used to represent each pixel's colour and its impact on image quality and file size.
  • ✓Calculate image file size using resolution and colour depth.
  • ✓Recognise the trade-offs between image quality and file size when adjusting resolution and colour depth.
1

Pixels and Binary Representation of Images

Digital images are composed of tiny units called pixels (picture elements). Each pixel represents a single point in the image and holds information about its colour.

To be processed and stored by a computer, each pixel's colour information is converted into binary code — a sequence of bits (0s and 1s). This binary representation allows the computer to manipulate, display, and save the image.

For example, a pixel might be represented by 8 bits, where each bit pattern corresponds to a specific colour or shade. The more bits used per pixel, the more colours can be represented, resulting in richer images.

  • Pixels are the smallest units of a digital image.
  • Each pixel's colour is converted into binary for computer processing.
  • More bits per pixel allow more colours to be represented.
2

Resolution: Number of Pixels and Its Effects

Resolution refers to the total number of pixels in an image, usually expressed as width × height (e.g., 1920 × 1080 pixels).

Higher resolution means more pixels, which generally leads to sharper and more detailed images because there are more points of colour information.

However, increasing resolution also increases the amount of data needed to store the image, thus increasing the file size. This means higher resolution images require more storage space and more processing power to handle.

  • Resolution = width × height (number of pixels).
  • Higher resolution improves image detail and sharpness.
  • Higher resolution increases file size.
3

Colour Depth: Bits per Pixel and Colour Range

Colour depth is the number of bits used to represent the colour of each pixel. It determines how many different colours can be displayed in an image.

For example, a colour depth of 1 bit per pixel can represent 2 colours (usually black and white). An 8-bit colour depth can represent 2^8 = 256 colours, while a 24-bit colour depth can represent 2^24 ≈ 16.7 million colours, allowing for very detailed and realistic images.

Increasing colour depth improves image quality by allowing more colour variations but also increases the file size proportionally.

  • Colour depth = bits used per pixel to represent colour.
  • Higher colour depth means more colours and better image quality.
  • File size increases as colour depth increases.
4

Calculating Image File Size

The size of an uncompressed image file in bits can be calculated using the formula:

Image size (bits) = width (pixels) × height (pixels) × colour depth (bits per pixel)

To convert bits to bytes, divide by 8 (since 1 byte = 8 bits). For example, to find the size in kilobytes (KB), divide bytes by 1024 (1 KB = 1024 bytes). This helps estimate storage requirements and bandwidth for image files.

  • Image size (bits) = width × height × colour depth.
  • Divide bits by 8 to get bytes.
  • Divide bytes by 1024 to get kilobytes (KB).
5

Worked Example: Calculating File Size

Suppose you have an image with a resolution of 800 pixels wide and 600 pixels high, and a colour depth of 24 bits per pixel.

Step 1: Calculate total pixels: 800 × 600 = 480,000 pixels.

Step 2: Calculate total bits: 480,000 pixels × 24 bits/pixel = 11,520,000 bits total file size (uncompressed). Step 3: Convert bits to bytes: 11,520,000 bits ÷ 8 = 1,440,000 bytes. Step 4: Convert bytes to kilobytes: 1,440,000 bytes ÷ 1024 ≈ 1406.25 KB (about 1.4 MB). This means the image requires approximately 1.4 megabytes of storage without compression.

  • Calculate pixels: width × height.
  • Multiply pixels by colour depth to get bits.
  • Convert bits to bytes and then to KB or MB.
  • Check units carefully to avoid errors.
6

Trade-offs Between Image Quality and File Size

Increasing resolution and colour depth improves image quality by adding detail and colour richness, but this also increases the file size, requiring more storage and bandwidth.

When designing or choosing images for specific uses, such as web pages or printing, it is important to balance quality and file size.

For example, a web image might use lower resolution and colour depth to load quickly, while a professional photograph might use high resolution and colour depth for clarity and colour accuracy.

  • Higher resolution and colour depth improve quality but increase file size.
  • Balance image quality with storage and bandwidth constraints.
  • Choose settings based on the intended use of the image.

At-a-glance summary

Comparison table

StepDetailExampleExam Use
Identify pixelsPixels are the smallest image units converted to binaryEach pixel might be 24 bits representing colourExplain pixels as binary units in answers
Calculate resolutionMultiply width by height to get total pixels1920 × 1080 = 2,073,600 pixelsUse formula to find total pixels for file size
Determine colour depthBits per pixel define colour range8 bits = 256 colours, 24 bits = 16.7 million coloursState colour depth and its effect on quality
Calculate file sizeFile size = pixels × colour depth (bits)800×600×24 = 11,520,000 bitsShow calculation steps with units

Active recall

Quick check

1. What is a pixel in a digital image?

A pixel is the smallest unit of a digital image, representing one point of colour, stored as binary data.

2. How do you calculate the resolution of an image?

Multiply the width in pixels by the height in pixels to get the total number of pixels.

3. What does colour depth represent?

Colour depth is the number of bits used to represent the colour of each pixel, determining how many colours can be displayed.

4. Calculate the file size in bits of a 100×100 pixel image with 8-bit colour depth.

100 × 100 × 8 = 80,000 bits.

5. How does increasing colour depth affect image quality and file size?

Increasing colour depth allows more colours and better image quality but also increases the file size proportionally.

Related topics

Study nearby topics next

Revision hubs

Keep studying from the right hub