Text file size calculations
Lesson details
Learning outcome
I can calculate and compare the file size of text data when different encoding methods are used.
Key learning points
- A byte is the equivalent of 8 bits.
- Large numerical quantities can be summarised using number prefixes.
- Different text encoding schemes use different amounts of bits to represent each character.
- File size is the measure of how much binary data a file contains.
Keywords
Byte - a group of 8 bits
Number prefix - a word used in front of a number to represent a multiple of that number
Encoding - putting a sequence of characters into an agreed format
File size - a measure of how much binary data a file contains
Common misconception
The same text entered into two separate text files will always result in the same file size.
How the text has been encoded will affect the file size of a text file. ASCII uses 7 bits per character whereas Unicode uses up to 32 bits. Therefore the choice of character encoding affects the overall file size of the same text.
Teacher tip
Investigate the use of codes for character representation by developing programs that use in-built functions to convert between characters of a message and their ASCII or Unicode values. Messages could be typed in to the program and converted for display.
Licence
Lesson video
Loading...
Prior knowledge starter quiz
6 Questions
Q1.What is a digit of a binary number that can only be 1 or 0 called?
Q2.What does a character set do?
Q3.Match the term with its description:
data that has been processed to provide meaning
a digit of a binary number that can only be 1 or 0
uses 7 bits per character
uses up to 32 bits per character
Q4.Why do computers use binary sequences?
Q5.How many different characters can 7-bit ASCII represent?
Q6.What is the main advantage of Unicode over ASCII?
Assessment exit quiz
6 Questions
Q1.Put these quantities of bytes into order, smallest to largest:
Q2.What is a byte?
Q3.How many bits does ASCII use per character?
Q4.How does Unicode differ from ASCII?
Q5.If a text file contains 100 characters, what is the file size in bits using ASCII encoding?
Q6.A text document has 50 characters. Calculate the file size in bytes when using 32-bit Unicode encoding.
To help you plan your 10 computer science lesson on: Text file size calculations, download all teaching resources for free and adapt to suit your pupils' needs...
To help you plan your 10 computer science lesson on: Text file size calculations, download all teaching resources for free and adapt to suit your pupils' needs.
The starter quiz will activate and check your pupils' prior knowledge, with versions available both with and without answers in PDF format.
We use learning cycles to break down learning into key concepts or ideas linked to the learning outcome. Each learning cycle features explanations with checks for understanding and practice tasks with feedback. All of this is found in our slide decks, ready for you to download and edit. The practice tasks are also available as printable worksheets and some lessons have additional materials with extra material you might need for teaching the lesson.
The assessment exit quiz will test your pupils' understanding of the key learning points.
Our video is a tool for planning, showing how other teachers might teach the lesson, offering helpful tips, modelled explanations and inspiration for your own delivery in the classroom. Plus, you can set it as homework or revision for pupils and keep their learning on track by sharing an online pupil version of this lesson.
Explore more key stage 4 computer science lessons from the Representation of text, images and sound unit, dive into the full secondary computer science curriculum, or learn more about lesson planning.