We’re moving to a new home! Our website is currently in test mode while we update and transfer our content. Some pages and resources may be temporarily unavailable. We’ll be back with all resources shortly. Thank you for your patience.

CIE IGCSE | TOPIC 1

DATA REPRESENTATION REVISION

Recall the key ideas, practise the calculations and select the cards you need to revisit. Cover number systems, text, sound, images, storage and compression.

YOUR REVISION ROUTE

Use the summaries below to reconnect the ideas. Then close your notes and test yourself in the Flashcards tab. Mark uncertain cards to build a revision list and revisit their linked lessons.

1.1 | NUMBER SYSTEMS

Computers represent data using binary patterns. The same pattern can mean a number, a character or a colour, depending on the representation. Start by separating the stored bits from the meaning assigned to them.

1.1.1 | WHY BINARY?

Electronic circuits can distinguish two states reliably, such as high and low voltage. We represent them using 0 and 1. Binary fits these two states, making information straightforward to represent and process.

A bit is one binary digit. A nibble is four bits and a byte is eight. Each extra bit doubles the possible patterns. Eight bits provide 2⁸ = 256 patterns, representing 0 to 255 when interpreted as unsigned integers.

In an explanation, link the two digits to two distinguishable physical states. Saying “computers understand only binary” does not explain why it is suitable.

1.1.2 | CONVERT BETWEEN BASES

Number systems at a glance
SystemBaseDigits
Binary20 and 1
Denary100 to 9
Hexadecimal160 to 9 and A to F

Place values are powers of the base. In hexadecimal, A to F represent denary 10 to 15.

Eight-bit binary representation of 45
1286432168421
00101101

Add the weights of the columns containing a 1: 32 + 8 + 4 + 1 = 45. To convert denary to binary, choose the largest available weight, subtract it and repeat with the remainder.

One hex digit represents exactly four bits. Group binary digits from the right, adding leading zeros if necessary.

00101101₂ → 0010 | 1101 → 2 | D → 2D₁₆
2D₁₆ → (2 × 16) + 13 = 45₁₀
Hexadecimal place values for 1234₁₆
4096256161
1234

1234₁₆ = 4096 + 512 + 48 + 4 = 4660₁₀. For denary to hex, divide repeatedly by 16 and read remainders from the last to the first.

CHECK YOUR RECALL | Convert 10100110₂ to hex and denary.

1010 = A and 0110 = 6, so A6₁₆. Denary: 128 + 32 + 4 + 2 = 166.

1.1.3 | WHY HEX IS USEFUL

Hexadecimal is a compact notation for binary values. Eight bits need only two hex digits; sixteen bits need four. Shorter patterns are easier for people to read, copy and check.

Examples include colour codes, memory addresses and diagnostic codes. In the colour code #24988F, the pairs 24, 98 and 8F represent red, green and blue values. Hex is useful for displaying the data, but writing it in hex does not automatically reduce the underlying stored value.

1.1.4 | ADDITION AND OVERFLOW

Add from the right. In each column, include any incoming carry. For 1 + 1, write 0 and carry 1. For 1 + 1 + 1, write 1 and carry 1. Each cell below contains one bit; the green row shows incoming carries.

13 + 7 = 20, with incoming carries above the operands
Row1286432168421
Incoming carry00011110
First byte: 1300001101
Second byte: 700000111
Sum: 2000010100

Unsigned eight-bit overflow occurs when a result exceeds 255. Adding 11111111 and 00000001 gives a full result of 1 00000000. The carry beyond eight bits cannot fit in the byte.

Use denary as a check. This overflow rule concerns unsigned addition; signed two’s complement overflow must be judged against its signed range.

1.1.5 | LOGICAL SHIFTS

Logical shifts move bits, fill newly empty positions with zeros and discard bits that move outside the fixed width.

Read the bits and check the numerical effect
OperationBeforeAfterUnsigned effect
Left by 1000011010001101013 → 26
Right by 1000011010000011013 → 6
Left by 11100000110000010193 → 130; leading 1 lost

Shifting left by n positions multiplies by 2ⁿ only if significant bits are not lost. Shifting unsigned data right divides by 2ⁿ and discards the remainder. Right-shifting 13 by one gives 6, not 6.5.

1.1.6 | TWO’S COMPLEMENT

Two’s complement represents signed integers. In eight bits, the weights are −128, 64, 32, 16, 8, 4, 2, 1. The range is −128 to +127.

To construct −10, write +10 in eight bits, invert each bit and add one.

+10:       00001010
Invert:    11110101
Add 1:     11110110

Decode it using its signed weights: −128 + 64 + 32 + 16 + 4 + 2 = −10. The same 11110110 pattern represents unsigned 246 if interpreted differently.

10000000 represents −128. There is no +128 in the signed eight-bit range. Always check whether a question specifies unsigned or two’s complement representation.

CHECK YOUR RECALL | Represent −5 in eight-bit two’s complement.

+5 is 00000101. Invert to 11111010 and add 1 to obtain 11111011. Check: −128 + 64 + 32 + 16 + 8 + 2 + 1 = −5.

1.2 | TEXT, SOUND AND IMAGES

Bits are the storage medium, but each type of data needs a representation rule. Text assigns codes to characters, sound stores sampled values and bitmap images store pixel values.

1.2.1 | REPRESENTING TEXT

A character set defines characters and their assigned codes. Encoding determines how those codes are stored as bytes. Software must interpret the data with the appropriate encoding to display the intended text.

Standard ASCII provides 128 codes using seven bits. ASCII data is often stored in a byte with a leading zero. For example, uppercase A has denary code 65, represented as 01000001 in a byte.

Unicode supports a much wider range of writing systems and symbols. It is useful for multilingual text. Unicode does not mean that every character always occupies two bytes: UTF-8 uses one to four bytes per encoded Unicode code point.

A wrong decoding choice can produce garbled characters. A missing font glyph is a different issue: the code may be correct even if the font cannot draw it.

CHECK YOUR RECALL | Why is Unicode more suitable for multilingual text than standard ASCII?

Unicode assigns codes to a far wider range of scripts and symbols. Standard ASCII has only 128 codes and cannot represent all the characters needed across languages.

1.2.2 | REPRESENTING SOUND

Sound begins as a changing analogue signal. To represent it digitally, measure its amplitude at regular intervals and encode the samples as binary values.

Keep rate and resolution separate
PropertyMeaningEffect of increasing it, with other settings fixed
Sample rateSamples each second, in HzMore samples, potentially better capture of changes and larger raw data
Sample resolution / bit depthBits per sampleMore amplitude levels, less quantisation error and larger raw data

Sampling chooses the measurement times. Quantisation maps each measured amplitude to an available level. With d bits per sample, up to 2ᵈ levels are available.

More samples improve time detail; more levels improve amplitude detail. Increasing settings cannot recover information that was absent from the original recording.

CHECK YOUR RECALL | A recording keeps its duration and bit depth but doubles its sample rate. What happens to raw data size?

It doubles because twice as many samples are recorded over the same duration.

1.2.3 | REPRESENTING IMAGES

A bitmap is a grid of pixels. Each pixel has a colour value represented using binary. Image resolution is commonly given as width × height in pixels; multiplying them gives the total pixel count.

Colour depth is bits per pixel in the given model. With d bits there are up to 2ᵈ colour values: 1 bit allows 2, 4 bits allow 16 and 8 bits allow 256.

Two independent properties
ChangeQuality effectRaw size effect
More pixelsCan represent finer spatial detailIncreases with pixel count
More bits per pixelCan represent finer colour differencesIncreases with bits per pixel

An 8-bit image means eight bits per pixel, not eight colours. Eight bits per channel across red, green and blue means 24 bits per pixel, so read labels carefully.

Enlarging a small bitmap can make pixels visible without recreating missing detail. Doubling both dimensions gives four times as many pixels, with depth fixed.

CHECK YOUR RECALL | What changes when a 400 × 300 image changes from 8-bit to 16-bit depth?

Pixel count stays at 120000. The number of representable colour values increases from 256 to 65536, and the raw pixel data size doubles.

1.3 | DATA STORAGE AND COMPRESSION

File-size calculations count bits, then convert units. Compression changes how the data is represented to reduce stored or transferred size. Keep the raw calculation separate from a compressed file’s actual size.

1.3.1 | STORAGE UNITS

Binary storage units
UnitRelationship
Nibble4 bits
Byte8 bits
KiB1024 bytes
MiB1024 KiB
GiB1024 MiB
TiB1024 GiB
PiB1024 TiB
EiB1024 PiB

Moving to a smaller byte-based unit: multiply by 1024 for each step. Moving to a larger unit: divide by 1024 for each step. Bits and bytes have their own factor of 8.

16384 bits ÷ 8 = 2048 bytes
2048 bytes ÷ 1024 = 2 KiB

Use 1024 for these Cambridge storage calculations. Decimal labels differ: 1 kB is 1000 bytes, whereas 1 KiB is 1024 bytes. Write the requested unit beside your answer.

1.3.2 | IMAGE AND SOUND FILE SIZE

Count first, convert second
Raw dataFormula for bits
Bitmap imageWidth × height × bits per pixel
Mono sampled soundRate in Hz × seconds × bits per sample

Image example: a 640 × 480 image at 8 bits per pixel:

640 × 480 × 8 = 2457600 bits
÷ 8 = 307200 bytes
÷ 1024 = 300 KiB

Sound example: a 10-second mono clip at 8000 Hz and 16 bits per sample:

8000 × 10 × 16 = 1280000 bits
÷ 8 = 160000 bytes
÷ 1024 = 156.25 KiB

Convert minutes to seconds first. To reach MiB from bytes, divide by 1024 twice. If a question specifies stereo at the same settings, multiply the mono data by two for its two channels.

The formulas exclude headers, metadata, palette information, padding and compression. They do not predict exact JPEG or MP3 sizes.

CHECK YOUR RECALL | Calculate a 256 × 128 image at 16 bits per pixel in KiB.

256 × 128 × 16 = 524288 bits. Divide by 8 to get 65536 bytes, then by 1024 to get 64 KiB.

1.3.3 | WHY COMPRESS DATA?

Smaller files require less storage and less data transfer. With the same transfer conditions, they can be sent or downloaded more quickly. This matters for limited device storage, sharing files and delivering media online.

Do not claim that compression itself increases the connection’s speed. It reduces the amount of data the connection must carry. Compression and decompression also require processing.

Compression is not encryption. A smaller file is not automatically confidential.

1.3.4 | LOSSY AND LOSSLESS

Choose the method for the purpose
FeatureLosslessLossy
Exact original recoveryYes, with correct decodingNo, not from the compressed file alone
ApproachEfficient representation preserving informationDiscard information and encode efficiently
Typical choiceCode, text, exact recordsPhotos and sound when some loss is acceptable
ExamplesZIP archives, PNG imagesJPEG commonly, MP3

Lossy compression can produce acceptable media quality with substantial savings, but aggressive settings can introduce artefacts. Keep an original or lossless master for future editing.

Run-length encoding is a lossless example. It records consecutive repeated values as a value and count.

AAAAABBBCC → (A,5) (B,3) (C,2)

Assuming one byte per symbol and one per count, ten original bytes become six encoded bytes, ignoring overhead. For ABCDEF, six one-symbol runs need twelve bytes by the same model. Lossless does not guarantee every file becomes smaller.

CHECK YOUR RECALL | Why choose lossless compression for source code?

Every original character must be restored exactly. Discarding information could alter instructions or stop the program working.

COMMON MISTAKES TO CATCH

  • Using 256 instead of 8 as the depth of an 8-bit image.
  • Confusing sample rate with bits per sample.
  • Leaving a duration in minutes.
  • Converting bits directly to KiB without dividing by 8.
  • Treating unsigned values and two’s complement values as identical.
  • Assuming a left shift always gives the full product despite discarded bits.
  • Claiming every lossless compression makes every file smaller.

READY TO TEST YOURSELF?

Try answering without your notes. Use the Flashcards tab to check your recall and build a focused revision list.