Skip to content
Computing · JC 1 · Data Representation and Databases · Semester 1

Representing Text and Images

Understanding character encoding (ASCII, Unicode) and bitmap image representation.

MOE Syllabus OutcomesMOE: Data Representation and Databases - JC1

About This Topic

Relational database design is about organizing data so that it is accurate, consistent, and easy to retrieve. Students learn to create Entity-Relationship Diagrams (ERDs) to model real-world systems and use normalization to eliminate redundant data. This is a shift from thinking about data as a single 'flat' spreadsheet to seeing it as a web of interconnected tables.

In the Singapore context, database design is the backbone of our Smart Nation infrastructure, from the National Electronic Health Record to the HDB's housing systems. Students learn how to handle complex relationships, such as many-to-many interactions between students and CCA groups. This topic particularly benefits from hands-on, student-centered approaches where students model data for systems they use every day, like a school library or a food delivery app.

Key Questions

  1. Explain how different character encoding schemes impact global communication.
  2. Compare vector graphics and bitmap graphics in terms of storage and scalability.
  3. Analyze the trade-offs between file size and image quality for different image formats.

Learning Objectives

  • Compare the storage efficiency and scalability of bitmap images versus vector graphics.
  • Analyze the trade-offs between file size and visual fidelity for common image formats like JPEG, PNG, and GIF.
  • Explain how different character encoding schemes, such as ASCII and Unicode, facilitate or hinder global digital communication.
  • Design a simple bitmap representation for a given icon using a specified pixel grid and color palette.

Before You Start

Binary Representation

Why: Students need to understand how to represent numbers and data using binary digits (bits) to grasp character encoding and pixel color values.

Basic Data Types

Why: Understanding fundamental data types like integers and characters is necessary to comprehend how they are encoded into binary.

Key Vocabulary

Bitmap ImageAn image file format that stores graphical information as a grid of pixels, where each pixel has a specific color value.
PixelThe smallest controllable element of a picture represented on the screen, a single point in a graphic image.
ASCIIAn early character encoding standard that uses 7 or 8 bits to represent English letters, numbers, and symbols, limiting its character set.
UnicodeA character encoding standard designed to represent text from all writing systems, using variable-length encoding to accommodate a vast range of characters.
Color DepthThe number of bits used to represent the color of a single pixel, determining the total number of colors that can be displayed.

Watch Out for These Misconceptions

Common MisconceptionPutting all data into one big table is easier and faster.

What to Teach Instead

Flat tables lead to data redundancy and 'update anomalies' (where changing a value in one place doesn't change it elsewhere). A 'data entry' simulation where students try to update a flat table versus a normalized one quickly shows the benefits of normalization.

Common MisconceptionPrimary keys can be anything, like a person's name.

What to Teach Instead

Primary keys must be unique and unchanging. Since names can change or be shared, using a unique ID is essential. Peer review of ERDs helps students identify 'weak' primary keys before they become a problem.

Active Learning Ideas

See all activities

Real-World Connections

  • Software engineers developing international applications must choose Unicode to ensure their user interfaces correctly display text in multiple languages, from Cyrillic to Mandarin.
  • Graphic designers at advertising agencies select image formats like JPEG for web banners due to its good compression for photographic images, balancing file size with acceptable quality for online display.
  • Web developers use PNG for logos and icons on websites because it supports transparency and lossless compression, ensuring sharp edges and clear graphics.

Assessment Ideas

Exit Ticket

Provide students with a small 8x8 pixel grid and a limited 4-color palette. Ask them to draw a simple smiley face and then write the binary code for the color of one pixel and its coordinates (e.g., Pixel (3,5) is color 01).

Discussion Prompt

Pose the question: 'Imagine you are designing a new global messaging app. Which character encoding would you choose and why? What are the potential problems if you chose the other main option?' Facilitate a class discussion comparing ASCII and Unicode for this scenario.

Quick Check

Show students two images of the same graphic: one a high-resolution bitmap and one a scalable vector graphic. Ask them to identify which is which and explain one key difference in how they would scale or be stored, based on their properties.

Frequently Asked Questions

What is the goal of database normalization?
The main goal is to reduce data redundancy and ensure data integrity. By organizing data into related tables, we ensure that each piece of information is stored in only one place, which makes the database more efficient and prevents errors when data is updated.
What is the difference between a primary key and a foreign key?
A primary key uniquely identifies a record within its own table. A foreign key is a field in one table that refers to the primary key of another table, creating a link between the two. This is how relationships are established in a relational database.
How can active learning help students understand database design?
Active learning through 'Data Modeling Workshops' allows students to grapple with the messy reality of real-world data. When they have to physically draw connections and realize they have nowhere to put a specific piece of info, the need for normalization becomes obvious. It turns a dry theoretical exercise into a problem-solving puzzle that mirrors the work of a real database architect.
When should I use a many-to-many relationship?
You use it when multiple records in one table relate to multiple records in another (e.g., many students taking many subjects). In a relational database, this is always implemented using a third 'junction' or 'associative' table to keep the data organized.