Encoding a word or phrase is an example of representing data in a different way. Introduce encoding and decoding using secret messages. Braille is a system for representing text and other characters using combinations of flat and raised dots on paper so they can be read by touch. Morse Code represents the letters of the alphabet using dots and dashes. A QR code is another way to represent data.
Flow of Activities
Encoding a word or phrase is an example of representing data in a different way.
The practice of encoding (enciphering, encrypting) and decoding (deciphering, decrypting) is called cryptography.
Two simple ways of encoding are the ‘backwards alphabet code’ and the 'shifted alphabet code’. They are easy to code but equally easy to decode ('crack').
Knowing the ‘key’ helps the decoder translate the message.
Braille is a system for representing text and other characters using combinations of flat and raised dots so they can be read by touch.
One way to represent braille on paper without having to make raised dots is to draw a rectangle with 6 small circles in it, and to colour in only the circles that are 'raised'.
Braille is a representation using bits. That is, it contains two different values (raised and not raised) and contains sequences of these to represent different patterns. The letter m, for example, is represented vertically as:
where "1" means raised dot, and "0" means not raised dot.
Learning about braille is a good introduction to the binary system that uses 1's and 0's to represent data in a computer.
Morse code represents the letters of the alphabet using dots and dashes. Every letter has a unique sequence of dots and dashes. Dots are created using a short pulse and dashes with a longer one. Morse code can be shown as symbols, sound or light.
Dots and dashes are used in combination to simplify the representation for each letter enabling each letter to be represented with a maximum of 4 symbols. Imagine if you just used dots you would need up to 26 dots to represent all the letters of the alphabet. That would slow down the sending of messages!
This practical application will require 2–3 hours to complete. Use a programming board such as CodeBug or BBC micro:bit to create and send coded messages.
Students define the problem and design a digital solution for sending the message. For example, if using BBC micro:bit, create a simple code that uses ‘A’ button to create a dot and high pitched sound for ¼ beat and ‘B’ button for a dash with lower pitched sound and a beat of 1.
Have one student press the ‘A’ and ‘B’ buttons to send the coded message. The other person decodes the message heard and records the letters. Note: BBC micro:bit and CodeBug's online emulator plays the sounds, but, if you use the physical devices a buzzer would need to be connected using alligator clips.
Compare the original message to the decoded message. Discuss some limitations of this type of communication.
Students consider how this type of communication could be used to help someone at home, school or in the local community. How does this solution help these people?
A QR code is another way to represent data. QR stands for Quick Response. It is a scannable barcode-like image that directs you to a particular digital location set up by the code-creator. To read the code you need an app that reads QR codes and the camera on a smartphone or tablet device.
The barcode image is made up of pixels. Each pixel is made up of its own colour. In the case of QR code it is either black or white.