Skip to Main Content

Coding for Educators

Binary

man saying hello                                      Computer saying hello in binary

Stream of Binary numbers

All the information inside computers is stored and processed as binary. The binary numbering system only consists of two digits: 0 and 1. Binary code is all computers can understand.

Bits & Bytes Explained

What is a bit?

A bit is short for "binary digit". A bit can only store one of two values: 0 or 1.

What is a byte?

A byte is a group of eight bits. By grouping bits we can store many more values.

Activity: Powers of 2

Communicating with Computers

How do we get computers to do things and store data if all they understand is 1s and 0s?

A standard conversion chart has been created to encode all the uppercase letters, lowercase letters, decimal digits, and special characters. This is called ASCII short for American Standard Code for Information and Interexchange. It maps a binary number and decimal number to all the characters needed to process and store information on computers.

ASCII Chart

Let's learn to speak binary!

We are going to encode the word "Cat" in binary.

1. Pick 2 different color Brain Flakes - one color to represent 0 or OFF and another to represent 1 or ON.

BrainFlakes as Binary numbers 

I'm using a white Brain Flake to represent 0 or OFF and a pink to represent 1 or ON.

2. Place 8 of your 0 color Brain Flakes out in front of you.

3. Use the ASCII chart to find the decimal value of each letter you need to convert: "C", "a", and "t".

4. The uppercase C is decimal 67. To convert to binary we start with the left bit of our byte turning on only the bits we need in order to add up to 67.

5. The 8th bit will remain OFF because it's decimal value is 128. The 7th bit will turn ON because it's decimal value is 64. The 6th, 5th, 4th, and 3rd bits will all remain OFF. The 2nd bit will turn ON to add 2 more to 64 to make 66. The 1st bit will need to be turned on to add 1 more to get the decimal value for capital C of 67.

Brainflakes representing 67 in binary

6. Repeat the steps above to encode the "a" and the "t".

Create a name badge

1. Use your Brain Flakes to encode your first name in binary using ASCII Conversion Chart.

2. Convert your Brain Flakes to 1s and 0s and write your binary code on your name badge. 

High-Level Programming Languages

High-Level Programming Languages

Language converted by compiler to binary

A compiler takes "code" written by programmers and checks for syntax errors and if error free it converts it to binary or machine langauge.