Presentation is loading. Please wait.

Presentation is loading. Please wait.

Coding System Text Representation ASCII Collating Sequence.

Similar presentations


Presentation on theme: "Coding System Text Representation ASCII Collating Sequence."— Presentation transcript:

1 Coding System Text Representation ASCII Collating Sequence

2 What is a BIT As w know a bit is the smallest unit in a computer system A bit can either be a 1 2 or a 0 2 This means that with one single bit we can only represent only 2 different values 1 2 = 1 10 and 0 2 = 0 10

3 Representing Text, Pictures ect … Text, pictures and videos are also stored in a computer system using a sequence of binary digits Using one single bit is not enough due to its small size If we want to store a large quantity of data many more bits are required.

4 Combining a number of Bits Each time a bit is combined with another bit, more different combinations can be stored. If we will be using two bits to store data, there are a total of 2 2 = 4 different combinations Hence if we have 4 bits we would have 2 4 = 16 different combinations

5 Working With the following number of bits how many combinations could be created? 1. 5 bits 2. 3 bits 3. 6 bits 4. 8 bits

6 Answers 1. 5 bits = 2 5  32 combinations 2. 3 bits = 2 3  8 combinations 3. 6 bits = 2 6  64 combinations 4. 8 bits = 2 8  256 combinations

7 List of Combination Number of BitsCalculationNumber of Combinations 12121 2 22 4 32323 8 42424 16 52525 32 62626 64 72727 128 82828 256

8 In the Early Days When computers were first introduced they were simply used for performing calculations After a while scientists realized that computers can also be used to store and edit text in different ways The problem was that a computer could only understand binary (1s & 0s)

9 ASCII Coding System The scientists had to come up with a way for binary to be able to represent characters ASCII (American Standard Code for Information Interchange) was developed With ASCII every single character is assigned a binary code ASCII also allows computers to communicate with each other (files containing text can be copied from one computer to another)

10 How ASCII Coding Works The first ASCII system used a series of 7 Bits This meant that 2 7 =128 different characters could be used These 128 characters are represented in the following table

11 CodeCharCodeCharCodeCharCodeChar 0NUL32Space64@96` 1SOH33!65A97a 2STX34“66B98b 3ETX35#67C99c 4EOT36$68D100d 5ENQ37%69E101e 6ACK38&70F102f 7BEL39‘71G103g 8BS40(72H104h 9TAB41)73I105i 10LF42*74J106j 11VT43+75K107k 12FF44,76L108l 13CR45-77M109m 14SO46.78N110n 15SI47/79O111o 16DLE48080P112p 17DC149181Q113q 18DC250282R114r 19DC351383S115s 20DC452484T116t 21NAK53585U117u 22SYN54686V118v 23ETB55787W119w 24CAN56888X120x 25EM57989Y121y 26SUB58:90Z122z 27ESC59;91[123{ 28FS60<92\124| 29GS61=93]125} 30RS62>94^126~ 31US63?95_127DEL

12 Now a Day’s The first 32 characters were used for transmission purposes, they are no longer needed After some time it was noted that ASCII consisted only of the English alphabet, so an extra bit was added to accommodate more languages, graphics and mathematical symbols By adding an extra bit 128 more characters can be stored since 2 8 =256.

13 Codes Available Today

14 Try it! You can check the symbols on your computer by typing in its decimal code 1. Open Notepad (Start > Programs > Accessories > Notepad) 2. Make sure that NUM LOCK is switched on 3. Press and hold ALT 4. From the Numpad enter the 3 digits that you want (example 234 for Ω ) 5. Release the ALT, and the symbol should appear.

15 Important Note It is important that all computers use ASCII as otherwise different codes would represent different values Example if a computer used the XYZ system (fictitious) and another uses ASCII the work HELLO would be represented differently on the two machines

16 Coding in ASCII We must use the ASCII table to be able to code the following; LetterHELLO Decimal Code726976 79 Binary Code100100010001011001100 1001111

17 Example of XYZ system Remember this is fictitious CodeCharCodeCharCodeChar 1A69!76* 2B70“77( 3C71£78) 4D72$79- 5E73%80_ 6F74^81+...75&...

18 So HELLO would look different when decoded Binary Code100100010001011001100 1001111 Decimal726976 79 Letter$!**-

19 When the computer with the XYZ representation system receives the text file from the computer with the ASCII representation system instead of HELLO, one will see $!**-, which is completely wrong! Since nowadays computers are used across the world a new system is being used which is UNICODE UNICODE is compatible with ASCII but then it uses a different system. A list of UNICODE characters can be accessed on http://en.wikipedia.org/wiki/List_of_Unicode_cha ractershttp://en.wikipedia.org/wiki/List_of_Unicode_cha racters.

20 Work Code the following word using ASCII; LetterBYE!! Decimal Code Binary Code

21 Answer LetterBYE!! Decimal Code66896933 Binary Code1000010101100110001010100001

22 Collating Sequence The character codes assigned to the characters in ASCII are very important since they can be used to sort letters and distinguishing from upper to lower case letters For instance if the letters C, V and B have to be sorted, they can be easily sorted by looking at their ASCII code and use it to sort text in ascending (A  Z) or descending order (Z  A).

23 Example CharacterCode C67 V86 B66 Using the ASCII codes the computer could sort the letters in ascending or descending order by sorting the ASCII code (numbers)


Download ppt "Coding System Text Representation ASCII Collating Sequence."

Similar presentations


Ads by Google