Skip to content

Data Representation

Data Representation

:::info Board Coverage AQA Paper 1 | Edexcel Paper 1 | OCR J277 Paper 1 | WJEC Unit 1 :::

1. Binary

1.1 The Binary Number System

Computers use binary (base 2), which has only two digits: 0 and 1. Each binary digit is called a bit (binary digit).

A group of 8 bits is called a byte.

Bit position1286432168421
Power of 2272^7262^6252^5242^4232^3222^2212^1202^0

Why binary? Digital circuits are built from transistors, which have two states: on (high Voltage) and off (low voltage). These two states map to 1 and 0. Binary arithmetic can be Implemented with simple logic gates (AND, OR, NOT), making hardware design tractable.

1.2 Converting Between Binary and Denary

Binary to denary: Add the values of the positions where there is a 1.

Worked Example. Convert 11010110 to denary.

128+64+16+4+2=214128 + 64 + 16 + 4 + 2 = 214

Worked Example. Convert 01011101 to denary.

64+16+8+4+1=9364 + 16 + 8 + 4 + 1 = 93

Denary to binary: Find the largest power of 2 that fits, subtract, and repeat.

Worked Example. Convert 105 to binary.

105 - 64 = 41$$41 - 32 = 9$$9 - 8 = 1$$1 - 1 = 0.

Binary: 1101001.

In 8 bits: 01101001.

Alternative method: repeated division by 2. Divide the number by 2 repeatedly and record the Remainders. Read the remainders from bottom to top.

Worked Example. Convert 214 to binary.

214/2=107214 / 2 = 107 r 0 107/2=53107 / 2 = 53 r 1 53/2=2653 / 2 = 26 r 1 26/2=1326 / 2 = 13 r 0 13/2=613 / 2 = 6 r 1 6/2=36 / 2 = 3 r 0 3/2=13 / 2 = 1 r 1 1/2=01 / 2 = 0 r 1

Reading bottom to top: 11010110.

1.3 Units of Data

UnitNumber of bytes
1 Kilobyte (KB)210=10242^{10} = 1024 bytes
1 Megabyte (MB)220=10485762^{20} = 1048576 bytes
1 Gigabyte (GB)2302^{30} bytes
1 Terabyte (TB)2402^{40} bytes

:::caution In computing, kilo means 1024 (not 1000) because computers use binary. However, storage Manufacturers often use 1000 for marketing purposes. A “500 GB” hard drive advertised by the Manufacturer is actually about 465 GiB when measured in binary. The IEC prefixes KiB, MiB, GiB refer Specifically to powers of 1024.

1.4 Binary Addition

Binary addition follows the same rules as denary addition, but with only two digits:

0+00 + 00+10 + 11+01 + 01+11 + 1
01110 (0 carry 1)

Worked Example. 0110+01010110 + 0101

0110
+ 0101
------
1011

Worked Example. 1101+10111101 + 1011

1101
+ 1011
------
11000

Worked Example with overflow. 1100+11001100 + 1100

1100
+ 1100
------
11000

The result (11000) requires 5 bits, but we are working with 4-bit numbers. The leftmost 1 is lost, Giving an incorrect result of 1000. This is called overflow and occurs when the result of an Operation exceeds the number of bits available.

1.5 Binary Subtraction Using Two’s Complement (Higher Tier)

To subtract, add the two’s complement of the number being subtracted.

Two’s complement: Invert all bits (1’s complement), then add 1.

Worked Example. Calculate 636 - 3 in 4-bit binary.

6 = 0110$$3 = 0011

Two’s complement of 3: invert 001111000011 \to 1100Add 111011 \to 1101.

0110+1101=100110110 + 1101 = 10011.

Discard the overflow bit: 0011=30011 = 3. Correct.

Worked Example. Calculate 363 - 6 in 4-bit binary.

3 = 0011$$6 = 0110.

Two’s complement of 6: invert 011010010110 \to 1001Add 110101 \to 1010.

0011+1010=11010011 + 1010 = 1101.

In two’s complement, 1101=8+4+0+1=31101 = -8 + 4 + 0 + 1 = -3. Correct.

Worked Example. Calculate 15815 - 8 in 5-bit binary.

15 = 01111$$8 = 01000.

Two’s complement of 8: invert 010001011101000 \to 10111Add 1110001 \to 11000.

01111+11000=10011101111 + 11000 = 100111.

Discard the overflow bit: 00111=700111 = 7. Correct.

Proof that two’s complement negation works. For an nn-bit number xx with 0<x<2n10 \lt x \lt 2^{n-1}Let yy be the bitwise complement of xx plus 1. Then y=2nxy = 2^n - x. When we Compute x+y=x+(2nx)=2nx + y = x + (2^n - x) = 2^n. In NN-bit arithmetic, the leading 1 overflows and is Discarded, leaving 0. Therefore y=xy = -x in two’s complement arithmetic. \blacksquare

1.6 Logical Binary Shifts (Higher Tier)

A logical left shift moves all bits to the left by a specified number of positions. Zeros fill The vacated positions on the right. Each left shift multiplies by 2.

Example. 0000110000001100 (12) shifted left by 2: 0011000000110000 (48).

Formal justification. Shifting left by kk positions multiplies each bit’s positional value by 2k2^k. The new value is the original value times 2k2^k.

A logical right shift moves all bits to the right. Each right shift divides by 2 (integer Division).

Example. 0000110000001100 (12) shifted right by 1: 0000011000000110 (6).

Worked Example. What is 0001011000010110 shifted left by 3?

00010110=2200010110 = 22. After shifting left by 3: 10110000=17610110000 = 176. Check: 22×23=22×8=17622 \times 2^3 = 22 \times 8 = 176. Correct.

2. Hexadecimal

2.1 The Hexadecimal System

Hexadecimal (base 16) uses digits 0—9 and letters A—F (where A=10, B=11, …, F=15).

Hex is used as a shorthand for binary because:

  • 4 binary digits = 1 hex digit
  • Large binary numbers are easier to read and write in hex
  • Hex is easier for humans to work with than long strings of 0s and 1s
BinaryHexDenary
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

2.2 Conversions

Binary to hex: Group the binary digits into groups of 4 (from the right), then convert each Group.

Worked Example. Convert 110101101011 to hex.

Group: 1101 0110 1011

Convert: D 6 B

Result: D6B

Worked Example. Convert 10110 to hex.

Pad with leading zeros: 0001 0110

Convert: 1 6

Result: 16

Hex to binary: Convert each hex digit to 4 binary digits.

Worked Example. Convert 3F7 to binary.

3 = 0011, F = 1111, 7 = 0111

Result: 001111110111

Hex to denary: Multiply each hex digit by its positional value (160,161,16216^0, 16^1, 16^2Etc.) and Sum.

Worked Example. Convert 2AF to denary.

2×162+10×161+15×160=2×256+10×16+15=512+160+15=6872 \times 16^2 + 10 \times 16^1 + 15 \times 16^0 = 2 \times 256 + 10 \times 16 + 15 = 512 + 160 + 15 = 687

Denary to hex: Repeatedly divide by 16 and record remainders.

Worked Example. Convert 300 to hex.

300/16=18300 / 16 = 18 r 12 (C) 18/16=118 / 16 = 1 r 2 1/16=01 / 16 = 0 r 1

Result: 12C

2.3 Uses of Hexadecimal

  • Colour codes: In HTML/CSS, colours are represented as #RRGGBB (e.g. #FF0000 = red, #00FF00 = green, #0000FF = blue). Each pair is a hex value from 00 to FF (0 to 255 in denary).
  • MAC addresses: 48-bit addresses represented as 12 hex digits (e.g. 00:1A:2B:3C:4D:5E)
  • Error codes: Memory addresses and error messages often use hex
  • Assembly language: Machine code instructions are shown in hex

Why hex for colours? Each colour channel (red, green, blue) uses 8 bits (0-255). Two hex digits Represent 8 bits exactly, so #RRGGBB gives precise control over each channel in a compact format.

Worked Example. What colour is #40FF00?

Red = 40 hex = 64 denary (moderate red), Green = FF hex = 255 denary (maximum green), Blue = 00 hex = 0 denary (no blue). This is a bright yellow-green colour.

Worked Example. What is the denary value of the MAC address byte 3C?

3×16+12=48+12=603 \times 16 + 12 = 48 + 12 = 60.

3. Representing Text

3.1 Character Sets

A character set is a collection of characters that a computer can recognise. Each character is Assigned a unique binary code.

Character SetDescriptionCharacters
ASCIIAmerican Standard Code for Information Interchange128 characters (7 bits)
Extended ASCIIExtended version256 characters (8 bits)
UnicodeUniversal character setOver 140,000 characters (up to 32 bits)

3.2 ASCII

ASCII uses 7 bits, giving 27=1282^7 = 128 possible characters:

  • 0—31: Control characters (non-printable, e.g. Carriage return, tab)
  • 32—127: Printable characters (letters, digits, punctuation, symbols)

Key ASCII values:

CharacterASCII CodeCharacterASCII Code
A65a97
B66b98
Z90z122
048957
Space32!33

Useful pattern: The ASCII code for ‘a’ is 97, for ‘b’ is 98, …, for ‘z’ is 122. The code for ‘A’ is 65, for ‘B’ is 66, …, for ‘Z’ is 90. The difference between uppercase and lowercase is 32. So to convert ‘A’ to ‘a’, add 32 to its ASCII code.

Worked Example. What is stored in binary for the text “Hi”?

H = 72 = 1001000 i = 105 = 1101001

“Hi” in 8-bit ASCII: 01001000 01101001

Worked Example. How many bytes are needed to store the word “COMPUTER” in ASCII?

Each character is 1 byte (8 bits). “COMPUTER” has 8 characters, so 8 bytes.

Worked Example (Higher Tier). Write the binary for “Cat” in 8-bit ASCII.

C = 67 = 01000011, a = 97 = 01100001, t = 116 = 01110100.

“Cat” = 01000011 01100001 01110100 (3 bytes).

3.3 Unicode

Unicode supports multiple languages and special characters. The first 128 characters of Unicode are The same as ASCII (backwards compatible).

Unicode uses up to 4 bytes per character. Common encodings include UTF-8 (variable length, 1—4 Bytes) and UTF-16.

Why Unicode replaced ASCII: ASCII can only represent 128 characters, which is insufficient for Languages like Chinese, Japanese, Arabic, and Hindi, and cannot represent emojis or mathematical Symbols. Unicode assigns a unique code point to every character in every language.

UTF-8 encoding efficiency. UTF-8 uses 1 byte for ASCII characters, 2 bytes for most Latin-based Scripts, 3 bytes for Asian scripts, and 4 bytes for emojis and rare characters. This means plain English text is stored efficiently in UTF-8, while still supporting the full range of Unicode.

4. Representing Images

4.1 Bitmap Images

A bitmap image is made up of tiny squares called pixels (picture elements). Each pixel is Assigned a binary value that represents its colour.

Image resolution: The number of pixels in the image (width ×\times height).

Colour depth: The number of bits used to represent each pixel.

Colour DepthNumber of Colours
1 bit2 (black and white)
8 bits (1 byte)256
16 bits65536
24 bits (3 bytes)16777216 (True Colour)
32 bitsOver 4 billion

Why 2n2^n colours? With nn bits per pixel, there are 2n2^n possible combinations of 0s and 1s. Each combination maps to a unique colour. So 24 bits gives 224=16,777,2162^{24} = 16,777,216 possible colours.

4.2 Calculating Image File Size

\mathrm{File size (bits) = \mathrm{width \times \mathrm{height \times \mathrm{colour depth

Worked Example. An image is 1920 ×\times 1080 pixels with 24-bit colour depth. Calculate the File size in megabytes.

\mathrm{File size = 1920 \times 1080 \times 24 = 49766400 \mathrm{ bits = \frac{49766400}{8} = 6220800 \mathrm{ bytes = \frac{6220800}{1024 \times 1024} \approx 5.93 \mathrm{ MB

Worked Example. An image is 800 ×\times 600 pixels with 32-bit colour depth.

\mathrm{File size = 800 \times 600 \times 32 = 15360000 \mathrm{ bits = 1920000 \mathrm{ bytes \approx 1.83 \mathrm{ MB

Worked Example (Higher Tier). A 4-megapixel image has a file size of 3 MB. What is the colour Depth?

4×1064 \times 10^6 pixels ×\times colour depth = 3×1024×1024×83 \times 1024 \times 1024 \times 8 bits.

\mathrm{Colour depth = \frac{3 \times 1048576 \times 8}{4000000} = \frac{25165824}{4000000} \approx 6.29 Bits.

This is not an exact number, which suggests the file may include a header or metadata. Without Metadata, a 4-megapixel image at 24-bit colour depth would be: 4000000×24/8=120000004000000 \times 24 / 8 = 12000000 Bytes 11.44\approx 11.44 MB.

4.3 The Effect of Resolution and Colour Depth

  • Increasing resolution: Sharper image, larger file size
  • Increasing colour depth: More colours available, larger file size
  • Decreasing either: Smaller file size, lower quality

Trade-off. Higher resolution and colour depth produce better images but require more storage and Take longer to transmit. Web designers often compress images to balance quality against file size.

Worked Example. An image is 1024 ×\times 768 with 16-bit colour. If the colour depth is Increased to 24-bit, what is the percentage increase in file size?

Original: 1024×768×16=125829121024 \times 768 \times 16 = 12582912 bits.

New: 1024×768×24=188743681024 \times 768 \times 24 = 18874368 bits.

Increase: (1887436812582912)/12582912×100=50%(18874368 - 12582912) / 12582912 \times 100 = 50\%.

4.4 Vector Images (Higher Tier)

Vector images store images as mathematical descriptions of shapes (lines, curves, colours) Rather than as pixels.

Advantages of vector images:

  • Scale without losing quality (no pixelation)
  • Smaller file sizes for simple graphics (logos, icons)
  • Easy to edit individual components

Disadvantages:

  • Not suitable for photographs (too complex)
  • Rendering can be slower for very complex images

Bitmap vs Vector comparison:

FeatureBitmapVector
RepresentationGrid of pixelsMathematical descriptions
ScalingLoses quality when enlargedNo quality loss at any size
File sizeDepends on resolutionDepends on complexity
Best forPhotographsLogos, icons, diagrams
EditingPixel-level manipulationEdit individual shapes

5. Representing Sound

5.1 How Sound Is Stored

Sound is an analogue wave. To store it digitally:

  1. The sound wave is sampled at regular intervals (sampling rate)
  2. The amplitude at each sample is measured and stored as a binary value (sample resolution / bit depth)

This process is called analogue to digital conversion (ADC).

Intuition. Imagine drawing a smooth curve on graph paper by only plotting points at regular Intervals along the x-axis. The more points you plot (higher sample rate) and the more precisely you Measure each y-value (higher bit depth), the more accurately your plotted points will match the Original curve.

5.2 Key Terms

TermDefinition
Sample rateNumber of samples taken per second (measured in Hz)
Sample resolution (bit depth)Number of bits per sample
Bit rateSample rate ×\times sample resolution (bits per second)

5.3 Calculating Sound File Size

\mathrm{File size (bits) = \mathrm{sample rate \times \mathrm{sample resolution \times \mathrm{duration (seconds) \times \mathrm{channels

Worked Example. A 3-minute audio clip is recorded at 44100 Hz with 16-bit resolution (mono). Calculate the file size.

\mathrm{File size = 44100 \times 16 \times 180 = 127008000 \mathrm{ bits = \frac{127008000}{8} = 15876000 \mathrm{ bytes \approx 15.14 \mathrm{ MB

Worked Example. A 2-minute stereo audio clip at 48000 Hz with 24-bit resolution.

\mathrm{File size = 48000 \times 24 \times 120 \times 2 = 276480000 \mathrm{ bits \approx 32.94 \mathrm{ MB

Worked Example (Higher Tier). A 5-minute mono recording at 22050 Hz has a file size of 12.5 MB. What is the bit depth?

\mathrm{File size in bits = 12.5 \times 1024 \times 1024 \times 8 = 104857600 bits.

\mathrm{Bit depth = \frac{104857600}{22050 \times 300} = \frac{104857600}{6615000} \approx 15.85.

This is closest to 16-bit, which gives: 22050×16×300=10584000022050 \times 16 \times 300 = 105840000 bits 12.62\approx 12.62 MB. The small difference is due to file header overhead.

5.4 Effects of Sample Rate and Resolution

  • Higher sample rate: More faithful reproduction of the original sound, larger file
  • Higher bit depth: More precise amplitude values, larger file
  • CD quality: 44100 Hz, 16-bit
  • Studio quality: 96000 Hz, 24-bit
  • Telephone quality: 8000 Hz, 8-bit

Nyquist theorem. To accurately reproduce a sound, the sample rate must be at least twice the Highest frequency in the sound. Human hearing ranges up to about 20,000 Hz, so a sample rate of 44,100 Hz (just above 2×200002 \times 20000) is sufficient for CD quality.

Proof sketch of the Nyquist theorem. If a signal has maximum frequency fmaxf_{\max}Then the Signal completes at most fmaxf_{\max} cycles per second. If we sample at rate fs2fmaxf_s \ge 2 f_{\max}We Take at least 2 samples per cycle. Two samples per cycle are sufficient to uniquely determine the Amplitude and phase of a sinusoidal component. If fs<2fmaxf_s \lt 2 f_{\max}Different frequencies Produce the same sample values (aliasing), making reconstruction ambiguous. \blacksquare

Aliasing in practice. If a 30,000 Hz tone is sampled at 44,100 Hz, the reconstructed frequency Is 4410030000=14100|44100 - 30000| = 14100 Hz, which is completely wrong. Anti-aliasing filters remove frequencies Above the Nyquist limit before sampling.

6. Data Compression

6.1 Why Compress?

Compression reduces file size, saving storage space and reducing transmission time over networks. Without compression, a 2-hour HD film could require hundreds of gigabytes.

6.2 Lossy Compression

Lossy compression permanently removes some data to reduce file size. The original file cannot be Perfectly reconstructed.

Examples: JPEG (images), MP3 (audio), MP4 (video)

Advantages:

  • Much smaller file sizes
  • Suitable for images, audio, and video where perfect accuracy is not needed

Disadvantages:

  • Quality loss
  • Not suitable for text or programs (every bit matters)

How JPEG works: JPEG exploits the fact that human vision is less sensitive to fine colour detail Than to fine brightness detail. It converts the image to a frequency representation, then discards High-frequency components that are less perceptible. This is why heavily compressed JPEGs show “blocky” artefacts.

Compression ratio comparison:

FormatTypeTypical Compression RatioQuality
PNGLossless2:1 to 3:1Perfect
JPEGLossy10:1 to 20:1Good to poor
FLACLossless2:1Perfect
MP3Lossy10:1 to 12:1Good

6.3 Lossless Compression

Lossless compression reduces file size without losing any data. The original file can be perfectly Reconstructed.

Examples: PNG (images), FLAC (audio), ZIP (general files)

Techniques:

  • Run-length encoding (RLE): Replaces repeated sequences with a count and value. Example: AAAABBBCCD \to 4A3B2C1D.
  • Huffman coding: Uses shorter codes for more frequent characters and longer codes for less frequent ones.

Advantages:

  • No quality loss
  • Suitable for text, code, and documents

Disadvantages:

  • Smaller reduction in file size compared to lossy

6.4 Run-Length Encoding Example

Worked Example. Compress the following bitmap row using RLE: WWWWWBBBWWWWWW.

W5 B3 W6

Original: 12 bytes. Compressed: 6 bytes (assuming 1 byte per character and 1 byte per count).

When RLE is ineffective: RLE works well when there are long runs of the same value. For data Like ABABABABAB, RLE produces A1B1A1B1A1B1A1B1A1B1, which is larger than the original.

Worked Example. Compress the following data using RLE: AAAAAAABBBBCCCCCCDDDE.

A7 B4 C6 D3 E1.

Original: 21 bytes. Compressed: 10 bytes. Compression ratio: 21/10 = 2.1:1.

Worked Example (Higher Tier). A bitmap image has 64 pixels per row. Each row consists of 32 Black pixels followed by 32 white pixels. What is the compressed size using RLE (1 byte per count, 1 Byte per value)?

Two runs per row: B32 W32 = 4 bytes per row. If the image is 64 rows tall, compressed size = 64 ×\times 4 = 256 bytes. Original size = 64×64=409664 \times 64 = 4096 bytes. Compression ratio = 16:1.

6.5 Huffman Coding (Higher Tier)

Huffman coding assigns variable-length codes to characters based on their frequency. More frequent Characters get shorter codes, and no code is a prefix of another (prefix-free property).

Example. For the string “BCCABBDDAECCBBAEDDCC”:

CharacterFrequencyHuffman Code
B500
C601
D410
A3110
E2111

The most frequent character (C, 6 occurrences) gets the shortest code (01). The least frequent (E, 2 Occurrences) gets the longest code (111).

Why prefix-free? If the code for A were “1” and the code for B were “10”, then “10” could be Decoded as either B or A followed by the start of another character. Prefix-free codes eliminate This ambiguity, making decoding unambiguous.

Worked Example. Calculate the total number of bits to encode “BCCABBDDAECCBBAEDDCC” using the Huffman codes above.

5×2+6×2+4×2+3×3+2×3=10+12+8+9+6=455 \times 2 + 6 \times 2 + 4 \times 2 + 3 \times 3 + 2 \times 3 = 10 + 12 + 8 + 9 + 6 = 45 bits.

If fixed-width 3-bit codes were used (5 distinct characters need log25=3\lceil \log_2 5 \rceil = 3 bits): 20×3=6020 \times 3 = 60 bits.

Savings: (6045)/60×100=25%(60 - 45) / 60 \times 100 = 25\%.

Huffman tree construction. The Huffman tree is built by repeatedly combining the two Lowest-frequency nodes:

  1. Start with: A(3), B(5), C(6), D(4), E(2)
  2. Combine E(2) and A(3) to form EA(5)
  3. Combine D(4) and EA(5) to form DEA(9)
  4. Combine B(5) and C(6) to form BC(11)
  5. Combine DEA(9) and BC(11) to form the root

The left branch gets 0 and the right branch gets 1 at each merge. This gives the codes shown in the Table above.

7. Additional Worked Examples (Higher Tier)

7.1 Two’s Complement Range

For an nn-bit two’s complement number, the range is:

-2^{n-1} \mathrm{ to 2^{n-1} - 1

BitsRange
4-8 to 7
8-128 to 127
16-32768 to 32767
32-2147483648 to 2147483647

Why this asymmetry? There is one more negative number than positive number because zero is Represented as all zeros (positive). The pattern 1000100\ldots0 (MSB = 1, rest = 0) represents 2n1-2^{n-1}And there is no corresponding positive value 2n12^{n-1}.

7.2 Binary Multiplication (Higher Tier)

Binary multiplication is performed using long multiplication, similar to denary.

Worked Example. Calculate 6×36 \times 3 in binary.

6=01106 = 0110, 3=00113 = 0011.

0110
x 0011
------
0110 (0110 x 1, shifted 0)
0110 (0110 x 1, shifted 1)
------
10010 = 18

Common Pitfalls

  • Confusing bits and bytes. 1 byte = 8 bits. A 24-bit colour depth is 3 bytes per pixel.
  • Forgetting that 1 KB = 1024 bytes, not 1000. (Though in some contexts, kB = 1000 bytes.)
  • Not counting leading zeros in binary conversions. An 8-bit number must have exactly 8 digits. The number 5 in 8-bit binary is 00000101, not 101.
  • Confusing lossy and lossless compression. Lossy = data permanently lost (JPEG); lossless = no data lost (PNG).
  • Calculating image file size incorrectly. Remember to multiply by the colour depth in bits, then convert to bytes (divide by 8), then to KB (divide by 1024).
  • Forgetting to convert units when calculating file sizes. Divide by 8 for bits to bytes, then by 1024 for KB, then by 1024 for MB.
  • Forgetting to multiply by the number of channels when calculating audio file size. Stereo has 2 channels, so the file size is doubled compared to mono.
  • Assuming RLE always reduces file size. RLE increases file size when there are few or no repeated values.
  • Forgetting to pad binary numbers when converting to hexadecimal. Always group from the right; add leading zeros if necessary.
  • Confusing the MSB in two’s complement with a simple sign bit. In two’s complement, the MSB carries a negative weight of 2n1-2^{n-1}Not just a sign.

Practice Questions

  1. Convert the binary number 10110101 to denary and to hexadecimal.

  2. Convert the hexadecimal number 2AF to binary and to denary.

  3. A bitmap image is 1024 ×\times 768 pixels with a colour depth of 16 bits. Calculate the file size in megabytes.

  4. A sound file is recorded at 22050 Hz with 8-bit resolution for 2 minutes. Calculate the file size in megabytes.

  5. Use run-length encoding to compress: AAAAABBCCCCCCCCCCDD.

  6. Explain the difference between lossy and lossless compression, giving an appropriate use for each.

  7. Why is the character ‘A’ stored as 1000001 in ASCII? Explain what this binary value represents.

  8. An image file is 2.5 MB. If the colour depth is increased from 8 bits to 24 bits, what will the new file size be?

  9. Explain why hexadecimal is often used to represent binary values in computing.

  10. Calculate the file size of a 30-second stereo (2 channels) audio recording at 48000 Hz with 16-bit resolution.

  11. (Higher Tier) Calculate 1101 + 0111 in binary. Show all working.

  12. (Higher Tier) Calculate 15815 - 8 using two’s complement in 5-bit binary. Show all working.

  13. (Higher Tier) Explain the difference between a bitmap image and a vector image. Give an appropriate use case for each.

  14. (Higher Tier) A 4-minute stereo audio file is 25 MB. If the sample rate is 44100 Hz, what is the bit depth?

  15. (Higher Tier) Calculate 9×59 \times 5 in binary using long multiplication. Show all working.

  16. (Higher Tier) The string “MISSISSIPPI” is to be encoded using Huffman coding. Calculate the frequency of each character and determine which character would receive the shortest code.

  17. (Higher Tier) Explain why the two’s complement representation of 128-128 in 8 bits is 10000000, but there is no representation of +128+128 in 8-bit two’s complement.

  18. (Higher Tier) An image has resolution 2048 ×\times 1536. Compressed with RLE, each row averages 12 runs. If each run uses 1 byte for the count and 1 byte for the pixel value, calculate the compressed file size in KB and the compression ratio for a 24-bit image.

Worked Examples

Example 1:

A typical exam question on Data Representation requires you to apply your knowledge to an unfamiliar context. Read the question carefully, identify the key concept being tested, and structure your answer using the appropriate terminology.

Example 2:

Multi-step problems in Data Representation often combine two or more concepts. Break the problem down: identify what you need to find, recall the relevant formula or principle, substitute values, and state your answer with correct units or formatting.

Summary

This topic covers the core concepts of data representation, including underlying theory, practical implementation, and key applications.

Key concepts include:

  • CPU architecture and the fetch-decode-execute cycle
  • memory hierarchy (cache, RAM, virtual)
  • input/output systems
  • operating systems and scheduling
  • interrupts and polling

Understanding these concepts thoroughly is essential for both examinations and practical programming, and requires both theoretical knowledge and hands-on practice.

:::