# 3.3 Fundamentals of Data Representation

# Lesson resources

# 3.3.1 Number bases

### B&W Pixelation

There are three versions of this excellent applet, designed for the University of Chicago's Introduction to Computer Science course to help students understand image representation in computers. In the first version, students simply enter binary digits to represent black or white pixels. In the second version students are introduced to the concept of a very basic file format, with the first two bytes representing the image dimensions. Students can also enter the data in binary or hexadecimal. The final version is even more complex, allowing students to specify the colour depth of the image, and requiring them to enter the appropriate number of bits for each pixel.

Overall this site is an excellent introduction to data storage and image representation, and makes a complex subject quite entertaining.

*Updated: 2015-04-09*

### Introducing Binary

The new-look BBC Bitesize site have extensive notes on binary numbers, with clear diagrams and examples of how they work and how they can be added. Several videos brighten up the content and key concepts are related to real-life situations - such as CPU word size. Later pages of the notes cover conversion between different number bases. The site also features short multiple-choice quizes to test students' understanding of the key concepts.

*Updated: 2015-04-15*

### Lesson - Data representation - binary

This download contains all lesson resources necessary to teach students binary. It includes explanations of the system and lesson activities.

This lesson is one of the many excellent resources provided under CC-NC-SA by Mr Colley.

*Updated: 2017-10-15*

### Lesson - Data representation - hexadecimal

This download contains all lesson resources necessary to teach students base 16 (hexadecimal). It includes PowerPoint presentations that cover the number system and converting to denary and binary. There are also some nice hex table handouts for students who may be struggling to grasp the concepts. how sound is represented in binary.

This lesson is one of the many excellent resources provided under CC-NC-SA by Mr Colley. I've added PDF versions of the .pub versions found in the original download, for those who don't have Microsoft Publisher.

*Updated: 2017-10-15*

### Counting in binary

This handy PDF serves as a good summary sheet for students learning to count in binary. It covers decimal numbers from 0 to 63 (5 bits). It is good for GCSE and younger students, although it can be useful for older students too.

The sheet was created by Gary Kacmarcik at the excellent cse4k12 site and is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License.

*Updated: 2017-10-17*

### Counting in hex

Similar to the binary sheet, this handy document covers decimal numbers 0 to 63. It is useful for teaching students who are new to binary, or as a quick recap for those revising it. The sheet was created by Gary Kacmarcik at the excellent cse4k12 site and is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License.

*Updated: 2017-10-17*

### Binary and Hexadecimal starter activities

Two lesson starter, plenary, or homework activities are the binary crossword and the matching quiz. They test students' ability to read binary and hexadecimal, and convert between these systems and denary.

*Updated: 2017-10-17*

# 3.3.2 Converting between number bases

### Binary Tetris

Binary Tetris is a flash game designed to help teach students the binary number system. Players must flip bits to achieve the required number, or add up the bits to calculate the number being represented. I'd recommend asking students to turn their sound off before starting this!

*Updated: 2015-04-07*

### Hexadecimal-binary matching game

This is a fun little matching pairs style game in which players must match decimal numbers with their hexadecimal equivalents. A good way of testing students' ability to quickly perform mental conversions. Click here to play.

*Updated: 2017-11-05*

### Binary conversion activities

These two worksheets help students with decimal to binary conversion and vice versa. The activities were created by Gary Kacmarcik at the Computer Science & Engineering for K-12 site and are licensed under the Creative Commons Attribution-Share Alike 3.0 license.

*Updated: 2015-04-15*

### Binary crossword activities

These two puzzles are a great way to test students' hexadecimal to binary conversion skills. They work much like a normal crossword, except that the clues are written in hexadecimal and the answers must be written in binary. Once complete, the crosswords make simple bitmap images if the 1s are shaded and the zeroes left blank. You can download puzzle 1 (answers) and puzzle 2 (answers).

These puzzles were created by Gary Kacmarcik at the Computer Science & Engineering for K-12 site - an excellent site which I recommend you visit. They are licensed under the Creative Commons Attribution-Share Alike 3.0 license.

*Updated: 2015-04-15*

### Binary to hexadecimal

A worksheet that explains the "divide into groups of 4" method of converting binary numbers to hexadecimal numbers.

This was created by Gary Kacmarcik at the Computer Science & Engineering for K-12 site - an excellent site which I recommend you visit. They are licensed under the Creative Commons Attribution-Share Alike 3.0 license.

*Updated: 2015-04-16*

# 3.3.3 Units of information

# 3.3.4 Binary arithmetic

### Binary Addition & Overflow

Another excellent video from ComputerPhile with their usual clear explanations and worked examples. This video recaps binary numbers and then explains how to perform binary addition. It also deals with the potential problem of overflow and how it can be handled.

*Updated: 2015-04-29*

### Video: Logical shifts and Arithmetic shifts

These two videos cover logical binary shifts and arithmetic binary shifts - which for obvious reasons are often confused by students. It is recommended to watch the videos in this order, as the arithmetic shifts video explains some of the shortcomings of logical shifts. There are plenty of examples to help you understand each type.

*Updated: 2018-02-17*

# 3.3.5 Character encoding

### Characters, Symbols and the Unicode Miracle

Characters, Symbols and the Unicode Miracle explains how ASCII arose from the need to communicate data in a compatible manner between computer systems, and the problems that arise with this apparently simple task. It then discusses the creation of the Unicode system.

*Updated: 2015-04-29*

### Unicode Table

Unicode table is a nice scrollable web page which lists all of the unicode characters. The title and a brief description of each section is presented while you scroll. This page is useful for helping students realise just how many different characters need to be represented by computer systems, and the problems this would cause with a standard like Unicode.

*Updated: 2015-04-29*

### Lesson - Data representation - text

This download contains all lesson resources necessary to teach students how ASCII is used to representation text in a computer system. The download includes several fun activities where students have to uncover 'secret' messages using their understanding of binary and ASCII. There are different worksheets for students of different levels.

This lesson is one of the many excellent resources provided under CC-NC-SA by Mr Colley.

*Updated: 2017-10-15*

### Text representation worksheets

Gary Kacmarcik at the excellent cse4k12 site has created a set of sheets for a lesson activity on text representation. The first sheet is an ASCII table and the other two sheets ask students to encode a text message and decode a message respectively. Note that students are expected to encode and decode using hexadecimal rather than binary (although they could easily be asked to use binary instead).

*Updated: 2017-10-17*

# 3.3.6 Representing images

### Bitmaps Activity

These activities involve students converting between bitmap images and numeric representations of them in binary and hexadecimal. This is a great way to see how relatively complex information can still be represented as binary. You can download the worksheet with guidance and an additional blank worksheet.

The activities were created by Gary Kacmarcik at the Computer Science & Engineering for K-12 site, which contains an excellent range of activities. They are licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License.

*Updated: 2015-04-15*

### Image Representation - Flash activity

This Flash activity lets students draw a simple bitmap image and represents it using a simple run-length encoding (RLE) algorithm in real time. Students can also important text representations of the compressed data and the application will draw the corresponding image. The web page is not in English but the application is still perfectly usable.

*Updated: 2015-04-15*

### CS Field Guide - Data representation

CS Field Guide is an absolutely fantastic resource filled with material that is well written, clear,and accessible. Each section comes with highlighted key points, extension points, and even interactives to help understand the concepts. The interactives are excellent as teaching resources (many of them are linked here), while the notes themselves make excellent revision resources - particularly for GCSE.

This section covers all aspects of data representation - numbers, text, images, and instructions.

*Updated: 2017-10-24*

### Caesar cipher

A simple interactive that implements a basic Caesar cipher. One great use for this is to highlight just how weak Caesar ciphers are. By giving students examples of ciphertext and asking them to use this tool to break them, they should realise just how easy it is to perform a brute force attack.

*Updated: 2017-10-24*

### RGB Colour matcher

A colour matching tool that asks users to play with the RGB sliders to match a specified colour. This is a great way to help students understand how red, green, and blue are mixed to produce colours. What makes this colour matcher stand out is that it also represents the colour values in binary (24 bit) at the bottom. This makes it a useful companion for tools like Pixelization (see elsewhere on this page).

*Updated: 2017-10-24*

# 3.3.7 Representing sound

### Lesson - Data representation - sound

This download contains all lesson resources necessary to teach students how sound is represented in binary. It includes PowerPoint presentations, worksheets, and sample sounds for students to play.

This lesson is one of the many excellent resources provided under CC-NC-SA by Mr Colley.

*Updated: 2017-10-15*

# 3.3.8 Data compression

### Image, audio, and text compression

This very comprehensive page from the Computer Science Field Guide has extensive but clear notes on lossless and lossy compression. The page is well written and designed for a high school audience, with easy to understand examples, video, and even interactive sections. There are also extension "Extra for Experts" sections. The page covers image compression, audio compression, and text compression.

*Updated: 2015-04-16*

### Run Length Compression (RLE) interactive

This activity shows how a computer would represent a simple image when using Run Length Compression (RLE). Students can alter the image to see how the compression data would change. This is a good resource for helping students understand how lossless compression does not always result in significant size reduction.

*Updated: 2017-10-24*

### JPEG Compression comparison

A simple interactive that compares a highly compressed JPEG image with a less compressed image. A slide lets you view different parts of the image. JPEG banding is particularly visible in the sky but less so in other areas - the reasons for this make for interesting classroom discussions.

*Updated: 2017-10-24*

### Compression: Crash Course Computer Science

This video explains compression techniques in the context of images. It is recommended that students have an understanding of how image data is stored (e.g. bit depths) before watching this video. The video is very comprehensive and so it may take a couple of viewings to fully understand the details of the examples being presented, but it is worth it.

*Updated: 2018-02-17*