Bold Idea

View Original

Binary: The language of machines

Have you ever wanted to communicate with a computer? Here is something you can start with:

01001000 01100101 01101100 01101100 01101111

That’s ‘Hello’ in binary, the language of machines. You will notice that the letters are represented using only ones and zeros. When computers represent information in only two ways, it’s called binary or Base 2. Everything that you see or hear on the computer — words, numbers, movies and even sound — is stored using just those two numbers!

But why do we represent digital information in just two values?

If you’ve ever looked inside a computer, you would have seen that there are wires, hard drives, the motherboard and various ports. Wires carry information through the machine in the form of electricity. The two options that a computer uses with respect to this electrical information are "off" and "on” where "on" is a 1 and "off" is a zero. Often times the 1 is a "high" voltage, while the 0 is a "low" voltage or ground.  So, letters and numbers can be simply represented as a string of electrically pulsed ons and offs. 

Image source: Wikimedia Creative Commons

That theme of two options doesn't stop when the information gets to its destination. Computers also store information using binary, and binary isn't always off and on. Hard Disk Drives store information using magnetic positive and magnetic negative. DVDs store information as either reflective or non-reflective. Boolean logic (which we will review in a later post) uses true and false. Really any form of opposites can be used.

How do you suppose we can convert the things we store in a computer into binary?

Try It Yourself

Here are two hands-on activities that we use to teach numbers and letters written at binary. These activities will teach you how to send secret messages to your friends using exactly the same method as a computer.

Binary numbers

For this activity, you will need a set of five cards, as shown below, with dots on one side and nothing on the other. We used one-fourth of a poster board and drew on purple dots. The cards should be in the following order:

What do you notice about the number of dots on the cards? If you noticed that each card has twice as many dots as the card on the right, then you are correct!

How many dots would the next card have if we carried on to the left? That’s right - 32!

We can use these cards to make numbers by turning some of them face down and adding up the dots that are showing. When a binary number is not showing, it is represented by a zero. When it is showing, it is represented by a one. This is the binary number system.
Here is an example of 01001 or 9. What would 17 be in binary?
 

Fun facts

  • A grouping of four bits is called a nibble. 
  • A grouping of eight bits is called a byte.
  • A grouping of 1,024 bites is a called a kilobyte.
  • A grouping of 1,048,576 bytes is called a megabyte.

After trying this several times with the cards, you may see a pattern in how the cards flip. Each card flips half as often as the one to its right.

Each spot where you can have a binary option is called a “binary digit” - or “bit” for short. If we want to represent data with greater values - like 33 or 3,000, we just add more bits. 

    *This activity and additional materials are from Computer Science Unplugged
     

    Binary Bracelets (or keychains)

    Our original binary example - Hello or 01001000 01100101 01101100 01101100 01101111 - uses letters in the English alphabet. In fact, every keystroke on your keyboard is represented in binary. 

    In this activity, you will represent the letters in your first name - or your initials - in binary using any two colors of beads. We like to use Perler beads but any will do. You will also need some stretchy cord, scissors and a split ring if you plan to make a keychain. 

    Steps:

    1. Decide which color will represent 1 and which color will represent 0.
    2. Find the first letter of your first name in the binary alphabet below. 
    3. Add the beads to a length of your stretchy cord that match the pattern of the squares next to the letter that you selected. (You'll want to tie off an overhand knot at the end of your cord to keep the beads on the bracelet).
    4. Repeat the last step for the remaining letters of your name.
    5. Tie off a final knot on your cord after the last bead. Wear it around your wrist as a bracelet or tie it onto a split ring to make a keychain. 
    6. Share your bracelet with your classmates to see if they can figure out your letters!

    talkSTEM PiDay 2017

    We had a lot of fun meeting young students (and adults!) at talkSTEM’s Pi Day 2017 in the Dallas Arts District and encouraging them to try some binary.