Pages

Chapter 4

ASCII Character Encoding 

The American Standard Code for Information Interchange (ASCII) is a character encoding standard used to represent text in computers and devices. This is important because computer operating systems work with numbers more efficiently than symbols.
All different characters and symbols from all various languages can be assigned decimal number equivalents. You will recognize this as a substitution cipher.

The US-ASCII standard assigns the lower-case letters with decimal (Dec) numbers where a is assigned 97, b is 98, and so on. In fact, all symbols such as upper-case letters, numbers, and punctuation have their own unique decimal number assigned.
With this standard as the key, we can encode messages made from computer keyboards.
----------------------------------------
hello world!
104 101 108 108 111 32 119 111 114 108 100 33
----------------------------------------

In a digital system, decimal numbers are further encoded using 1’s and 0’s which make up the binary numbering system. Even though we do not cover this here, sending messages in pure binary is yet another method of encoding using substitution.

secret code book
01110011 01100101 01100011 01110010 01100101 01110100 00100000 01100011 01101111 01100100 01100101 00100000 01100010 01101111 01101111 01101011


A bit is the basic unit of information used in modern computers. It is usually represented as 0 or 1. A grouping of 8 bits forms a base unit in memory called a byte. There are 256 possible configurations for an 8-bit byte, enough room to store all characters found on a keyboard and more.

1,000 bytes = 1 kilobyte (1 kB)
1,000,000 bytes = 1 megabyte (1 MB)
1,000,000,000 bytes = 1 gigabyte (1 GB)


Qusestion: Why are there more binary numbers than letters in the phrase “secret code book” shown above?
Answer: gur gjb oynax fcnprf pbhag

------------------------------------
Mission 9: Decode the ASCII message.

99 111 109 112 117 116 101 114
115 99 105 101 110 99 101


------------------------------------
Mission 10: Encode the message using ASCII table.

programming rocks!

------------------------------------