Codes for letters using binary representation (2024)

Learning outcomes Codes for letters using binary representation (1)

Students will be able to:

  • Create their own message by converting alphabet characters to decimal numbers then to binary.
    Computational Thinking: Decomposition
  • Discuss why it's important to be able to store more than the standard English alphabet.
    Language Learning
  • Explain how codes for larger alphabets could be created that also include capital letters, punctuation, symbols and diacritics (e.g. macrons, accents).
    Computational Thinking: Generalising and Patterns
  • Interpret a message using binary.
    Computational Thinking: Generalising and Patterns
  • Recognise how computers represent alphabet characters as bits using a simplified method.
    Computational Thinking: Logic

Key questions

  • How many different characters can you type on a computer?(Discussion may start at the 26 letters of the English alphabet, and thenexpand to other characters on the keyboard, including capital letters,digits and punctuation.Students may be aware that other languages can have thousands ofcharacters, and the range of characters is also expanding as emoticonsare invented!)

Lesson starter

Notes on resources

There is also an online interactive version of the binary cards here, from the Computer Science Field Guide, but it is preferable to work with physical cards.

Codes for letters using binary representation (2)

Discuss how you would communicate a letter of the alphabet to someone if allyou could do is say a number between 0 and 26.(Students will usually suggest using a code of 1 for a, 2 for b, and so on).

Work out and write down the binary numbers using 5 bits from 0 to 26 on theBinary to Alphabet resource, then add the letters of the alphabet.

Teaching observations
  • Check their binary code for three is 00011 as students commonly write00100 as they anticipate the pattern without necessarily checking it iscorrect.
  • Check they are writing the binary code in the correct order with theleast significant value on the right - for example some will start withone as 10000 instead of 00001.
  • Identify the students who are demonstrating one or all of thesecomputational thinking attributes; being very systematic, have everythinglined up exactly, are the first to recognise the pattern and don’t needthe cards any more.
  • Check that all students can describe back to you how to calculate thenumber they are up to.This will identify those who are guessing the pattern.
  • Note that if your local alphabet is slightly different (e.g. hasdiacritics, macrons etc.) then you may wish to adapt the code tomatch the common characters; this issue is also considered below.

Lesson activities

Using the table that students have created above, give them a message todecode, such as your name or the name of a bookauthor (e.g. 00001 00010 00010 11001 for ABBY).

Now get students to write and communicate their own messages.Remind them that they can write the zeroes and ones using any symbols, suchas ticks and crosses.

Consider unusual representations; for example, each bit could be communicatedwith a sound that is either high pitched or low pitched.Or the 5-bit number could be represented by holding up the five fingers onone hand, one finger corresponding to each bit.

Adding more characters

Some languages have slightly more or fewer characters, which might includethose with diacritic marks.If students consider an alphabet with more than 32 characters, then 5 bitswon't be sufficient.Also, students may have realised that a code is needed for a space(0 is a good choice for that), so 5 bits only covers 31 alphabetcharacters.

Have the students design a system that can handle a few extra characters suchas diacritics.(This can usually be done by allocating larger numbers, such as 27 to 31, tothe other characters).

A typical English language computer keyboard has about 100 characters(which includes capital and lowercase letters, punctuation, digits, andspecial symbols).How many bits are needed to give a unique number to every characteron the keyboard?(Typically 7 bits will been enough since it provides 128 different codes).

Now have students consider larger alphabets.How many bits are needed if you want a number for each of 50,000 Chinesecharacters?(16 bits allows for up to 65,536 different representations).

Teaching observations

It may be a surprise that only 16 bits is needed for tens of thousands ofcharacters.This is because each bit doubles the range, so you don't need to add manybits to cover a large alphabet.This is an important property of binary representation that students shouldbecome familiar with.

Mathematical links

The rapid increase in the number of different values that can be representedas bits are added is exponential growth i.e. it doubles with each extra bit.After doubling 16 times we can represent 65,536 different values, and 20 bitscan represent over a million different values.Exponential growth is sometimes illustrated with folding paper in half, andhalf again.After these two folds, it is 4 sheets thick, and one more fold is 8 sheetsthick.16 folds will be 65,536 sheets thick!In fact, around 6 or 7 folds is already impossibly thick, even with a largesheet of paper.

Teaching observations

Using a 5-bit code for an alphabet goes back to at least 1870 (the "Baudot"code); many different number to letter correspondences have been used over theyears to represent alphabets, but one that was common for some time is "ASCII",which used 7 bits and therefore could represent over 100 different characters.These days "Unicode" is common, which can represent over 100,000 differentcharacters.Nevertheless, each of these codes, including Unicode, still contain elementsof the simple code used in this lesson (A is 1, B is 2...).For example, the ASCII code for "A" is 65 and "B" is 66 etc.; if you workout the binary representations of these, and just keep the right-most 5 bits,you've got the code that we've been using above.

Lesson reflection

  • What are some reasons why we don’t use the binary number system as thelanguage for our written language?
  • How do you think ancient Egyptians would have converted theirhieroglyphics to binary?
  • What did you find challenging during this lesson?
  • How did you overcome these challenges?

Seeing the Computational Thinking connections

Throughout the lessons there are links to computational thinking. Below we've noted some general links that apply to this content.

Teaching computational thinking through CSUnplugged activities supports students to learn how to describe a problem, identify what are the important details they need to solve this problem, break it down into small logical steps so that they can then create a process which solves the problem, and then evaluate this process. These skills are transferable to any other curriculum area, but are particularly relevant to developing digital systems and solving problems using the capabilities of computers.

These Computational Thinking concepts are all connected to each other and support each other, but it’s important to note that not all aspects of Computational Thinking happen in every unit or lesson. We’ve highlighted the important connections for you to observe your students in action. For more background information on what our definition of Computational Thinking is see our notes about computational thinking.

Algorithmic thinkingCodes for letters using binary representation (3)

We used two algorithms in this lesson: one to convert a letter into a decimal number and then into a binary number, and vice versa.These are algorithms because they are a step-by-step process that will always give the right solution for any input you give it as long as the process is followed exactly.

Here’s an algorithm for converting a letter into a decimal number:

Choose a letter to convert into a decimal number. Find the letter’s numerical position in the alphabet as follows:

  • Say “A” (the first letter in the alphabet)
  • Say “1” (the first number in our sequence of numbers)
    • Repeat the following instructions until you come to the letter you are looking to convert
      • Say the next letter in the alphabet
      • Say the next number (counting up by 1)
  • The number you just said is the decimal number that your letter converts too.

For example, to convert the letter E, the algorithm would have you counting A,1; B, 2; C, 3; D, 4; E, 5.

Codes for letters using binary representation (4)

(A more efficient algorithm would have a table to look up, like the one created at the start of the activity, and most programming languages can convert directly from characters to numbers, with the notable exception of Scratch, which needs to use the above algorithm.)

The next algorithm is the same algorithm we used in lesson 1, which we use to convert a decimal number to a binary number:

  • Find out the number of dots that is to be displayed. (We'll refer to this as the "number of dots remaining", which initially is the total number to be displayed.)
  • For each card, from the left to the right (i.e. 16, 8, 4, 2, then 1):
  • If the number of dots on the card is more than the number of dots remaining:
    • Hide the card
  • Otherwise:
    • Show the card
    • Subtract the number of dots on the card from the number of dots remaining

Examples of what you could look for:

Have students create instructions for, or demonstrate, converting a letter into a decimal number (with or without the table), and then convert a decimal number into binary; are they able to show a systematic solution?Can they explain what they are doing at each step and why?

AbstractionCodes for letters using binary representation (5)

This activity is particularly relevant to abstraction, since we are representing written text with a simple number, and the number can be represented using binary digits, which, as we know from lesson 1, are an abstraction of the physical electronics and circuits inside a computer.We could also expand our abstraction because we could use any two symbols other than 0s and 1s to represent our message (although while students are first learning this we recommend sticking with 1s and 0s).For example, you could represent your message by flashing a torch on and off (this gives an idea of how information might be sent over a fibre-optic cable!), or drawing a line of squares and triangles on the whiteboard.

Codes for letters using binary representation (6)

Abstraction helps us simplify things because we can ignore the details we don’t currently need to know.Binary number representation is an abstraction that hides the complexity of the electronics and hardware inside a computer that stores data.Letters are an abstraction that a human can make sense of quickly; talking about the letter H is generally more meaningful than calling it "the 10th letter of the alphabet", and when we are reading or speaking we don’t need to know it is the 10th letter anyway.

Examples of what you could look for:

When you use a different representation for binary, such as turning the torch on and off, who are the students who quickly see that this is equivalent to when they previously used 0s and 1s?They will probably feel comfortable working with this new representation quickly, and other students may be very confused by this change.Look for students who then decide to create their own representations of binary numbers.

DecompositionCodes for letters using binary representation (7)

The core example of decomposition in this activity is understanding that in computing we have to break down all information into tiny chunks so that computers can store and send this data as bits and bytes. Everything we store inside a computer and see appear on the screen has to have been, in some way, broken down into binary digits.

In this lesson students have performed several steps of decomposition as they have taken the task of encoding a message and broken it down into simple steps. To write a message in binary we have to first look at the message one letter at a time and convert each of these, one-by-one, into decimal numbers, and then convert each of these numbers, one-by-one, into binary numbers. Students perform these same steps in reverse to convert the message back to text.

Examples of what you could look for:

Can students explain why it is important that we can use binary to represent letters? Ask them why it is useful to choose a number value (binary or decimal) representing each letter, rather than choosing a number value representing each word.

Generalising and patternsCodes for letters using binary representation (8)

Recognising patterns in the way the binary number system works helps give us a deeper understanding of the concepts involved, and assists us in generalising these concepts and patterns so that we can apply them to other problems.

Examples of what you could look for:

Have students decode a binary message from another student, by converting the binary numbers into decimal numbers, and then to text to view the message. Ask them what they would do if they wanted to include other characters in their message: what if we wanted upper and lower case letters? What if we want to use exclamation and question marks?Observe which students see that we can simply generalise the method they are already using and can match other characters to bigger decimal numbers, e.g a-z can be 1-26, and A-Z can be 27-52.If we can represent 32 different characters in binary when we use 5 bits for each character, then how many would we need for 64? Which students can see the pattern of binary and doubling in this situation, and see that we simply need to use 1 more bit to do this?

LogicCodes for letters using binary representation (9)

Logical thinking involves making decisions based on knowledge you have, and these decisions should be sensible and well thought out. If you memorise that the letter H is represented as binary 01010 it's not as useful as learning how to represent any character using the process described in this activity. If you can understand the logical steps we take as we convert a letter into a binary number, and how we can convert it back, then you will be able to represent any character as binary, and more importantly, you understand the process, since you're more likely to get a computer to do it for you rather than always do it manually. This is especially relevant if we want to represent a large number of characters. What if we wanted to represent every Chinese character? There are over 50,000 of them so trying to memorise them all would take a long time!When we choose the decimal numbers to use for each of the letters we didn’t have to choose 1 to 26, we could have decided to start at 17 instead and go from 17 to 42, or we could have chosen completely random numbers! What if we decide that A = 82, B = 5, C = 42… Would this be a logical decision to make? 1 to 26 makes much more sense because it is much easier to describe and remember.

Examples of what you could look for:

Observe the systems students have created to translate their letters into binary and vice versa. What logic has been applied to these? Are they efficient systems? Can they explain what they are doing at each step?Ask students why we are using the numbers 1 to 26 to represent our letters, or if they think there could be a better choice. Ask them how they would choose numbers for other characters, such as choosing a number to represent a space. Which ones give logical answers and can explain why their solution is a good choice?

EvaluationCodes for letters using binary representation (10)

An example of evaluation is working out how many different characters can be represented by a given number of bits e.g. 5 bits can represent 26 characters comfortably, but 16 bits are needed for a language with 50,000 characters. When thinking about how many bits to use to represent something Computer Scientists also have to think about are how much space this is going to take up on a computer (16-bit characters take up twice the space of 8-bit characters), and if we should have some extra bits in case we want to add more characters in the future. Evaluating the benefits and costs of using a certain number of bits is also an idea students can explore.

Examples of what you could look for:

Can a student work out how many bits are needed to represent the characters in a language with 100 characters? (7 bits are needed)How about representing emojis, when you have about 4000 emojis available (12 bits will be needed for each one).

Codes for letters using binary representation (2024)
Top Articles
God of War: Every Time Kratos Has Canonically Died
Expanded Learning Opportunities Program FAQs
Skylar Vox Bra Size
Unit 30 Quiz: Idioms And Pronunciation
Kaydengodly
Tesla Supercharger La Crosse Photos
Kokichi's Day At The Zoo
Dew Acuity
O'reilly's In Monroe Georgia
Strange World Showtimes Near Cmx Downtown At The Gardens 16
Elle Daily Horoscope Virgo
U/Apprenhensive_You8924
Nyuonsite
Cpt 90677 Reimbursem*nt 2023
Hellraiser III [1996] [R] - 5.8.6 | Parents' Guide & Review | Kids-In-Mind.com
Salem Oregon Costco Gas Prices
Clear Fork Progress Book
Average Salary in Philippines in 2024 - Timeular
ELT Concourse Delta: preparing for Module Two
Great Clips Grandview Station Marion Reviews
Yisd Home Access Center
The Listings Project New York
Foolproof Module 6 Test Answers
Craigslist Dubuque Iowa Pets
Churchill Downs Racing Entries
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Fuse Box Diagram Honda Accord (2013-2017)
Evil Dead Rise Ending Explained
Past Weather by Zip Code - Data Table
Pipa Mountain Hot Pot渝味晓宇重庆老火锅 Menu
Home Auctions - Real Estate Auctions
Metra Union Pacific West Schedule
Of An Age Showtimes Near Alamo Drafthouse Sloans Lake
Edward Walk In Clinic Plainfield Il
Ljw Obits
Austin Automotive Buda
Hindilinks4U Bollywood Action Movies
Spectrum Outage in Genoa City, Wisconsin
Doordash Promo Code Generator
Florida Lottery Claim Appointment
Alston – Travel guide at Wikivoyage
Avance Primary Care Morrisville
Frequently Asked Questions
DL381 Delta Air Lines Estado de vuelo Hoy y Historial 2024 | Trip.com
Myra's Floral Princeton Wv
Okta Login Nordstrom
Www.homedepot .Com
Doelpuntenteller Robert Mühren eindigt op 38: "Afsluiten in stijl toch?"
Julies Freebies Instant Win
Wrentham Outlets Hours Sunday
Honeybee: Classification, Morphology, Types, and Lifecycle
Latest Posts
Article information

Author: Ms. Lucile Johns

Last Updated:

Views: 5962

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Ms. Lucile Johns

Birthday: 1999-11-16

Address: Suite 237 56046 Walsh Coves, West Enid, VT 46557

Phone: +59115435987187

Job: Education Supervisor

Hobby: Genealogy, Stone skipping, Skydiving, Nordic skating, Couponing, Coloring, Gardening

Introduction: My name is Ms. Lucile Johns, I am a successful, friendly, friendly, homely, adventurous, handsome, delightful person who loves writing and wants to share my knowledge and understanding with you.