Presentation is loading. Please wait.

Presentation is loading. Please wait.

The ASCII Alphanumeric Code What is it? Why use it? How do we use it?

Similar presentations


Presentation on theme: "The ASCII Alphanumeric Code What is it? Why use it? How do we use it?"— Presentation transcript:

1 The ASCII Alphanumeric Code What is it? Why use it? How do we use it?

2 What is it? ASCII code represents alphanumeric data in most computers. “American Standard Code for Information Interchange” It works like any other code. One thing represents another. In ASCII, binary is used to represent our numbers, letters and symbols. ASCII includes definitions for 128 characters: 33 are non-printing control characters (many now obsolete) that affect how text and space is processed and 95 printable characters, including space.

3 Why do we use it? At a very basic level we use ASCII because computers store all information in binary. Therefore we need some way to encode numbers, letters and symbols in binary. At first many different character sets were used, so on one system the code 0100001 would represent A, but on another it could be P, or Y!!!

4 Obviously this situation was far from ideal. A standard character set was needed so that consistency between systems could be achieved. Almost all character sets in use, now begin with the 128 ASCII characters. Why do we use it?

5 Each character (or command) is represented as a number from 0 to 127. This is stored as a binary value in 7 bits. 1 bit is reserved for error checking. We will learn about this later. In today’s lesson the MSB will always be 0. How do we use it?

6 What is it?

7 Bytes per Character Try this experiment: Open up a new file in Notepad and insert the sentence, "Four score and seven years ago" in it. Save the file to disk under the name getty.txt. Then use the explorer and look at the size of the file. You will find that the file has a size of 30 bytes on disk: 1 byte for each character. If you add another word to the end of the sentence and re-save it, the file size will jump to the appropriate number of bytes. Each character consumes a byte.

8 Decode some ASCII Practice ASCII, Binary, and learn some great jokes at the same time! What kind of guns do bees use? 01000010 01100101 01100101 01000010 01100101 01100101 00100000 01100111 01110101 01101110 01110011 What do you call a Bee who is having a bad hair day? 01000001 00100000 01000110 01010010 01001001 01010011 01000010 01000101 01000101 00100001

9 Decode some more ASCII Practice ASCII, Binary, and learn some great jokes at the same time! Why do bees have sticky hair? 01001000 01101111 01101110 01100101 01111001 00101101 01100011 01101111 01101101 01100010 01110011 00100001 What do you get when you cross a sheep and a bee? 01000001 00100000 01100010 01100001 01101000 00101101 01101000 01110101 01101101 01100010 01110101 01100111 00101110

10 The 8 th Bit In ASCII the 8 th bit is called a parity bit. There are two kinds of parity: odd or even. Odd or even parity is determined by the number of 1's in the code. Obviously, an even number of 1's makes it even and an odd number of 1's makes it odd. Even and Odd Parity For example, the ASCII code for 'S' is 1010011. To get even parity, we add 0, giving us 01010011. If we count the 1's, we get 4 which is an even number. To get odd parity, we simply add another 1, giving us 11010011, containing 5 1's. Error Detection with a Parity Bit The type of parity is determined by the transmitter and receiver. Both systems must use the same parity scheme. For example, if even parity is used, and say ASCII 'O' (11001111) is transmitted and the receiver receives 11001011, it is obvious an error has happened because there is an odd number of 1's. The receiving system can then call for retransmission. Problems with this Type of Error Detection The main drawback to this type of error detection is that multiple errors cannot be detected. For example, ASCII 'k' with even parity (11101011) is transmitted. The receiver receives 11011011. This is the ASCII code for [. This is not the character we want, but it is not detected as an error because it is still even parity.


Download ppt "The ASCII Alphanumeric Code What is it? Why use it? How do we use it?"

Similar presentations


Ads by Google