Information Representation
Binary number systems, character encoding, multimedia data and compression — the foundation of how computers store everything.
1.1 Data Representation
Binary Magnitudes and Prefixes
Computers use binary (base-2). When measuring storage sizes, there are two systems of prefixes — and knowing the difference is exam-essential.
Number Systems
You need to confidently work in four number systems:
| System | Base | Digits Used | Prefix / Notation |
|---|---|---|---|
| Binary | 2 | 0, 1 | 0b… or B in pseudocode |
| Denary (Decimal) | 10 | 0–9 | None (default) |
| Hexadecimal | 16 | 0–9, A–F | 0x… or & in pseudocode |
| BCD | 10 (binary coded) | 0–9 each in 4 bits | Each digit → 4 bits |
Binary Addition and Subtraction
Addition rules: 0+0=0 · 0+1=1 · 1+1=10 (carry 1) · 1+1+1=11 (sum 1, carry 1)
Overflow occurs when the result of an arithmetic operation is too large to be stored in the available number of bits. For an 8-bit register, values above 255 (unsigned) or ±127 (signed) cause overflow. The overflow bit in the Status Register is set to 1.
Two's Complement (Negative Numbers)
Two's complement is the standard way computers represent negative integers. The most significant bit (MSB) acts as the sign bit: 0 = positive, 1 = negative.
8-bit Unsigned Range
- Minimum: 0
- Maximum: 255 (2⁸−1)
- Total values: 256
- No negative numbers
8-bit Two's Complement Range
- Minimum: −128
- Maximum: +127
- Total values: 256
- MSB = sign bit (1=negative)
Binary Coded Decimal (BCD)
BCD encodes each decimal digit (0–9) separately as a 4-bit binary pattern. The digit 9 = 1001 in BCD.
Where BCD is used:
- Digital clocks & displays
- ATM machines (currency)
- Point-of-sale systems
- Calculators
Hexadecimal
Hex (base 16) is a compact way to represent binary. Each hex digit represents exactly 4 binary bits, making it ideal for humans reading binary data.
| Denary | Binary | Hex | Denary | Binary | Hex |
|---|---|---|---|---|---|
| 0 | 0000 | 0 | 8 | 1000 | 8 |
| 1 | 0001 | 1 | 9 | 1001 | 9 |
| 2 | 0010 | 2 | 10 | 1010 | A |
| 3 | 0011 | 3 | 11 | 1011 | B |
| 4 | 0100 | 4 | 12 | 1100 | C |
| 5 | 0101 | 5 | 13 | 1101 | D |
| 6 | 0110 | 6 | 14 | 1110 | E |
| 7 | 0111 | 7 | 15 | 1111 | F |
Where Hex is used: Memory addresses · MAC addresses · HTML colour codes (#FF5733) · Assembly language operands · IPv6 addresses
Character Sets (ASCII & Unicode)
ASCII (7-bit)
- 128 characters (0–127)
- Extended ASCII: 256 chars (8-bit)
- Covers English + symbols
- 'A' = 65, 'a' = 97, '0' = 48
- 1 byte per character
Unicode (UTF-8/16/32)
- Over 1 million code points
- Covers all world languages + emoji
- UTF-8: 1–4 bytes per char
- Backwards compatible with ASCII
- Industry standard for the web
1.2 Multimedia — Graphics & Sound
Bitmap Images
A bitmap is a grid of individual pixels, each storing a colour value in binary. The word "bitmap" literally means a "map of bits".
Key Terms:
| Term | Definition |
|---|---|
| Pixel | A single dot in the image grid — the smallest unit of a bitmap |
| Image Resolution | The number of pixels in the image (e.g. 1920×1080) |
| Screen Resolution | The number of pixels per inch (PPI) the screen can display |
| Colour Depth / Bit Depth | Number of bits used per pixel (e.g. 8-bit = 256 colours) |
| File Header | Metadata stored at the start of the file (width, height, colour depth, etc.) |
Calculating Bitmap File Size
File Size (bytes) = File Size (bits) ÷ 8
Vector Graphics
A vector graphic stores images as mathematical instructions (drawing objects with properties) rather than a pixel grid.
| Term | Meaning | Example |
|---|---|---|
| Drawing Object | A shape defined mathematically | Circle, rectangle, line |
| Property | An attribute of a drawing object | Radius=50, Fill=Blue, Stroke=2px |
| Drawing List | The ordered list of all drawing objects | File format stores all shapes |
✅ Use Bitmap When…
- Photographs with complex colour
- Images need pixel-level editing
- Gradient/texture-heavy images
- Screen display at fixed size
✅ Use Vector When…
- Logos and icons (scalable)
- Technical/engineering diagrams
- Text and typography
- Infinite zoom without quality loss
Sound Encoding
Sound is an analogue signal (continuous). To store it digitally, we must sample it — measure the amplitude at regular intervals and convert each measurement to a binary value.
| Term | Definition | Effect of Increasing |
|---|---|---|
| Sampling | Measuring amplitude of sound at regular intervals | — |
| Sampling Rate | Number of samples taken per second (Hz) | Higher quality, larger file |
| Sampling Resolution | Number of bits per sample (bit depth) | More amplitude detail, larger file |
1.3 Compression
Compression reduces file size by encoding data more efficiently. There are two fundamental types:
Lossless Compression
- Original data fully recoverable
- No quality loss at all
- Smaller size reduction
- Used for: text, programs, PNG
- Methods: RLE, Huffman coding
Lossy Compression
- Some data permanently removed
- Quality degrades (often imperceptibly)
- Much greater size reduction
- Used for: photos (JPEG), MP3, video
- Cannot be reversed
Run-Length Encoding (RLE)
RLE replaces consecutive repeated values with a (count, value) pair. It is a lossless compression technique that works well for images with large areas of the same colour (e.g. clipart, simple logos).
RLE is ineffective on photographs (few repeating pixels) — in those cases lossy compression (JPEG) is far better.
| File Type | Best Compression | Reason |
|---|---|---|
| Text file (.txt) | Lossless (e.g. ZIP) | Every character matters — cannot lose any |
| Bitmap (.bmp) | Lossless (RLE, PNG) | RLE works well for simple/uniform areas |
| Vector graphic (.svg) | Lossless | Mathematical — no quality to degrade |
| Photograph (.jpg) | Lossy (JPEG) | Removes imperceptible colour detail |
| Audio (.mp3) | Lossy | Removes frequencies humans can't hear |
