wpe41.gif (23084 bytes)CIS3355: Business Data Structures
Fall, 2008
 

What happens when we add ASCII characters together?

Don't forget our earlier discussion on ASCII:

The American Standards Association (ASA), as it was called at that time (now ANSI: The American National Standards Institute), a federal organization intended to coordinate national standards development in an effort to avoid duplication, waste and conflict, devised a coding scheme called ASCII: The American Standard Code for Information Interchange. It became a standard in 1963. Although it has gone through a few revisions since then, it remains the standard used by most computer manufacturers.

 What does the coding scheme look like??

Here are some sample symbols and the binary sequence they correspond to:

BINARY SEQUENCE

Symbol

Meaning

00000000

NUL

The NULL Character

00000001

SOH

start-of-heading

00000010

STX

start-of-text

º º º º º º º º º
00100001 ! Exclamation Mark
00100010 " Double Quotation
00100011 # Number Sign
º º º º º º º º º
00110000 0 The Character 0
00110001 1 The Character 1
00110010 2 The Character 2
00110011 3 The Character 3
00110100 4 The Character 4
º º º º º º º º º
01000001 A Capital A
01000010 B Capital B
º º º º º º º º º

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:

  00110010
+00110011
  01100101

Now we all know that 2 + 3 = 5. However, lets take a closer look at our ASCII tables:

BINARY SEQUENCE

Symbol

Meaning

º º º º º º º º º
01100001 a Lower Case a
01100010 b Lower Case b
01100011 c Lower Case c
01100100 d Lower Case d
01100101 e Lower Case e
01100110 f Lower Case f
º º º º º º º º º


Ahhhhhh!

How is that possible ???
2 + 3 = the character lower case 'e' ??

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':

               'C'
      + 'D'
         '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:

  1. ASCII: American Standard Code for Information Infiltration

  2. An early history of character set standardization

  3. ASCII Characters for MPE Users

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
‘7’  =
    00110111

 Therefore:

     00110001
 00110111
-------------------
     01101000

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.