Lesson 4: Binary Numbers

Overview

In this lesson, students will practice representing numbers in binary (base 2), transitioning from the circle-square representations they made in the last lesson. Students will create and use a "Flippy Do", a manipulative which helps students convert between binary (base 2) and decimal (base 10) numbers. They will practice converting numbers and explore the concept of place value in the context of binary numbers.

Purpose

This lesson is designed to give students as much time as possible using the Flippy Do to get comfortable with the relationship between binary and decimal numbers and the concept of place value.

Agenda

Lesson Modifications

Warm Up (5 mins)

Activity (35 mins)

Wrap Up (5 mins)

View on Code Studio

Objectives

Students will be able to:

  • Represent decimal numbers using combinations of binary (base 2) digits 0 and 1
  • Represent binary numbers using combinations of decimal (base 10) digits 0-9
  • Explain how the position of each binary digit determines its place value and numeric value

Preparation

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the Teachers

For the Students

Teaching Guide

Lesson Modifications

Attention, teachers! If you are teaching virtually or in a socially-distanced classroom, please read the full lesson plan below, then click here to access the modifications.

Warm Up (5 mins)

Discussion Goal

Goal: In previous lessons, students represented information using two options. This is a quick thinking question to tap into students’ prior knowledge and experiences. Once students have mentioned a few of the points below, they can move on.

  • The answer to a yes/no or true/false question
  • Flipping a switch on/off
  • Combinations of yes/no answers by using multiple symbols in a row
  • We can keep adding more of the same symbols, so the only limit is how much space we have to write or store those symbols

Prompt: Yesterday, you created your own number system using circles and squares.

  • What can we communicate using only two symbols? Is there a limit?

Discuss: Students should quietly write an answer, then share with a partner, then discuss with the whole class.

Activity (35 mins)

Display: Use the activity slides for this lesson to introduce students to the binary number system. Use the presenter notes as a guide to explaining how the shapes we used in the previous lesson relate to binary numbers. These slides use a lot of animations.

Look for this symbol on the slides to show when animation plays when presenting the slides: . Make sure to preview the slides before class.

Slides                     Speaker Notes
Say: Today we are going to explore how Binary Numbers work.
Say: With only one place value, we only have two possible patterns: circle or square.

Click through animation

Say: I started with circle, but we could have easily started with square instead.
Click through animation

Say: With two place values, we can make two sets of the previous patterns. Then, insert circles in front of the first set and squares in front of the second set. This makes four possible patterns.
Click through animation

Say: For three place value patterns, we can make two copies of the two place value patterns. Then, just like we did before, fill in the first set with circles in front and the second set with squares in front. This makes 8 arrangements.

Note: Computer scientists like to start counting at 0!
Say: Instead of two shapes, what if we had 10 shapes?
Click through animation

Say: We could use more geometric shapes, or we could use letters, but the shapes we are used to are the numbers 0 through 9.
Say: With two places, we have one hundred 2-shape patterns. These are the numbers 00 through 99. Click through animation
Say: What happens when we count up to the last shape?

Do This: Quick quiz! What comes after this number?
Say: 100! When we run up to the last shape, 9, we roll over back to 0 and add one in the next place to the left. This is the place value that we have used all our lives.
Say: Where is this heading? Click through animation
Say: Binary is a number system with two shapes. Click through animation
Click through animation

Say: Instead of shapes, we use 0's and 1's. In this example, each pattern maps to a decimal number from 0 to 7.
Say: For today's activity, you will be creating your own Flippy Do. This is a tool that will allow you to quickly and easily translate between the decimal number base we are used to as humans and the binary number base that computers use.

Distribute: Hand out the Flippy Do templates - one per student.

Do This: Lead students through completing their Flippy Do's using the slide as a guide.
Say: Each place value represents one "bit" which is short for "binary digit". A binary digit can be a zero or a one. Your flippy do has eight "bits".

Click through animation

Say: Together, eight place values, or "bits", makes up one "byte". Since computers represent information digitally, the lowest level components of information are bits.
Do This: Use your Flippy Do to try out these six problems.

Note: It may be necessary to demonstrate how values can be calculated by flipping up a “1” for each value required to arrive at the sum of values equal to the decimal number.

For example, To convert the decimal number 10, I would flip up a one in the 8's position, because eight can fit in 10 (The next bit to the left is 16, which is too big). Then I have 2 left. I flip up a one in the 2's position. This gives me the binary number "1010", which means 10 in decimal.

If students are having a difficult time understanding the rules of the system, remind them of the concept of place value and relate to base 10.

Say: Let's continue to practice with our own two number bases, decimal and binary. After you finish each of the four parts of the Activity Guide, I want you to check your work with your partner. Feel free to use your Flippy Do as you work.

Distribute: Activity Guide

Note: Encourage students to use their Flippy Do as a resource.

  • Challenge 1 - All 4-bit Numbers: Students should produce all binary numbers with a length of 4 bits, from 0000 to 1111. They should see that all odd numbers end in 1 and even numbers end in 0. Students may also notice that the binary digits increasingly “roll-over” to 1’s (from right to left) as numbers become larger and larger.
  • Challenge 2 - Binary Numbers with Exactly One 1: The goal here is for students to systematically find all binary numbers that have all zeros, except for one bit. Students should notice that the resulting decimal values are all powers of 2.
  • Challenge 3 - Conversion Practice: This section gives students more practice converting between number bases. The last two decimal numbers, 256 and 513, are too big to represent using the Flippy Do, however students should make the connection that more bits could be added to the left of the Flippy Do using increasing powers of 2.
  • Challenge 4 - Putting it all Together: The last four questions on the Activity Guide ask students to apply their understanding to new situations. The first two questions ask students to describe what happens to the value when 0’s are added to the left or right of a binary number. The last two questions ask students to think about how many bits are required to represent specific values in binary.


Note: As you circulate, take an opportunity to be a Lead Learner. Help students discover the items below using the suggested questions:

  • Reading a number vs. Placing a Number: Do we fill in the places on the Flippy Do starting on the left or right? Does it matter? (Yes. If we have a 5-bit number, we actually use the 5 bits on the far right. If we were to use the bits on the far left, this changes the value of the number. This is similar to adding more zeros to a decimal number.)
  • Highest value possible with a given number of bits: What is the largest number we can make with 4 bits? Is the last number we can make always odd? (A meaningful pattern is that we can count as high as one less than the next bit on the left. If we have four bits, we can count up to the number 15, because the next bit has a value of 16.)
  • Number of numbers we can make: How many total unique numbers are possible with 4 bits? (This is a base 2 number system. With each new bit, we double the amount of unique numbers we can make. With four bits, we can make the decimal numbers 0 to 15 (0000 to 1111), for a total of 16 unique numbers.)

Wrap Up (5 mins)

Teaching Tip

Number Bases:

Number bases help us express data and reason about quantities. With ten digits on our hands and feet, the decimal (base 10) number base was natural for humans to develop. The ten symbols we use for this number base are the digits 0-9. For a computer, however, it makes more sense that data be represented in binary (base 2), as this can easily be interpreted with electrical switches set to two states: ON or OFF. The two symbols we use for this number base are the digits 0 and 1.

Both number bases take advantage of the concept of place value. In decimal, numbers are composed of powers of 10, increasing in value from right to left. Binary is similar, however we use powers of 2 (1, 2, 4, 8, 16, etc.). Expressed in binary, these values are 1, 10, 100, 1000, 10000, and so on. These make up the incremental place values in the binary number system.

Why Binary?

Students will see in a later lesson how computers use binary numbers as a representation of electrical signals on a wire. The wire is always set to one of two different options: on or off. Off can be reprsented with a 0 and on with a 1.

Remarks

It's important to know the differences between binary and decimal number systems. As a review, the decimal number system is base-10. There are ten different symbols used to represent numbers (0-9). The binary numbers system is base-2. There are two different symbols used to represent numbers (0-1). Using our Flippy Do, we can convert between Binary and Decimal number systems.

While it is easier for humans to use the decimal number system in our everyday lives, we will see later in this unit how electrical signals inside computers can be best represented by using the the binary number system.

Discussion Goal

Goal: Use this exercise to help assess what students learned and what needs to be clarified. Some misconceptions can be visually clarified using the Binary Odometer Widget in the next lesson.

Prompt: Now that we’ve had a chance to practice, let’s find out what we’ve learned and what we still have questions about. Write down:

  • 3 things you learned today
  • 2 things you found interesting
  • 1 question you still have.

Journal: Add to your journal the vocab definitions for bit and byte.


Assessment: Check For Understanding

Check For Understanding Question(s) and solutions can be found in each lesson on Code Studio. These questions can be used for an exit ticket.

Question: How many bits would be needed to count all of the students in class today?

Question: Each time we add another bit, what happens to the amount of numbers we can make?

Question: What are the similarities and differences between the binary and decimal systems?

  • Check Your Understanding
  • 2
  • 3
  • (click tabs to see student view)
View on Code Studio

Student Instructions

View on Code Studio

Student Instructions

In 50 words or less, describe the concept of a number system.

Why are rules required for a number system to be useful?

Standards Alignment

View full course alignment

CSTA K-12 Computer Science Standards (2017)

DA - Data & Analysis
  • 3A-DA-09 - Translate between different bit representations of real-world phenomena, such as characters, numbers, and images.

CSP2021

DAT-1 - The way that the computer represents data is different from the way that the data are interpreted and displayed for the user
DAT-1.A - Explain how data can be represented using bits.
  • DAT-1.A.2 - Computing devices represent data digitally, meaning that the lowest-level components of any value are bits.
  • DAT-1.A.3 - Bit is shorthand for binary digit and is either 0 or 1.
  • DAT-1.A.4 - A byte is 8 bits.
DAT-1.C - For binary numbers: a. Calculate the binary (base 2) equivalent of a positive integer (base 10) and vice versa. b. Compare and order binary numbers.
  • DAT-1.C.1 - Number bases, including binary and decimal, are used to represent data.
  • DAT-1.C.2 - Binary (base 2) uses only combinations of the digits zero and one.
  • DAT-1.C.3 - Decimal (base 10) uses only combinations of the digits 0 – 9.
  • DAT-1.C.4 - As with decimal, a digit’s position in the binary sequence determines its numeric value. The numeric value is equal to the bit’s value (0 or 1) multiplied by the place value of its position.
  • DAT-1.C.5 - The place value of each position is determined by the base raised to the power of the position. Positions are numbered starting at the rightmost position with 0 and increasing by 1 for each subsequent position to the left.