Search Header Logo
File Sizes

File Sizes

Assessment

Presentation

Computers

9th Grade

Practice Problem

Hard

Created by

Adam Campbell

Used 3+ times

FREE Resource

11 Slides • 9 Questions

1

Calculating File Size

2

Do Now

​List units of memory

​Order the units of memory from smallest to largest

​Show how to convert between units ie. KiloBytes to MegaBytes

3

Calculating file sizes

Text Files

One character of text takes up 8 bits (1 byte) of storage space.
This includes letters, numbers, spaces and symbols. So the sentance:
"Computer Science is Awesome!"
Uses 28 characters.
The file size is therefore 28*8 bits. (or 28*1 bytes).
If you calculate a size in bits (28*8=224 bits), could can divide this by 8 to convert bits to bytes (224 / 8 = 28 bytes)

4

Multiple Choice

Calculate the size of a text file that contains the following text:

"Lord Lawson of Beamish Academy"

1
30 bytes
2
40 bytes
3
25 bytes
4
35 bytes

5

Multiple Choice

Calculate the file size of a text file that contains the text:

"I am amazing!!!"

1
15 bytes
2
25 bytes
3
20 bytes
4
10 bytes

6

Multiple Choice

What is the file size in bits of the following text:

"Incredible"

1
160 bits
2
136 bits
3

80 bits

4

10 bytes

7

Fill in the Blank

What is the file size in bytes of the following text:

"Is it Friday?"

8

Image Files

To work out the size of an image file

Work out the number of pixels by multiplying the width (in pixels) by the height (in pixels) THEN multiply by the bits per pixel (number of binary digits used to represent a colour.
ie. An image that is 64 x 64 pixels, and uses 4 bit colour
64 x 64 x 4 = 16,348 bits
You can divide this by 8 to convert to bytes
16,348 / 8 = 2,048
Divide by 1000 (or 1024) to get an answer in kilobytes
2,048 / 1024 = 2kB

9

Multiple Choice

An image is 10 pixels wide and 6 pixels tall. It uses 2 bit colour. How big is the file?

1
8 bytes
2
10 bytes
3
15 bytes
4
13 bytes

10

Database File Size

A database has many different fields

You need to work out how much space one entry for each field will use
Then you multiply the answer by how many records (entries in the database) there are

11

Database File Size

A text field is worked out the same way as a text file
ie. Storing a name in text in 10 characters = 10 bytes

Storing a number less than 255 uses 8 bits/1 byte
Storing a boolean uses 1 bit

12

Database File Size

If a database has the following fields:
Name (17 characters)
Age (number < 255)
Address (20 characters)
Then storing this information for
1 entry is
17 + 1 + 20 = 38 bits
If there are 200 records (entries) then the file size is
38 * 2000 = 76,000 bits
Divide by 8 to convert to bytes = 76,000/8 = 9500 bytes
Divide by 1000 to convert to kilobytes = 9500 / 1000 = 9.5kB

13

Multiple Choice

A database stores the following fields, and has 100 records.

Name (15 characters)

Age (number < 255)

Test Score (number < 255)

What is the file size in bytes?

1
2000 bytes
2
1200 bytes
3

1700 bytes

4
1500 bytes

14

Multiple Choice

A database stores the following fields, and has 200 records

Book Name (30 characters)

Book Price (number < 255)

Quantity in stock (number < 255)

Author (20 characters)

What is the file size in kilobytes?

1
20.00 KB
2
10.16 KB
3
15.75 KB
4
5.12 KB

15

Sound Files

Calculating the File Size

For a sound file you will be provided with it's duration in seconds, it's bit depth (number of bits per sample), sample rate (how many sounds it makes per second), and number of channels (how many different sounds can be made at once.
To calculate the file size, you multiple all of these together.

16

Sound File Example

A sound file uses a bit depth of 10
There are 2 channels
The sample rate is 1000
The duration is 1 minute (60 seconds)

The file size is:
10 x 2 x 1000 x 60 = 1,200,000 bits
1,200,000 / 8 = 150,000 bytes
150,000 / 1000 = 150 kB

17

Sound File Example

A sound file uses a bit depth of 16
There is 1 channel
The sample rate is 16,100
The duration is 3 minutes (180 seconds)

The file size is:
16 x 1 x 16,100 x 180 = 46,368,000 bits
46,368,000 / 8 = 5,796,000 bytes
5,796,000 / 1000 = 5,796 kB
5,796 / 1000 = 5.8 MB

18

Multiple Choice

A sound file uses a bit depth of 2, has 2 channels, has a sample rate of 20, and lasts for 10 seconds. What is it's file size in bytes?

1
25
2
50
3
75
4
100

19

Multiple Choice

A sound file has a bit depth of 4, a sample rate of 100, a duration of 200 seconds, and 2 channels. What is the file size in kB?

1
100.00 kB
2

200 kB

3
150.25 kB
4

20 kB

20

Task

Create a presentation

In your presentation explain how to calculate the file sizes for:
Text Files
Databases
Image Files Include examples
Sound Files

Calculating File Size

Show answer

Auto Play

Slide 1 / 20

SLIDE