Learning Objectives
By the end of this topic, you should be able to:
- These first ideas underpin everything in this topic. They are not assessed independently on the Competency Demo, but you will demonstrate them through your work on the objectives below.
- Explain bits and bytes and how they are organized.
- Explain how the same sequence of bits can be interpreted as different types of data (numbers, images, sound, text, etc.)
- Text
- Identify how ASCII encoding represents text as a sequence of bits, including why each character is stored as 8 bits despite ASCII being a 7-bit system, and what determines the size of an ASCII text file.
- Calculate the size in memory of an uncompressed ASCII text file.
- Images
- Identify the components of 24-bit photo encoding, including the role of pixels, color channels, and bit depth, and explain how those components relate to each other.
- Calculate the size in memory of an uncompressed 24-bit photo.
- Sound
- Identify the components of digital sound encoding — including sampling rate, bit depth, and channel count — and explain how each affects the quality and size of a sound file.
- Calculate the size in memory of an uncompressed sound file given its duration, sampling rate (44,100 samples/sec), bit depth (16 bits), and number of channels (1 or 2).
- Other concepts
- Calculate how many unique values can be stored in N bits.
- Explain why terms like kilo-, mega-, and giga- have two potential values/meanings.
Learning Activities
To help you meet the learning objectives, we have prepared a combination of readings, activities, and videos.
Course Readings
These reading were designed to introduce the course topics to an audience of educators. They should be considered "required" and read in order.
- Reading 1: Text Representation (ASCII)
- Reading 2: Images in 24‑Bit Color
- Reading 3: Digital Sound Representation
- Reading 4: Why do KB, MB, GB, etc. have two different meanings?
Supplemental Readings
Some participants find it helpful to read about a topic from a source written for a slightly more technical audience. These supplemental readings cover similar material as the course readings but may not fully align with the course learning objectives. Use them as an optional complement to your study, not a substitute for the course readings.
- Reading: World Wide Web Consortium (W3C), Character encodings for beginners
- Reading: CSFG, Chapter 5.4, Text
- Reading: CSFG, Chapter 5.5, Images and Colours
- Reading: Computer Science Cafe, Chapter 1.6, Sound Representation
Lesson Videos
These videos support the readings above and may present the material with some deeper connections and worked examples.
- VIDEO: Moving beyond bits as numbers
- VIDEO: How computers store text in ASCII
- VIDEO: How computers store bitmap images
- VIDEO: How computers store vector images
- VIDEO: How computers store sound
- VIDEO: Calculating the approximate size of a file
- VIDEO: Why do terms like KB, MB, and GB have double meanings
Checking for Understanding, Questions
Review the learning objectives above. The questions below are organized to match them. Try each question before revealing the answer. If you find yourself uncertain, revisit the relevant reading before attempting the Competency Demo.
- Which of the following correctly orders these units from smallest to largest?
- A. Byte, bit, KB, MB, GB
- B. Bit, KB, byte, MB, GB
- C. Bit, byte, KB, MB, GB
- D. Byte, bit, MB, KB, GB
A student says: "Since the computer only understands numbers, it doesn't actually store the letter 'A' at all." Is the student correct? Explain the role of a character set like ASCII in this process.
- ASCII was designed using 7 bits, but each character is stored using 8 bits. Why?
- A. 8-bit storage allows for more characters than 7-bit ASCII defines
- B. Computers store data in 8-bit bytes, so a leading zero is added to fill the byte
- C. The extra bit is used to store punctuation characters
- D. 8 bits are needed to represent lowercase letters
A document has 4 pages, 50 lines per page, and 75 characters per line. How large is the uncompressed ASCII file in bytes?
What is the difference between ASCII and Unicode? Why can't we just use ASCII for everything on the modern web?
- A 24-bit color image gets its name because:
- A. It can display exactly 24 colors
- B. It uses 24 pixels per inch of screen space
- C. It stores 24 bits of color information per pixel
- D. It requires 24 KB of storage per image
A classroom photo is 1,024 pixels wide and 768 pixels tall. How large is the uncompressed 24-bit file in bytes?
Explain the relationship between a "pixel" and "RGB." How does a computer use these to create the color Yellow?
- A teacher records a lesson in stereo instead of mono at the same sampling rate and bit depth. What happens to the file size?
- A. The file is half the size because stereo compresses automatically
- B. The file is the same size because stereo and mono use the same number of samples
- C. The file is twice the size because stereo records two separate channels
- D. The file is four times the size because stereo doubles both sample rate and bit depth
-
How large is 2 minutes of uncompressed mono audio recorded at CD quality (44,100 samples/sec, 16 bits per sample)?
- Convert your answer from Question 5 (the classroom photo) to kilobytes. Remember: this course uses 1 KB = 1,024 bytes.
Checking for Understanding, Answers
You can compare your answers to the following answer key.
Show answer
-
C. Bit, byte, KB, MB, GB. A bit is the smallest unit (a single 0 or 1). Eight bits make one byte. From there, each unit is 1,024 times larger than the previous one.
- Yes, the student is correct. Computers only store bits (0s and 1s). ASCII (American Standard Code for Information Interchange) acts as a "lookup table" or dictionary that tells the computer: "When you see the number 65, display the character 'A'."
-
B. Computers store and move data in 8-bit chunks called bytes. Since ASCII only uses 7 bits, a leading zero is added to fill the byte. This does not change the character — it simply pads the value to fit the hardware.
-
4 × 50 × 75 × 8 ÷ 8 = 15,000 bytes
Check: total characters = 15,000; at 1 byte each = 15,000 bytes ✓
- ASCII only supports 128 characters (mainly English letters and symbols). Unicode is a universal system that supports over a million characters, including emojis and every written language. We use Unicode on the modern web so that people worldwide can communicate regardless of their language.
-
C. Each pixel in a 24-bit image is stored using 24 bits — 8 bits each for the red, green, and blue color channels.
-
1,024 × 768 × 24 ÷ 8 = 2,359,296 bytes
Check: 786,432 pixels × 3 bytes per pixel = 2,359,296 bytes ✓
- A pixel is a single dot in a grid. Each pixel is made of three color channels: Red, Green, and Blue (RGB). To create Yellow, the computer turns the Red and Green channels to full strength and leaves Blue at 0.
-
C. Stereo records two independent channels — one for the left speaker and one for the right. That doubles the amount of data stored compared to mono, which records only one channel.
-
Since 2 minutes is 2 × 60 or 120 seconds:
120 × 44,100 × 16 × 1 ÷ 8 = 10,584,000 bytesCheck: 120 seconds × 44,100 samples × 2 bytes per sample × 1 channel = 10,584,000 bytes ✓
- 2,359,296 ÷ 1,024 = 2,304 KB
Check: 2,359,296 ÷ 1,024 = 2,304 KB exactly ✓
Extend Your Learning
The following resources go a little deeper on topics we touched on but did not fully explore in the readings. These are entirely optional — none of this material appears on the Competency Demo — but each one is a natural "next question" from something covered this week.
- Unicode and global text encoding
We covered ASCII and mentioned Unicode, but how does Unicode actually work? This article from IONOS gives a clear, accessible overview of how Unicode assigns code points to characters from virtually every writing system in the world, and why UTF-8 became the dominant encoding on the web.
What is Unicode? — IONOS Digital Guide - 32-bit color and the alpha channel
We noted that 32-bit images add a fourth channel for transparency. If you want to understand exactly how that alpha channel works and how it enables effects like smooth fade-outs and layered graphics, this article from Linearity explains it clearly with examples.
Understanding the Alpha Channel — Linearity - Bitmap vs. vector graphics
Our readings focused entirely on bitmap (pixel-based) images. But many graphics — logos, icons, diagrams — are stored as vector graphics, which use mathematical formulas instead of pixels and can be scaled to any size without becoming blurry. This article from USF's Educational Technology Clearinghouse covers the key differences.
Bitmap vs. Vector Images — USF Tech Ease - How MP3 compression works
We mentioned that compression formats like MP3 shrink audio files by removing data the human ear is unlikely to notice. The science behind this is called psychoacoustics — the study of how our brains perceive sound. This article from Maths Careers explains how MP3 exploits the limits of human hearing to dramatically reduce file size without obviously degrading quality.
How Does MP3 Compression Work? — Maths Careers