- [Craig] In this video, we discuss data capacity and how to calculate data capacity requirements.
(uplifting piano jingle)
In the GCSE exams, you'll be expected to know how to calculate the size of text files, sound files and image files.
The size of a text file can be calculated by multiplying the number of bits it takes to store a single character
by the number of characters in the text file.
The size of a sound file can be calculated by multiplying the sample rate by the duration in seconds by the bit depth.
The size of an image file can be calculated by multiplying
the colour depth of an image by its height in pixels by its width in pixels.
Now, the situation is a little more complicated than this, but this is sufficient depth for the exam.
We'll look at these calculations in more detail in the second half of this video.
First, let's turn our attention to the issue of data capacity.
When we talk about the capacity of a drive, we're referring to the amount of data that can actually be stored,
and this is measured in bytes.
The capacity of drives is increasing all the time, so this is just for illustrative purposes
to show you the relative difference between the different types of storage;
in this case, magnetic, solid-state and optical.
Here, we see the relative sizes of different types of files.
Again, the actual file sizes can vary dramatically depending on a range of factors,
but this is a useful relative comparison to calculate how many of each type of file we could store on each type of media.
So, let's consider an 8TB hard drive, which can store roughly 8 million megabytes.
If our document file is 246KB, then that's roughly 0.2MB.
We can easily divide one by the other to work out how many files we could store on this drive.
So, let's have a look at a few more examples.
So here, we have a solid-state USB pen, 256GB in capacity,
So, let's times that by 1000 and do 256,000MB divided by 0.2MB, so we could store roughly 1.28 million documents.
Let's do the same thing for the CD-R, so that's 640MB.
So, 640 divided by 0.2, so we could store roughly 3200 documents on this CD-R.
Okay, let's move to the video files; this is much bigger, so 62.8MB.
So, I've rounded that up to 62.9, so I've got the capacity of the hard disk, 8 million megabytes,
divided by the video file size, 62.9, so we could store approximately 127,000 videos.
What about photos?
Okay, so 256,000MB divided by 4.3 per file, roughly 60,000 photos.
And now let's have a look at music files.
So, we have a 640MB CD, divided by 8.4MB per music file, so about 76 music files could fit on that CD.
So, let's return to calculating the size of various files.
So, as we said, you have to be able to calculate the size of text files, image files and sound files,
and the information being given here is sufficient for the level you need for a GCSE exam.
So, for text files, it's the bits per character timesed by the number of characters.
So, this would rely on you knowing about the number of bits that each character is being stored in,
and this is based on the character set, something we look at it another video.
So, if we're basing this on the standard ASCII character set, every character would take up 7 bits of storage.
Times that by the number of characters in the text file,
now that includes spaces, as a space has to be stored, so there's 244 characters here.
We times the two together and get a file size for this text file of 1,708 bits - divided by 8, 214 bytes.
Sound files are a little more complex; we have to take the sample rate, so that's the number of times the sound file is captured per second.
So, we can see here that a sound wave is being captured at 6 intervals per second.
We need to times that by the total duration of the sound file.
Well, the sound file here is 3 seconds long, so we've got 6 times 3,
and then we times this by the bit depth.
In other words, every time we're storing a sample, how many bits of data is that sample taking up when it's stored?
And here, we have a bit depth of 4.
So, we end up with 6 times 3 times 4,
so 72 bits - divided by 8, 9 bytes.
Again, we've got another video on representing sound coming up later in this series, which will look at sound files in more detail.
Finally, image files - the first thing we need to do is work out the height of the image in pixels.
Well, that's 14 here.
We then need the width of the image in pixels - well, that's 17.
And then in a similar way to sound files, we need to know how much storage each of those pixels is taking up when being stored,
and that's based on what's known as the colour depth, the number of bits needed to store each pixel.
So here, we have 14 times 17 times a colour depth of 3, so 714 bits.
Divided by 8 again is 90 bytes.
And again, we've got another video which will go into a lot more detail on representing images and how they're made up.
As a quick recap then, there are the three calculations that you need to know for your exam
on how to calculate the size of a text file, an image file and a sound file.
(uplifting piano jingle)