Edexcel IGCSE Computer Science 4CP0
Algorithms
Searching and Sorting Algorithms
Decomposition and Abstraction
Developing and Testing Code
Programming Constructs and Operators
Data Types and Data Structures
Input, Output and Validation
Data Representation
Data Storage and Compression
Encryption
Hardware and the CPU
Software
Programming Languages and Translators
Networks
Network Security
The Internet and the World Wide Web
Emerging Trends, Issues and Impact
Data Storage and Compression
Calculating file sizes
- 3 things to know
- Papers 1 and 2
Overview
Worked file size calculations for images and sound files in bytes, kibibytes and mebibytes.
What you need to know
Answer each one before you reveal it.
Calculate the size in MiB of a 64-second recording with a sample rate of 16384 Hz and a sample resolution of 8 bits
How many images of 512 × 512 pixels with a colour depth of 8 bits fit on a 1 MiB memory card?
Questions from this subtopic
Each one with the model answer underneath.
- 1
How is the file size of an image calculated?
Model answer
The file size of an image in bits is the number of pixels multiplied by the colour depth. Dividing by 8 gives bytes, and dividing by 1024 gives kibibytes.
- 2
Calculate the file size in KiB of an image of 1024 × 768 pixels with a colour depth of 8 bits.
Model answer
The image has 786432 pixels, each using 1 byte, so the file is 786432 bytes. Dividing by 1024 gives 768 KiB.
- 3
How is the file size of a sound file calculated?
Model answer
The file size of a sound file in bits is the sample rate multiplied by the sample resolution and the length of the recording in seconds.
- 4
Calculate the size in MiB of a 64-second recording with a sample rate of 16384 Hz and a sample resolution of 8 bits.
Model answer
The recording uses 16384 × 64 samples of 1 byte each, which is 1048576 bytes. The file is 1024 KiB, which is 1 MiB.
- 5
Calculate the file size in KiB of an image of 800 × 600 pixels with a colour depth of 24 bits.
Model answer
The image has 800 × 600 = 480000 pixels of 24 bits each, which is 11520000 bits or 1440000 bytes. Dividing by 1024 gives 1406.25 KiB.
- 6
Calculate the file size in KiB of an image of 640 × 480 pixels with a colour depth of 8 bits.
Model answer
The image has 640 × 480 = 307200 pixels of 8 bits each, which is 2457600 bits or 307200 bytes. Dividing by 1024 gives 300 KiB.
Other ways to work this
The same content, four other ways.
Everything in your subscription
Runs, plus a mode for every other kind of session.
Every question in Data Storage and Compression, on a schedule.
Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.