CS-iGCSE-CIE-Notes

How data storage is measured

Smallest

Largest

Important*

A kibibyte (1024) is not the same as a kilobyte (1000). 

Question 1a)

A photograph is 1024 x 1080 pixels 

The colour depth is 32 bits

a) What is the file size of this photograph in bytes? 

b) How many photos of this size would fit onto a 64GiB memory stick?

Question 2)

An audio CD has a sample rate of 44100 and a sample resolution of 16 bits. 

The music being sampled uses two channels to allow for stereo recording.  

Calculate the file size of a 60-minute recording in MiB.

23/9/2022

Compression

This is necessary as files can become very large, and there are many unnecessary bits that take up storage space. Compression

Lossless 

Compressed file size without permanently losing the data. This is used when the data cannot be deleted or altered, however it is too large to be processed.

Lossy

Reduces file size by permanently removing data (e.g reducing resolution, colour depth, or sample rate). Lossy compression may remove data outside of human perception. For example, ultrasonic sounds, certain levels of colour depth, or a certain number of pixels. An algorithm decides what data is necessary and what data is not.

Lossy file formats:

Answers

Answer 1a)

File size in bits:

1024 * 1080 * 32 = 35389440

35389440 / 8 = 4423680 bytes

 4423680 / 1024 = 4320 KiB

 4320 / 1024 = 4.21875 MiB

Answer 1b)

65536 / 4.22 = 15530 photos

Answer 2)

File size =
Sample rate (in Hz) x sample resolution (in bits) x length of the sample (in seconds) x number of channels 

44100 * 16 * 2 = 1411200 bits 

1411200 / 8 = 176400 bytes

176400 * 3600 = 635040000 bytes in a 60 minute video

635040000 / 1048576 = 605.6213379 MiB


As this is still a work in progress, feel free to view the roadmap here to check for future updates.

If you have any features you would like to suggest, or notice any issues with the website, please submit an issue on Github.

If you like the work, consider supporting us by following Madelyn’s Github or checking out Valentina’s personal website!