1. Data storage and File compression
IGCSE Computer Science (0478)
  • Data Representation
    • Introduction
    • Why computers use binary (how binary represents data)
    • Number system
      • Introduction
      • Number Conversions
      • Addition of Binary Numbers
      • Logical binary shifts (positive 8-bit integers)
      • Two’s Complement (Signed: Positive and Negative Numbers)
      • Use of the Hexadecimal System
    • Text, Sound and Image
      • Text, Sound and Images
      • File Types
    • Data storage and File compression
      • Measurement of the Size of Computer Memories
      • Lossless and Lossy File Compression
  1. Data storage and File compression

Measurement of the Size of Computer Memories

A bit is a binary digit (0 or 1).
8 bits make 1 byte.
4 bits make 1 nibble.
Memory size is usually measured in bytes and its multiples.

IECB System (Most Common Binary System)#

Memory Size NameNumber of BytesEquivalent in Denary
1 kibibyte (1 KiB)2¹⁰ = 1,0241,024 bytes
1 mebibyte (1 MiB)2²⁰ = 1,048,5761,048,576 bytes
1 gibibyte (1 GiB)2³⁰ = 1,073,741,8241,073,741,824 bytes
1 tebibyte (1 TiB)2⁴⁰ = 1,099,511,627,7761,099,511,627,776 bytes
1 pebibyte (1 PiB)2⁵⁰ = 1,125,899,906,842,6241,125,899,906,842,624 bytes

Conventional System (Decimal-Based)#

Memory Size NameNumber of BytesEquivalent in Denary
1 kilobyte (1 KB)10³ = 1,0001,000 bytes
1 megabyte (1 MB)10⁶ = 1,000,0001,000,000 bytes
1 gigabyte (1 GB)10⁹ = 1,000,000,0001,000,000,000 bytes
1 terabyte (1 TB)10¹² = 1,000,000,000,0001,000,000,000,000 bytes
1 petabyte (1 PB)10¹⁵ = 1,000,000,000,000,0001,000,000,000,000,000 bytes

Calculating File Size#

Image file size = image resolution (pixels) × colour depth (bits)
Mono sound file size = sample rate (Hz) × bit depth (bits) × length (seconds)
For stereo, multiply the above by 2.

Sample Question#

Find the size of a bitmap image with:
Width = 500 pixels
Height = 500 pixels
Colour depth = 24 bits
Working:
Using bits:
500 × 500 × 24 = 6,000,000 bits
Convert bits to bytes:
6,000,000 ÷ 8 = 750,000 bytes
Convert bytes to KiB:
750,000 ÷ 1024 ≈ 732 KiB
OR
Using bytes directly (since 24 bits = 3 bytes):
500 × 500 × 3 = 750,000 bytes ≈ 732 KiB
image.png
Modified at 2025-08-11 07:24:25
Previous
File Types
Next
Lossless and Lossy File Compression
Built with