Chapter 8 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1
Computer Circuits Computer circuits can be in one of two states low or high Also known as: 0 and 1 off and on false and true no and yes absence and presence 2
Discrete Values These two states of a circuit are said to be discrete or distinct 3
Two States Low voltage in RAM, VRAM, or the CPU corresponds to – Demagnetized spot – Hard drive – Bump – CD or DVD High voltage in RAM, VRAM, or the CPU corresponds to – Magnetized spot – Hard drive – Land – CD or DVD Everything must be encoded into a representation using these two states (written as 0's and 1's). 4
Bits Each circuit is more commonly called a bit where bit is short for binary digit Why? The only digits in the binary number system are 0 and 1 which fit in perfectly with the two state nature of a computer. 5
Number Systems Decimal number system – We know this! – base 10 – 10 symbols – e.g. 1375, also written (1 * 10 3 ) + (3 * 10 2 ) + (7 * 10 1 ) + (5 * 10 0 ) Binary number system – What is this? – base 2 – 2 symbols 0 – 1 – e.g. 1001, also written (1 * 2 3 ) + ( 0 * 2 2 ) + (0 * 2 1 ) + ( 1 * 2 0 ) 6
Number Systems Decimal number system – We know this! – base 10 – 10 symbols – e.g. 1375, also written (1 * 10 3 ) + (3 * 10 2 ) + (7 * 10 1 ) + (5 * 10 0 ) Binary number system – What is this? – base 2 – 2 symbols 0 – 1 – e.g. 1001, also written (1 * 2 3 ) + ( 0 * 2 2 ) + (0 * 2 1 ) + ( 1 * 2 0 ) 7
Encoding Text How many bits, minimum, would it take to encode…? 26 lowercase letters and 10 digits 36 total characters 8
Powers of 2 This many bitsWill encode this many items 12 1 = = = = = = = = 256 n2n2n 9
Encoding Text How many bits would it take to encode…? 26 lower case letters 26 upper case letters 10 digits 10 arithmetic characters 20 punctuation characters 3 non-printable characters 95 characters 10
How Many Bits to Encode 95 Characters? 11 This many bitsWill encode this many items 12 1 = = = = = = = = 256 n2n2n
Encoding Text The original ASCII code was a 7-bit code. A widely used encoding scheme today is the Extended ASCII code or ISO The Extended ASCII code is an 8-bit code. So, the code for one character will fit exactly into one byte. 12
ASCII code p. 235 What is the ASCII code for each character? H & 3 What ASCII character is represented by each code?
ASCII Code The ASCII code is for encoding text only. ASCII 62 is The number 62 is The computer cannot do arithmetic with ASCII digits. 14
Encoding Text Becoming more wide spread is a new multibyte (one to four bytes) code called the Unicode It can handle all symbols in all languages To see other languages go to 15 कम्प्यूटर, मूल रूप से, नंबरों से सम्बंध रखते हैं। ये प्रत्येक अक्षर और वर्ण के लिए एक नंबर निर्धारित करके अक्षर और वर्ण संग्रहित करते हैं। यूनिकोड का आविष्कार होने से पहले, ऐसे नंबर देने के लिए सैंकडों विभिन्न संकेत लिपि प्रणालियां थीं। किसी एक संकेत लिपि में पर्याप्त अक्षर नहीं हो सकते हैं : उदाहरण के लिए, यूरोपिय संघ को अकेले ही, अपनी सभी भाषाऒं को कवर करने के लिए अनेक विभिन्न संकेत लिपियों की आवश्यकता होती है। अंग्रेजी जैसी भाषा के लिए भी, सभी अक्षरों, विरामचिन्हों और सामान्य प्रयोग के तकनीकी प्रतीकों हेतु एक ही संकेत लिपि पर्याप्त नहीं थी।
Encoding Other Things In chapter 11 we will look at encoding numbers, images and video. 16
Do you remember color codes? Would you rather type this color code? 3 E C 5 A 7 Or this?
Hexadecimal Since the earliest days of computing, two hexadecimal digits have been used as a shorthand notation for 8 bits (one byte) If two hexadecimal digits symbolize one byte, then one hexadecimal digit must correspond in some way to 4 bits 18
Hexadecimal Base symbols for building numbers: (0 – 9, A – F) Examples of hexadecimal numbers: 387 4AFFCC 19
Hexadecimal – Binary Equivalents A1010 B1011 C1100 D1101 E1110 F1111 What would be the hexadecimal shorthand for this 2 byte binary code? answer: 3CF6 What would the one byte binary code that corresponds to this hexadecimal shorthand? B5 answer:
Hexadecimal – Binary Equivalents A B C D E F First column of bits: 8 zeros, 8 ones Second column of bits: 4 zeros, 4 ones Third column of bits: 2 zeros, 2 ones Fourth column of bits: 1 zero, 1 one 21
Tags: A Higher Level of Encoding HTML tags are also a form of encoding – Formatting – Special non-text items Tags can also be used to encode – Structure – See the Oxford English Dictionary example in the chapter 22