Lesson Objectives • Explain the use of binary codes to represent characters • Explain the term “Character set” • Describe with examples (for examples ASCII and Unicode) the relationship between the number of bits per character in a character set and the number of characters which can be represented. Lesson Outcomes • All students will identify different character sets • MOST students will score at least 4/6 on the exam questions • SOME students will attempt the extension activity When you type a letter on your keyboard, for example the letter "K," have you ever wondered what has to happen in order to display the letter on your screen? In order to display the letter you just typed on the screen, the computer must decode the binary to determine that the letter is a "K" and then must display the image of a letter "K." When you type a "K," the "K" button sends a special electrical signal consisting of 0's and 1's to the CPU of the computer. The letter is encoded in binary. Look at the keyboard in front of you… • How many different characters/letters/symbols are you able to type on your keyboard? • Don’t forget upper case! • You should be able to find around 100. • How many BITS would we need to represent this number of characters? 128 64 1 32 1 We need 7 16 1 8 1 4 1 bits. 1111111 = 127 2 1 1 1 Representing Characters • Computers can only work with binary data. • Binary data can easily represent numbers. • If we make each number represent a letter, or character, then we can store characters. • One common code (ASCII) uses seven bits to store each character. ASCII • ASCII = American Standard Code for Information Interchange • In total 127 codes (95 printable, 32 non-printable) plus the null character 00000000 used as a control character but with no associated symbol. This is just part of the ASCII table… • MISS LEVITT in denary is… 109 105 115 115 108 101 118 105 116 116 • MISS LEVITT in binary is… • 01101101 • 01101001 • 01110011 • 01110011 • 00100000 • 01101100 • 01100101 • 01110110 • 01101001 • 01110100 • 01110100 Work out your names in DENARY and BINARY Write a coded message • Use the ASCII table to write a coded message to a friend. • Use the DECIMIL/DENARY conversion to write your message • Swap with a friend and decode it! What if we need more characters? • 128 characters are not enough to encode all languages. • There are other systems that use more than 7 bits. • EBCDIC is the Extended Binary Coded Decimal Interchange Code – this is used in IBM mainframes. • It uses 8 bits so can encode 256 different characters. • Unicode is more common these days. • Unicode comes in different variants, but can encode more than 107,000 characters, covering 90 languages. • For example, Հայերեն हिन्दी עבריתಕನ್ನಡ ქართული कश्मीरी )كشميريКыргызча മലയാളം मराठी • Unicode is a 16 bit system (2 x 8 bits) • E.g 01011011 11101101 What you need to know… 1. These ways of representing letters and characters are knows as “Character sets” 2. Two of the most common “Character sets” are Unicode and ASCII 3. The number of characters which need to be represented effects the number of bits required. 1. ASCII – 7 bits for less than 127 characters. 2. EBCDIC or Extended ASCII – 8 bits for 256 characters 3. Unicode – 16 bits for over 65,00 characters Explain how ASCII is used to represent text in a computer system [3] • There are 3 marks therefore 3 points must be made. You could include – Each character is given a numeric code – This code is stored in binary – Each character takes up 7 bits – The binary code is then translated in the CPU – Some codes are reserved for characters and keyboard shortcuts State what is meant by the term “character set” [1] • For one mark a simple definition is needed • “A character set is all the characters which have to be recognised by the computer system.” Unicode is also used to represent text in a computer system. Explain the difference between the character set of Unicode and ASCII [2] • You need to directly compare two contrasting features of Unicode and ASCII • Eg. “ACCII has 7 or 8 bits per character whereas Unicode uses 16 bits” • OR • “ASCII can represent only 127 characters whereas Unicode has a much larger character set (around 50,000) Scores: • C - 3/6 on the exam questions • B - 4/6 on the exam questions • A/A* 5+ on the exam questions Extension • Correct the teacher – identify the errors in the passage of text.