Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 3.66 KB

Encoding_Binary.md

File metadata and controls

75 lines (54 loc) · 3.66 KB

Text Encoding & Binary Numbers

Overview

In this lesson, students will learn about ASCII encoding of text. Students will also look at how binary numbers can be used to store and transmit data on computer systems.

Purpose

All data is stored as binary 0s and 1s on a computer. This means that every image, video, document, and program we use on a computer is ultimately converted to binary. Looking at text is a way to see this process in a clear, understandable way.

Objectives

Students will be able to:

  • Convert text to ASCII Numbers
  • Convert base-10 numbers to base-2 binary
  • Encode/decode a message using ASCII/Binary

Preparation

Links

Vocabulary

Number System: A method of representing numbers. Base-10: Our normal number system, 10 digits (0-9) can be in any number position Base-2: Binary number system only uses digits 0, 1 in any number position. ASCII: American Standard Code for Information Interchange - A method for representing every letter as a number.

Teaching Guide

Getting Started

  • Discussion of how all data is stored as numbers in base-2 (binary) on a computer

The digits are stored as electrical pulses, magnetic poles in a Hard Drive, pits on a CD even as pulses of light. In all of these cases, there is a case that represents a 0 or 1.

As such, every bit of data is ultimately represented as binary numbers.

Activity

Students will convert a message to ASCII using the chart. These will be base-10 numbers for now. Students will also decode a message and create their own message to swap and decode with another student.

Then students will convert a series of binary numbers to base-10 and back to text.

Activity (coding):

Python Programming:

  • Using the AsciiEncoding.py as template:
    • Create a text to ASCII to binary converter
    • Try to convert each letter to the ASCII equivalent.

Wrap-up

Discussion

  1. If all data is stored as 0s and 1s, how does a computer know if a file is text or a picture?

  2. I can put a password on a document so it can't be opened. If someone can see the 0s and 1s, what prevents someone from seeing the contents of that document? A password-protected documents is still stored as binary on the hard drive.

Assessment Questions

  • Every letter is represented by a number, so is every color, sound, or program.
  • If a color is a combination of red, green, and blue values (0-255), devise a way to hide text as an image.

Extended Learning

Standards Alignment

License

Cyber Security Curriculum Creative Commons License is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.