Data Storage
- Data storage is measured in a variety of units, each representing a different size of storage capacity. The smallest unit of measurement is the bit, which represents a single binary digit (either 0 or 1)
- A nibble is a group of 4 bits, while a byte is a group of 8 bits
- Kibibyte (KiB), mebibyte (MiB), gibibyte (GiB), tebibyte (TiB), pebibyte (PiB), and exbibyte (EiB) are all larger units of measurement
- Specifically, 1 KiB is equal to 210 bytes, 1 MiB is equal to 220 bytes, 1 GiB is equal to 230 bytes, 1 TiB is equal to 240 bytes, 1 PiB is equal to 250 bytes, and 1 EiB is equal to 260 bytes
To calculate the file size of an image file:
- Determine the resolution of the image in pixels (width x height)
- Determine the colour depth in bits (e.g. 8 bits for 256 colours)
- Multiply the number of pixels by the colour depth to get the total number of bits
- Divide the total number of bits by 8 to get the file size in bytes
- If necessary, convert to larger units like kibibytes, mebibytes, etc
Calculating image file size walkthrough:
An image measures 100 by 80 pixels and has 128 colours (so this must use 7 bits)
100 x 80 x 7 = 56000 bits ÷ 8 = 7000 bytes ÷ 1024 = 6.84 kibibytes
To calculate the file size of a sound file:
- Determine the sample rate in Hz (e.g. 44,100 Hz)
- Determine the sample resolution in bits (e.g. 16 bits)
- Determine the length of the track in seconds
- Multiply the sample rate by the sample resolution to get the number of bits per second
- Multiply the number of bits per second by the length of the track to get the total number of bits
- Divide the total number of bits by 8 to get the file size in bytes
- If necessary, convert to larger units like kibibytes, mebibytes, etc
Calculating sound file size walkthrough:
A sound clip uses 48KHz sample rate, 24 bit resolution and is 30 seconds long.
48000 x 24 = 1152000 bits per second x 30 = 34560000 bits for the whole clip
34560000 ÷ 8 = 4320000 bytes ÷ 1024 = 4218.75 kibibytes ÷ 1024 = 4.12 mebibytes
Exam Tip
- Remember to always use the units specified in the question when giving the final answer.