LESSON 05 – FILE SIZES

 


LESSON WORK

QUESTION #1 – FILE SIZE CONVERSIONS

Do the following conversions.  Remember that greek prefixes are powers of two in computers.

 

a)     How many bits are in 12 bytes?

b)     How many bytes are there in 234 kilobytes?

c)     How many bits are there in 1 megabyte?

d)     How many kilobytes are there in 3 megabytes?

e)     How many terabytes are in 2340 gigabytes?

 

f)      How many kilobytes in 45 021 bytes?

g)     How many megabytes in 431 032 394 bytes?


QUESTION #3 – EXPLORING FILE SIZES

 

QUESTION #3A

In text files, each character is stored in a byte.

 

a)     How many bytes are in a text file containing 5243 characters?

b)     What is the size of a text file containing only the following sentence

“Mr. Campeau is so cool!” (no quotes)?

 

c)     How many bits are in a text file containing 200 characters?

 

QUESTION #3B

Most image files are divided into very small squares (dots) called pixels.

 

a)     How many pixels are there in total in an image that is 100 pixels wide and 300 pixels high?

b)     How many pixels are there in total in an image that is 630 pixels wide and 920 pixels high?

 

QUESTION #3C

An image is often classified by the amount of memory it allocates to a colour.  For example, a 24-bit BMP uses 24 bits or 3 bytes to store the colour of every pixel.

 

a)     How many bytes are used for the colour of each pixel in a 16-bit image.

b)     If pixel colour is stored in 3 bytes (24 bits), how many different colours can the pixel be?  (In other words, how many different numbers can be stored in 24 bits.)

 

QUESTION #3D

No matter the size of a BMP, it always has a file header of 54 bytes.  This header stores information about the file.

 

a)     What is the file size (in bytes) of a 16-bit BMP measuring 800 pixels by 1024 pixels?

b)     What is the file size (in bytes) of an 8-bit BMP measuring 200 pixels by 12 pixels?

 

QUESTION #3E

We have seen that a BMP image stores the colour of every single pixel.  Can you think of a way to decrease the file size of a BMP image?

 

QUESTION #3F

 

A 24-bit BMP is 1600 pixels by 1200 pixels in size.  Give the file size in the most appropriate unit (byte, kilobyte, megabyte).  Do not forget the file header.


QUESTION #4

 

Use the following ASCII Binary chart below to

 

a)     Write your name in ASCII Binary.

b)     Convert the following from ASCII Binary to English

 

0100100001010101010011000100101101010011

010011010100000101010011 01001000