Lesson 01 – Lab

In our discussion on Binary Math, we learned computers talk in Binary or Base 2.  In this lab we will use a series of lights to demonstrate how a computer “talks” to us.  For this lab you will need the following materials:

Examine the pictures below.  You will see a set of eight light bulbs.  Each of these represents a place in our binary number.  We will represent the digit ‘0’ by turning the bulb in that position off.  A bulb that is on, will represent ‘1’. In this manner, we can represent an eight digit, binary number.

In your worksheet, indicate first which lights are on or off in the squares under “Lights.”  When you have colored in the squares of the bulbs that are on for each picture (represent one picture on each line), convert that to binary in the “Binary Value” column (off = 0, on = 1).  Once that is complete, look up the decimal and ASCII values corresponding to each binary number in the ASCII chart (hint: all answers will be in the green area of the chart) and write them down in their respective columns, next to their binary values.

To get you started, the value of this first image would be:

offonoffoffonoffoffoff
01001000

Using the ASCII Chart to look up the binary number 01001000 you will see it is equal to the decimal number ‘72’ and the ASCII character ‘H’. 

DecBinaryOctHexChar
720100100011048H

Please note, ‘H’ and ‘h’ are NOT the same characters and hence, do not correspond to the same binary values!  Enter these values on the first line of your worksheet.

As you can see, we represented each character with 8 lights or digits.  This was not a random choice for this lab. In the computer world, we refer to each digit (light) as a ‘bit.’  You may have heard to your operating system as being a 32 or 64 bit operating system.  This tells you how much data your computer can process at once. Eight bits is referred to as a ‘byte.’ As you can see from this lab, a byte is equivalent to a single character.  So a Megabyte (MB) is equal to one million bytes or one million characters.

Note for the Curious.

You will notice the ASCII chart has two additional columns.  One labeled ‘Octal’ and the other ‘Hexadecimal.’  These are the Base 8 and Base 16 numbering systems, respectively.  The discussion on Base 2 and Base 10 is pretty much the same for Base 8 and base 16 except for the obvious, Base 8 uses only eight digits and Base 16, uses sixteen digits.  As you might expect, Base 8 uses the digits 0, 1, 2, 3, 4, 5, 6 and 7. But Base 16 uses sixteen digits. How do we represent that? Well, we cheat a little. We throw in some letters.  So Base 16 uses the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F! So in Base 16, the letter ‘F’ represents the “digit” 15. 

Both octal and hexadecimal are used often in computers to represent binary numbers more compactly.  A single octal digit can be used to represent three binary digits. Remember, the binary value 111 equals 7 in decimal.  It also equals 7 in octal. Likewise, hexadecimal can be used to represent four binary digits. The binary value 1111 equals 15 in decimal, which we just learned equals ‘F’ in hexadecimal.  If you lookup the hexadecimal color code F08080 you will see it corresponds to the color “Light Coral.”  To write that same, six digit hexadecimal code in binary you would have to use twenty four binary digits!  In fact, the number would be 111100001000000010000000. Ewwwww…..! You can see why we put up with a few letters in our hexadecimal number system!