πΎ 1. Data Storage Units
π Basic Unitsβ
| Unit | Meaning |
|---|---|
| Bit | Single binary digit (0 or 1) |
| Nibble | 4 bits |
| Byte | 8 bits |
π Larger Units (IMPORTANT: base 1024)β
| Unit | Equivalent |
|---|---|
| 1 KiB | 1024 bytes |
| 1 MiB | 1024 KiB |
| 1 GiB | 1024 MiB |
| 1 TiB | 1024 GiB |
| 1 PiB | 1024 TiB |
| 1 EiB | 1024 PiB |
β οΈ Important Ruleβ
- Always use 1024 (NOT 1000) in calculations
Example Conversionβ
Convert 2048 bytes β KiB
π Exam Tips
- Show working clearly
- Use correct units (KiB, MiBβnot KB, MB unless specified)
- Check what unit the answer must be in
πΌοΈ 2. File Size Calculations
π· Image File Sizeβ
Formulaβ
π Then convert bits β bytes:
Exampleβ
Image:
- Resolution = 800 Γ 600
- Colour depth = 24 bits
Step 1: Total pixels
Step 2: Total bits
Step 3: Convert to bytes
Step 4: Convert to KiB
π Exam Tip:
Always include:
- Pixels calculation
- Multiply by colour depth
- Divide by 8
π Sound File Sizeβ
Formulaβ
π Then divide by 8 to get bytes
Exampleβ
Sound:
- Sample rate = 44,100 Hz
- Resolution = 16 bits
- Time = 10 seconds
Step 1:
Step 2: Convert to bytes
Step 3: Convert to KiB
π Exam Tip:
Donβt forget:
- Multiply ALL three values
- Include time in seconds
π¦ 3. Purpose of Data Compression
π Definitionβ
Compression = reducing the size of a file
π― Why Compression is Neededβ
- Saves storage space
- Reduces bandwidth usage
- Speeds up file transfer
- Reduces download/upload time
π Real-Life Examplesβ
- Sending images via WhatsApp
- Streaming music/videos
- Storing files on phones
π Exam Tip:
Use phrases like:
- βreduces file sizeβ
- βreduces transmission timeβ
- βrequires less storage spaceβ
π½ 4. Types of Compression
πΉ Lossy Compression
π Definitionβ
- Removes data permanently
- Cannot restore original file exactly
How It Worksβ
- Removes less important data
- Reduces:
- Image resolution
- Colour depth
- Sound sample rate/resolution
Examplesβ
- JPEG (images)
- MP3 (audio)
Advantagesβ
- Much smaller file size
Disadvantagesβ
- Loss of quality
- Data cannot be recovered
π Exam Tip:
Always say:
- βpermanent data lossβ
πΉ Lossless Compression
π Definitionβ
- Reduces file size without losing data
- Original file can be perfectly restored
How It Worksβ
- Identifies patterns and removes redundancy
Example: Run Length Encoding (RLE)β
Example Dataβ
AAAAAAABBBCC
Compressedβ
7A 3B 2C
Advantagesβ
- No data loss
- Perfect reconstruction
Disadvantagesβ
- Smaller reduction compared to lossy
π Exam Tip:
Say:
- βno loss of dataβ
- βoriginal file can be reconstructedβ
βοΈ Lossy vs Lossless
| Feature | Lossy | Lossless |
|---|---|---|
| Data loss | Yes (permanent) | No |
| File size | Very small | Smaller |
| Quality | Reduced | Unchanged |
| Examples | JPEG, MP3 | RLE, PNG |
π§ Key Definitions
- Compression: Reducing file size
- Bandwidth: Amount of data that can be transmitted
- RLE: Run Length Encoding (repeating data compression)
- Resolution: Number of pixels in image
- Colour Depth: Bits per pixel
- Sample Rate: Samples per second
- Sample Resolution: Bits per sample
β οΈ Common Exam Mistakes
β Using 1000 instead of 1024
β Forgetting to divide by 8 (bits β bytes)
β Missing time in sound calculations
β Mixing up:
- Lossy vs Lossless
- Resolution vs Colour depth
π High-Value Exam Answers
Why is compression needed?β
- Reduces file size β saves storage
- Faster transmission β less bandwidth
Difference between lossy and losslessβ
- Lossy β permanent data loss
- Lossless β no data loss, original can be restored
Why is RLE effective?β
- Works well with repeated data
- Stores patterns instead of individual values
π₯ Final Quick Summary
- Storage units use base 1024
- Image size = pixels Γ colour depth
- Sound size = rate Γ resolution Γ time
- Lossy = smaller but loses data
- Lossless = no data loss
- Compression saves space + time + bandwidth