ASCII Code
What happens when you press a key on the keyboard? How does the computer know what to display when all it can read are zeroes and ones?
The computer knows an assigned number for every key! The assigned numbers are called ASCII Code, which stands for American Standard Code for Information Interchange. For this lesson, we will only use the codes that stand for the capital letters of the alphabet. The letter A is assigned the number 65, and each letter goes up by one until Z, which is 90. We will also need to use a SPACE, and the SPACE BAR key on the computer is assigned the number 32. Here's a table to show the values:
| A=65 | B=66 | C=67 | D=68 | E=69 | F=70 | G=71 |
| H=72 | I=73 | J=74 | K=75 | L=76 | M=77 | N=78 |
| O=79 | P=80 | Q=81 | R=82 | S=83 | T=84 | U=85 |
| V=86 | W=87 | X=88 | Y=89 | Z=90 | SPACEBAR=32 |
If you type the letters for LA JOYA , the ASCII code would be 76,65,32,74,79,89,65
Remember how we converted Base Ten to Base Two (if you forgot, go to Understanding Binary Code)? Now convert the code numbers to binary for the processor to read.
| Letter | ASCII | Place value of the binary switches |
|||||||
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | ||
| L | 76 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
| A | 65 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
| spacebar | 32 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| J | 74 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
| O | 79 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 |
| Y | 89 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 |
| A | 65 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
Now, try to convert your name to ASCII, then to binary, using the worksheet. Print the page and turn it in to Mr. H
Want to know all of the ASCII values? View them at http://www.jimprice.com/ascii-0-127.jpg
Curious? See if you can find out what hexadecimal (HEX) code is.
Harrell
September 30, 2009