CIS3355:
Business Data Structures |
What happens when we add ASCII characters together? Don't forget our earlier discussion on ASCII:
From the above table, we can see, for example that a manufacturer wanted to represent the number 2, they would store it as: 00110010 or more precisely as:
(Using our light switches) Similarly, the number 3 would be stored as 00110011 or more precisely as:
Since we now know how to add in binary, we can now add the two numbers:
Now we all know that 2 + 3 = 5. However, lets take a closer look at our ASCII tables:
How is that
possible ??? ASCII is merely a scheme for representing characters or symbols, ONLY!! But we are talking about Numbers !!! While numbers (mathematically) have a different application (and are universal), the SYMBOLS used to represent them are arbitrary. Who is to say that the 'symbol' 4 really represents the number 4?? The Romans used the symbol IV to represent the value 4. Why couldn't the symbol ζ be used to represent the value 4?? It could!! Is a 'License Plate Number" really a number?? It is very much like languages. Which symbols are better? The Roman Alphabet (ours), the Cyrillic Alphabet (Russian), the Greek Alphabet (Greek), or the Arabic Alphabet? Maybe it is the Chinese character set, or the Japanese character set? Obviously, they are all the same. You go and tell 300 Million Russians that they don't know what they are doing. I won't. Regardless of what character set you are talking about, it doesn't make sense to add characters together. For example, it makes no sense to say that the character 'C' added to the character 'D' yields the character 'F':
So the computer doesn't deal with
numbers, only symbols??? No, quite the opposite: COMPUTERS ONLY WORK WITH NUMBERS! We are getting a little ahead of ourselves, but as we will soon see, the ASCII bit sequences for the characters '2' and '3' really turn-out to be the numeric values 50 and 51 (respectively): Further, know that 50 + 51 = 101, and as we will see, the binary representation of 10110 is: Which, as we saw, is the sequence of bits used to represent the character 'e' in ASCII (Meaning that the character 'e' is really stored as the numeric vale 101). What ??? Don't worry if it doesn't make complete sense right now. We are getting to these topics soon. Some good references include: Questions you should be able to answer: What happens when we add the add the ASCII characters ‘1’ and ‘7’ together? Why? From the ASCII tables, we know:
‘1’ =
00110001 Therefore:
00110001 Which corresponds to the character ‘h’ (01101000) WHY??? Because the character ‘1’ is really the ASCII value 49, and the Character ‘7’ is really the ASCII value 55. When we add 49 and 55 we get 104 which is the character ‘h’. This page was last updated on 05/24/05.
|