1.3 Data Storage and Compression
1.3 Data Storage and Compression
Page 1 of 4
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to savemyexams.com for more awesome resources
Data Storage
Your notes
Data Storage
Data storage is measured in a variety of units, each representing a different siz e 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 siz e 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 siz e 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 siz e 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 siz e 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
Page 2 of 4
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to savemyexams.com for more awesome resources
Exam Tip
Your notes
Remember to always use the units specified in the question when giving the final answer.
Page 3 of 4
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to savemyexams.com for more awesome resources
Compression
Your notes
Compression
Compression is reducing the siz e of a file. This is done to reduce the amount of storage space it
takes up or to reduce the bandwidth when sending a file. There are 2 types of compression:
Lossless Compression:
A compression algorithm is used to reduces the file size without permanently removing any
data
Repeated patterns in the file are identified and indexed
The data is replaced with the index and positions stored
The number of times the pattern appears is also stored
Techniques like run-length encoding (RLE) and Huffman encoding are used
RLE replaces sequences of repeated characters with a code that represents the
character and the number of times it is repeated
Huffman encoding replaces frequently used characters with shorter codes and less
frequently used characters with longer codes
Lossy Compression:
Lossy compression reduces the file siz e by permanently removing some data from the file
This method is often used for images and audio files where minor details or data can be
removed without significantly impacting the quality
Techniques like downsampling, reducing resolution or colour depth, and reducing the
sample rate or resolution are used for lossy compression
The amount of data removed depends on the level of compression selected and can impact
the quality of the final file
Overall:
Compression is necessary to reduce the size of large files for storage, transmission, and
faster processing
The choice between lossy and lossless compression methods depends on the type of file
and its intended use
Lossy compression is generally used for media files where minor data loss is acceptable
while lossless compression is used for text, code, and archival purposes
Page 4 of 4
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers