IGCSE Computer Science Notes: Data Representation
1. Number Systems
• Denary (Decimal): Base-10 system, digits 0–9. Everyday number system.
• Binary: Base-2 system, digits 0 and 1. Used in computers because hardware operates with ON (1)
and OFF (0) signals.
• Hexadecimal: Base-16 system, digits 0–9 and A–F. Easier shorthand for binary since 1 hex digit =
4 binary digits.
Example: Convert binary 10101101 to denary:
128 64 32 16 8 4 2 1 → 1 0 1 0 1 1 0 1 = 128 + 32 + 8 + 4 + 1 = 173
Example: Convert denary 142 to binary (method 1: subtract powers of 2): 142 – 128 = 14; 14 – 8 =
6; 6 – 4 = 2; 2 – 2 = 0 → 10001110
Example: Convert denary 2004 to hex (method: divide by 16): 2004 ÷ 16 = 125 r 4; 125 ÷ 16 = 7 r
13 (D); 7 ÷ 16 = 0 r 7 → 7D4
Binary Addition Rules:
Binary Digits Carry Sum
0+0 0 0
0+1 0 1
1+0 0 1
1+1 1 0
Overflow occurs if the result exceeds the maximum bits available (e.g., 8-bit max = 255). Example:
222 + 110 causes overflow in 8-bit.
Logical Binary Shifts:
• Left shift = multiply by 2. Example: 00010101 (21) → left shift → 00101010 (42).
• Right shift = divide by 2. Example: 11001000 (200) → right shift → 01100100 (100).
Two’s Complement (Negative Numbers):
• Left-most bit represents sign (0 = positive, 1 = negative).
• Range for 8-bit = -128 to +127.
Method to find negative: Write positive binary, invert digits, add 1. Example: +67 = 01000011 →
invert = 10111100 → add 1 = 10111101 (–67).
2. Text, Sound and Images
ASCII: 7-bit code (128 characters). Extended ASCII: 8-bit (256 characters).
Unicode: Supports all global characters (up to 4 bytes per character). Used in modern systems,
supports emojis and non-English scripts.
Images:
• Bitmap images are stored as pixels (smallest unit).
• Resolution = width × height. Colour depth = bits per pixel.
• File Size = Resolution × Colour Depth.
Example: Image 800×600 at 24-bit colour depth = 800 × 600 × 24 = 11,520,000 bits ≈ 1.44 MB.
Sound:
• Analogue sound is continuous; computers convert it into digital using sampling.
• Sample rate = samples per second (Hz). Bit depth = bits per sample.
• File Size = Sample rate × Bit depth × Duration.
Example: 44,100 Hz, 16-bit, 120 seconds = 44,100 × 16 × 120 ≈ 84.7 million bits ≈ 10.1 MB.
3. Data Storage and Compression
Units of Storage:
1 bit = 0 or 1; 1 nibble = 4 bits; 1 byte = 8 bits.
1 KB = 1024 bytes; 1 MB = 1024 KB; 1 GB = 1024 MB; 1 TB = 1024 GB.
Compression:
• Lossless: No data lost (e.g., ZIP). Used for text and data files.
• Lossy: Removes data permanently, reduces quality (e.g., MP3, JPEG). Used for multimedia.