Room 514

Classes, curriculum, education…

ASCII Text & Codes February 11, 2008

Filed under: ICE3M, computers — mryantho @ 12:33 am
Tags: ,

The American Standard Code for Information Interchange (ASCII) is used by computers as a way to store letters as numbers (binary.)  But ASCII is actually older than the computer.  ASCII was created for teletype machines.  Teletype machines were like a cross between a typewriter and a fax machine (but these pre-date fax machines.)  The operator could type and the signals were carried to a receiver where a printer would interpret the codes in order to print to paper.  So ASCII was used interpret letters to signals to be transmitted, received and then printed.

 Question:  What is the importance of having a standard format?

See ASCII code chart here.

ASCII codes are obviously numbers, but we have to remember that they are actually stored as binary numbers.  So the capital letter “H” isn’t stored as 72, but rather as  1001000.  ASCII numbers are stored as 7 bit binary numbers.  This means that we have the lowest number as 0 (0000000) and a highest value of 127 (1111111) for a total range of 128.  This means we can have 128 ASCII characters. Seven might seem like a strange number because usually we use sets of eight bits.  Well in old computers, the 8th bit was used to check for errors, this was called a parity bit

Parity Bit?

So what exactly is a parity bit?  A parity bit was an extra bit used to check for errors.  Early forms of transmission would often have errors.  Of course, today when we transmit data (say, on a network) we still have errors.  An error in transmission often means that one digit is read wrong.  So the receiver thinks a digit is a one, when it should be a zero, or vice-versa.  A parity bit is an extra bit that can be set to either one or zero.  As an example, it is used to make sure that every group of 8 bits has an even or odd number of ones.  Let’s see an example:

Problem: Transmit the message: 0110101 1101011 0001101 1001101 0010100 with parity bits to try and check for errors.

Solution: Make each chunk of 7 digits have an even number of ones (even parity bit):

0110101 1101011 0001101 1001101 0010100 -> 00110101 11101011 10001101 01001101 00010100

Now each chunk of 8 bits has an even number of ones.  Each chunk is made of 7 bits of data, and 1 parity bit.

Unicode

What is Unicode? Well let’s go straight to the source: The Unicode Home Page:

Fundamentally, computers just deal with numbers. They store letters and other characters by assigning a number for each one. Before Unicode was invented, there were hundreds of different encoding systems for assigning these numbers. No single encoding could contain enough characters: for example, the European Union alone requires several different encodings to cover all its languages. Even for a single language like English no single encoding was adequate for all the letters, punctuation, and technical symbols in common use.

 So, while ASCII was good to represent all our English letters, it clearly isn’t enough to represent all the characters of all languages as binary numbers.

ASCII and Unicode aren’t the only way of encoding text, but they are two of the most popular and widely used methods.

Homework:

Decode the following messages manually & show your work (Due next class):

  1. 1001000 1000101 1001100 1001100 1001111
  2. 1001001 1000011 1000001 1001110 1010111 1001111 1010010 1001011 1001001 1010100 1001111 1010101 1010100

Assignment:

You will create an exemplar document (either by hand or electronically) showing how to perform binary addition and binary multiplication.  This should include one page for each addition and multiplication.  As this is an exemplar document, the main foucs is the example you use.  This means you should choose your example(s) wisely so that you can highlight the aspects of the process.

Due: Wednesday Feb 13

 

Leave a Reply