Detailed · Deep study
1Measuring data storage
| Unit | Size |
|---|---|
| bit | 1 binary digit |
| nibble | 4 bits |
| byte | 8 bits |
| kibibyte (KiB) | 1024 bytes |
| mebibyte (MiB) | 1024 KiB |
| gibibyte (GiB) | 1024 MiB |
| tebibyte (TiB) | 1024 GiB |
| pebibyte (PiB) | 1024 TiB |
| exbibyte (EiB) | 1024 PiB |
2Calculating file sizes
Worked example
Image file
An image is 1920 × 1080 pixels with a colour depth of 24 bits. Calculate its size in MiB.
- 1
Bits.
bits
- 2
Bytes.
bytes
- 3
MiB.
Answer5.93 MiB
Worked example
Sound file
A 3-minute track is sampled at 44 100 Hz with a 16-bit sample resolution (mono). Calculate its size in MiB.
- 1
Bits.
- 2
Bytes, then MiB.
Answer15.1 MiB
3Why compress data?
- less storage space is needed on devices and servers
- less bandwidth is used when sending files
- files transmit faster (shorter download and upload times)
- streaming is smoother and costs less data
4Lossy and lossless compression
| Lossy | Lossless | |
|---|---|---|
| what happens | data is permanently removed | no data is lost; the original can be restored exactly |
| methods | reduce resolution or colour depth; reduce sample rate or resolution; remove sounds people cannot hear (e.g. MP3), detail the eye does not notice (e.g. JPEG) | run length encoding (RLE); finding repeated patterns |
| file size | much smaller | smaller, but not as small as lossy |
| use for | photos, music, video | text, program files, spreadsheets – where every bit matters |
Run length encoding (RLE) stores each run of identical data as a count and the value. It works well for data with long runs, such as simple images with large areas of one colour.
5Exam focus
Key words: bit; nibble; byte; KiB; MiB; GiB; file size; compression; lossy; lossless; run length encoding.
Quick self-check
Answer in your head first, then reveal.
2048 (1).
(1) = 468.75 KiB (1).
No data can be lost (1); otherwise the program would not run correctly (1).
4A 3B 6C (1).
Any two: less bandwidth; faster upload; less storage (2).
