Binary Systems and Codes

Similar documents
Lecture (02) Operations on numbering systems

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

BINARY SYSTEM. Binary system is used in digital systems because it is:

NUMBER SYSTEMS AND CODES

Digital Systems and Binary Numbers

Binary Codes. Dr. Mudathir A. Fagiri

Digital Systems and Binary Numbers

Review of Number Systems

Digital Fundamentals

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Lecture (03) Binary Codes Registers and Logic Gates

Chapter 1. Digital Systems and Binary Numbers

Number System. Introduction. Decimal Numbers

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

The Gray Code. Script

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Korea University of Technology and Education

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

DIGITAL SYSTEM DESIGN

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

in this web service Cambridge University Press

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

CHW 261: Logic Design

Introduction to Numbering Systems

Chap 1. Digital Computers and Information

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Digital Fundamentals

Digital Systems and Binary Numbers

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

Positional Number System

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

Chapter 1 Review of Number Systems

Computer Organization

MC1601 Computer Organization

Lecture 2: Number Systems

Numbering systems. Dr Abu Arqoub

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

D I G I T A L C I R C U I T S E E

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

Chapter 2 Number Systems and Codes Dr. Xu

SE311: Design of Digital Systems

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

Chapter 2: Number Systems

Module -10. Encoder. Table of Contents

Chapter 2. Data Representation in Computer Systems

Number Systems CHAPTER Positional Number Systems

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

CS & IT Conversions. Magnitude 10,000 1,

UNIT 7A Data Representation: Numbers and Text. Digital Data

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

MACHINE LEVEL REPRESENTATION OF DATA

Number Systems Base r

Microcomputers. Outline. Number Systems and Digital Logic Review

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Dec Hex Bin ORG ; ZERO. Introduction To Computing

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

Digital Fundamentals

Electronics Engineering ECE / E & T

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

Chapter 3 DATA REPRESENTATION

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

CHAPTER 2 (b) : AND CODES

EE 109 Unit 6 Binary Arithmetic

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Bits, Words, and Integers

Internal Data Representation

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr


plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes. Error Detection Codes

Data Representation and Binary Arithmetic. Lecture 2

Number Systems & Encoding

1.1 Information representation

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Electronic Data and Instructions

CMPS 10 Introduction to Computer Science Lecture Notes

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Chapter 3: part 3 Binary Subtraction

umber Systems bit nibble byte word binary decimal

ECE 20B, Winter Purpose of Course. Introduction to Electrical Engineering, II. Administration

Computer Organization

Review of HTML. Ch. 1

CC411: Introduction To Microprocessors

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

THE LOGIC OF COMPOUND STATEMENTS

Computer Logical Organization Tutorial

This tutorial gives a complete understanding on Computer Logical Organization starting from basic computer overview till its advanced architecture.

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

Topic Notes: Bits and Bytes and Numbers

Fundamentals of Programming (C)

Transcription:

1010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Binary Systems and Codes 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Contents: 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Number System. 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Number Base Conversions. 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 10101010101010101010101010101010101010101010101010101010101010101010101010101010 Complements. 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Subtraction with complements. 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Binary Codes: Decimal Codes, Reflected Code, Error detection code, Alphanumeric Code 101010101010101010101010101010101010101010101010101010101010101001010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Prepared By 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Mohammed Abdul kader 1010101010101010101010101010101010101010101010101010101010101010101010101010101010 Assistant Professor, EEE, IIUC 1010101010101010101010101010101010101010101010101010101010101010101010101010101010

Number System 110101 101010 In general, in any number system there is an ordered set of symbols known as digits with rules defined for performing arithmetic operations like addition, multiplication etc. A collection of these digits makes a number in general has two parts- integer and fractional. Set apart by a radix point (.), i.e. where (N) r = a n 1 a n 2 a 2 a 1 a o. a 1 a 2. a m Integer portion Radix point Fractional portion N= a number r = radix or base of number system n= number of digits in integer portion m= number of digits in fractional portion a n 1 = most significant digit (MSD) a m = least significant digit (LSD) In general, a number expressed in base-r system has coefficients multiplied by powers of r: a n 1. r n 1 + a n 2. r n 2 + + a 1. r 1 + a o. r 0 + a 1. r 1 +a 2. r 2 + + a m. r m For example, (3456.54) 10 can be written as- 3 10 3 + 4 10 2 + 5 10 1 + 6 10 0 + 5 10 1 +4 10 2 2

Numbers with different Base 110101 101010 Decimal (Base 10) Binary (Base 2) Octal (Base 8) Hexadecimal (Base 16) 00 0000 00 0 01 0001 01 1 02 0010 02 2 03 0011 03 3 04 0100 04 4 05 0101 05 5 06 0110 06 6 07 0111 07 7 08 1000 10 8 09 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F 3

110101 101010 Following Conversions are necessary: a) Other base (binary, octal, hexadecimal) to decimal b) Decimal to other base. c) Binary to Octal and Hexadecimal d) Octal and Hexadecimal Conversion a) Any base to decimal Binary to Decimal: Convert binary 1010.011 2 into decimal. 1010.011 2 = 1 2 3 + 0 2 2 + 1 2 1 + 0 2 0 + 0 2 1 + 1 2 2 + 1 2 3 =(10.375) 10 Octal to Decimal: Convert octal 630.4 8 into decimal. (630.4) 8 = 6 X 8 2 +3 X 8+ 4 X 8-1 = (408.5) 10 Number Base Conversions Hexadecimal to Decimal: (A9F5.DE) 16 = Similar as previous conversions, only consider base as 16. 4

110101 101010 b) Decimal to any base Decimal to Binary: Convert (41.6875) 10 to binary. Number Base Conversions (Cont.) Conversion of integer part: integer Reminder 41 20 1 10 0 5 0 2 1 1 0 0 1 Conversion of fractional Part: integer Fraction 0.6875 X 2 1 0.3750 0.3750 X 2 0 0.7500 0.7500 X 2 1 0.5 0.5 X 2 1 0 (0.6875) 10 =(0.1011) 2 (41) 10 = (101001) 2 5

Number Base Conversions (Cont.) 110101 101010 Decimal to Octal: Convert (153.513) 10 to Octal Integer Part Fractional Part Integer Reminder Integer Fraction 153 0.513 X 8 4 0.104 19 1 0.104 X 8 0 0.832 2 3 0.832 X 8 6 0.656 0 2 0.656 X 8 5 0.248 0.248 X 8 1 0.984 0.984 X 8 7 0.872 Answer: (153.513) 10 = (231.406517.) 8 Decimal to Hexadecimal: Divide integer part by 16 and multiply fractional part by 16. 6

110101 101010 c) Binary to Octal and Hexadecimal Numbers Since 2 3 =8 and 2 4 = 16, each octal digit corresponds to three binary digits and each hexadecimal digit corresponds to four binary digits. The conversion from binary to octal is easily accomplished by partitioning the binary numbers into groups of three digit each, starting from the binary point and proceeding to the left and to the right. Number Base Conversions (Cont.) Conversion from binary to hexadecimal is similar, except that the binary numbers is divided into groups of four digits: 7

Number Base Conversions (Cont.) 110101 101010 d) Conversion of Octal and Hexadecimal Numbers Conversion from octal to hexadecimal or hexadecimal to octal is so easy if we follow the following procedure: 8

Number Base Conversions (Cont.) 110101 101010 Usefulness of Octal and Hexadecimal Numbers A common question may arise, Human are used to in decimal number and digital systems works with binary number. So, why should we use octal and hexadecimal numbers? Binary numbers are difficult to work with because they require three or four times as many digits as their decimal equivalent. For example, the binary number 111111111111 is equivalent to decimal 4096 (hexadecimal FFF and Octal 7777). However, digital computers use binary numbers and it is sometimes necessary for the programmer or human operators or user to communicate directly by means of binary numbers. When dealing with large number of binary bits, it is more convenient and less error-prone to write the binary numbers in octal or, decimal or, hexadecimal because the numbers can be expressed more compactly. Among these three octal and hexadecimal are more useful than decimal because it is relatively easy to convert back and forth between binary and Hex/Octal. 9

Complements 110101 101010 Why we use complement? Complements are used in digital computers for simplifying the subtraction operation and for logical manipulations. Types: There are two types of complements for each base-r system: a) The r s complement and b) The (r-1) s complement. r s complement is known as 10 s complement in base 10 and 2 s complement in base 2. (r-1) s complement is known as 9 s complement in base 10 and 1 s complement in base 2. 10

110101 101010 The r s complement: Complements (Cont.) Given a positive number N in base r with an integer part of n digits, the r s complement of N is defined as The r s complement of N = rn N, if N 0 0, if N = 0 Examples: 10 s complement of 52520 = 10 5-52520 = 47480 10 s complement of 0.3267 = 10 0-0.3267 = 0.6733 10 s complement of 25.639 = 10 2-25.639 = 74.361 2 s complement of (101100) 2 = (2 6 ) 10 -(101100) 2 = (1000000-101100) 2 = 010100 2 s complement of (0.0110) 2 = (2 0 ) 10-0.0110 = 0.1010 11

Complements (Cont.) 110101 101010 Finding r s complement (Simple Method): From the definition and examples, it is clear that- 10 s complement of a decimal number can be formed >> By leaving all lest significant zero's unchanged. >> subtracting the first nonzero least significant digit from 10 >> subtracting other higher significant digits from 9 Example: 10 s complement of 25.639 = 10 2-25.639 = 74.361 10 s complement of 52520 = 105-52520 = 47480 2 s complement can be formed by- >> leaving all least significant zero and the first nonzero digit unchanged. >> then replacing 1 s by 0 s and 0 s by 1 s in all other higher significant digits. Example: 2 s complement of (101100) 2 = (2 6 ) 10 -(101100) 2 = 010100 12

Complements (Cont.) 110101 101010 The (r-1) s complement: Given a positive number N in base r with an integer part of n digits and a fractional part of m digits, the (r-1) s complement of N is defined as- The (r-1) s complement of N = r n -r -m -N Examples: 9 s complement of (52520) 10 =(10 5-10 0-52520)=47479 9 s complement of (0.3267) 10 is (10 0-10 -4-0.3267) = 0.6732 9 s complement of (25.693) 10 is (10 2-10 -3-25.693)= 74.306 1 s complement of (101100) 2 is (2 6-2 0 ) 10 -(101100) 2 = 111111-101100 = 010011 1 s complement of (0.0110) 2 is (1-2 -4 ) 10 -(0.0110) 2 = 0.1001 13

Complements (Cont.) 110101 101010 Finding (r-1) s complement (Simple Method): >> 9 s complement of a decimal number is formed simply by subtracting every digit from 9 >> 1 s complement of a binary number is simpler: the 1 s are changed to 0 s and the 0 s to 1 s. Example: 9 s complement of (25.693) 10 is (10 2-10 -3-25.693)= 74.306 1 s complement of (101100) 2 is (2 6-2 0 ) 10 -(101100) 2 = 010011 Note: It is worth mentioning that the complement of the complement restores the number to it s original value. r s complement of N =r n -N and r s complement of (r n -N) is (r n -(r n -N)) =N and similarly for the 1 s complement. 14

110101 101010 Subtraction with r s Complements Subtraction with Complements The direct method of subtraction taught in elementary schools uses the borrow concept. This seems to be easiest when people perform subtraction with paper and pencil. When subtraction is implemented by means of digital components, this method is found to be less efficient than the method that uses complements and addition as stated below: Subtraction of two positive numbers (M-N), both of base r, may be done as follows- Step-1: Add the minuend M to the r s complement of subtrahend N. Step-2: Inspect the result obtained in step 1 for an end carry: (a) If an end carry occurs, discard it. (b) if an end carry does not occur, take the r s complement of the number obtained in step 1 and place a negative sign in front. 15

Subtraction with Complements (Cont.) 110101 101010 Subtraction with r s Complements (Examples) Using 10 s complement, subtract 72532-3250 Let, M=72532 and N= 3250 M= 72532 10 s complement of N= 96750 End carry 1 69282 Answer: 69282 Subtract (3250-72532) 10 Let, M=3250 and N= 72532 M= 03250 10 s complement of N= 27468 No carry 30718 Answer: - (10 s complement of 30718) = -69282 M=1010100 and N= 1000100. Calculate (M-N)? M=1010100 2 s complement of N = 0111100 End carry 1 0010000 Answer: 10000 M=1000100 and N=1010100, Calculate (M-N) M= 1000100 2 s complement of N= 0101100 No carry 1110000 Answer: -(2 s complement of 1110000) = -10000 16

Subtraction with Complements (Cont.) 110101 101010 Subtraction with r s Complements Proof of the procedure: Addition of M to r s complement of N is given by (M+r n -N) For numbers having an integer part of n digits, r n is equal to a 1 in the (n+1)th position (end carry). Since M and N assumed to be positive, then: (a) (M+r n -N) r n if M N or (b) (M+r n -N) < r n if M<N In case of (a) the answer is positive and equal to (M-N), which is directly obtained by discarding the end carry r n. In case of (b) the answer is negative and equal to (N-M). This case is detected from the absence of an end carry. The answer is obtained by taking a second complement and adding a negative sign: -[r n+ -(M+r n -N)] = -(N-M) 17

Subtraction with Complements (Cont.) 110101 101010 Subtraction with (r-1) s Complements The subtraction of M-N, both positive number in base r, may be calculated in the following manner: Step-1: Add the minuend M to the (r-1) s complement of the subtrahend N. Step-2: Inspect the result obtained in step 1 for an end carry. (a) If an end carry occurs, add 1 to the list significant digit (end-round carry) (b) If an end carry does not occurs, take the (r-1) s complement of the number obtained in step 1 and place a negative sign in front. 18

Subtraction with Complements (Cont.) 110101 101010 Subtraction with (r-1) s Complements (Example) M=72532 and N=3250. Determine M-N and N-M by 9 s complement. Finding (M-N) M= 72532 9 s complement of N = 96749 End round carry 1 69281 + 1 69282 Finding (N-M) N = 03250 9 s complement of M = 27467 No carry 30717 Answer: -(9 s complement of 30717) = - 69282 M=1010100 and N=1000100. Determine (M-N) and (N-M)? Finding (M-N) M=1010100 1 s complement of N= 0111011 End round carry ---1 0001111 1 0010000 Answer: 10000 Finding (N-M) N= 1000100 1 s complement of M= 0101011 No carry 1101111 Answer: -(1 s complement of 1101111) = -10000 19

Comparison between 1 s and 2 s Complement 110101 101010 1 s complement is easier to implement by digital computer than 2 s complement The 1 s complement has the advantage of being easier to implement by digital components since the only thing that must be done is to change 0 s into 1 s and 1 s into 0 s. The implementation of 2 s complement may be obtained in two ways: (i) by adding 1 to the least significant digit of the 1 s complement and (ii) by leaving all leading 0 s in the least significant positions and the first 1 unchanged, and only then changing all 1 s into 0 s and all 0 s into 1 s. Subtraction by 2 s complement requires less arithmetic operation. During subtraction of two numbers by complements, the 2 s complement is advantageous in that only one arithmetic operation is required. The 1 s complement requires two arithmetic additions when an end-around carry occurs. 20

Comparison between 1 s and 2 s Complement (Cont.) 110101 101010 1 s complement has two arithmetic zeros. The 1 s complement has the additional disadvantages of possessing two arithmetic zeros: one with all 0 s and one with all 1 s. To illustrate this fact, consider the subtraction of the two equal binary numbers 1100-1100=0 Using 1 s Complement 1100 +0011 +1111 Complement again to obtain -0000 Using 2 s Complement 1100 +0100 +0000 While the 2 s complement has only one arithmetic zero, the 1 s complement zero can be positive or negative, which may complicate matters. 21

Binary Codes 110101 101010 When numbers, letters or words are represented by a special group of binary symbols/combinations, we say that they are being encoded and the group of symbols is called a code. Some familiar binary codes are- Decimal Codes, Error-detection Codes, The Reflected Code, Alphanumeric Codes etc. Decimal Codes The representation of decimal digits by binary combinations is known as decimal codes. Binary codes from decimal digits require minimum of four bits. Numerous different codes can be obtained by arranging four or more bits in ten distinct possible combinations. Some decimal codes are- BCD Excess-3 84-2-1 2421 5043210 (Biquinary) 22

110101 101010 Decimal Codes (Cont.) Binary-Coded-Decimal (BCD) Code If each digit of a decimal number is represented by its binary equivalent, the result is a code called binary coded decimal (BCD). It is possible to assign weights to the binary bits according to their positions. The weights in the BCD code are 8,4,2,1. Binary Codes (Cont.) Problem: Convert 0110100000111001 (BCD) into its decimal equivalent. Convert 955 (decimal) into BCD code. 23

Binary Codes (Cont.) 110101 101010 Decimal Codes (Cont.) Excess-3 Code This is an unweighted code. Its code assignment is obtained from the corresponding value of BCD after the addition of 3. It has been used in some old computers. Table 2 represents excess-3 code for corresponding decimal digits. 8,4,-2,-1 Code Negative weights can be assigned to decimal digits by 8, 4, -2, -1. In this case the bit combination 0110 is interpreted as the decimal digit 2, as obtained from 24 8x0 + 4x1 + (-2)x1 + (-1)x0 = 2. 2,4,2,1 Code This one is another weighted code corresponding to the decimal digit. In this case the bit combination 1011 is interpreted as the decimal digit 5, as obtained from 2x1 + 4x0 + 2x1 + 1x1 = 5.

110101 101010 Decimal Codes (Cont.) Biquinary Code Binary Codes (Cont.) The weights in the biquinary code are 5, 0, 4, 3, 2, 1, 0. The biquinary code is an example of a seven bit code with error detection properties. Each decimal digit consists of five 0 s and two 1 s placed in the corresponding weighted column. During transmission of signals from one location to another, an error may occur. One or more bits may change value. A circuit in the receiving side can detect the presence of more (or less) than two 1 s and if the received combination of bits does not agree with the allowable combination, an error is detected. Self-complementary Decimal Codes From the five binary codes discussed above, the BCD seems the most natural to use and is indeed the one most commonly encountered. The other four-bit codes listed have one characteristic in common that is not found in BCD. The excess-3, the 2, 4, 2, 1 and the 8, 4, -2, -1 are self-complementary codes, that is, the 9 s complement of the decimal number is easily obtained by changing 1 s to 0 s and 0 s to 1 s. (in a 25

110101 101010 Decimal Codes (Cont.) Binary Codes (Cont.) binary code) and subtraction is calculated by means of 9 s complement. For example, the decimal 395 is represented in the 2, 4, 2, 1 code by 0011 1111 1011. Its 9 s complement 604 is represented by 1100 0000 0100, which is easily obtained from the replacement of 1 s by 0 s and 0 s by 1 s. This property is useful when arithmetic operations are internally done with decimal numbers 26

Binary Codes (Cont.) 110101 101010 Error-detection Codes An error detection codes can be used to detect errors during transmission. A parity bit is an extra bit included with a message to make the total number of 1 s either odd or even. For a message of four bits parity (P) is chosen so that the sum of all 1 s is odd (in all five bits) or the sum of all 1 s is even. In the receiving end, all the incoming bits (in this case five) are applied to a parity-check network for checking. An error is detected if the check parity does not correspond to the adopted one. The parity method detects the presence of one, three or any odd combination of errors. An even combination of errors is undetectable. 27

110101 101010 Error-detection Codes Binary Codes (Cont.) Message 0111 28 Add parity bit TX 01110 01100 Bit error in the channel Rcv Check Parity Message error if parity even

110101 101010 The Reflected Code/Grey Code The Reflected code, also called Gray code is unweighted and is not an arithmetic code; that is, there are no specific weights assigned to the bit positions. It is a binary numeral system where two successive values differ in only one bit (binary digit). For instance, in going from decimal 3 to decimal 4, the Gray code changes from 0010 to 0110, while the binary code Binary Codes (Cont.) changes from 0011 to 0100, a change of three bits. The only bit change is in the third bit from the right in the Gray code; the others remain the same. 29

110101 101010 Alphanumeric Codes Binary Codes (Cont.) In order to communicate, we need not only numbers, but also letters and other symbols. In the strictest sense, alphanumeric codes are codes that represent numbers and alphabetic characters (letters). Most such codes, however, also represent other characters such as symbols and various instructions necessary for conveying information. The ASCII is the most common alphanumeric code. ASCII Code ASCII is the abbreviation for American Standard Code for Information Interchange. Pronounced "askee," ASCII is a universally accepted alphanumeric code used in most computers and other electronic equipment. Most computer keyboards are standardized with the ASCII. When we enter a letter, a number, or control command, the corresponding ASCII code goes into the computer. 30

Binary Codes (Cont.) 110101 101010 ASCII Code (Cont.) ASCII has 128 characters and symbols represented by a 7-bit binary code. Actually, ASCII can be considered an 8-bit code with the MSB always 0. This 8-bit code is 00 through 7F in hexadecimal. The first thirty-two ASCII characters are non-graphic commands that are never printed or displayed and are used only for control purposes. Examples of the control characters are ""null," "line feed," "start of text," and "escape." The other characters are graphic symbols that can be printed or displayed and include the letters of the alphabet (lowercase and uppercase), the ten decimal digits, punctuation signs and other commonly used symbols. Extended ASCII characters : In addition to the 128 standard ASCII characters, there are an additional 128 characters that were adopted by IBM for use in their PCs (personal computers). Because of the popularity of the PC, these particular extended ASCII characters are also used in applications other than PCs and have become essentially an unofficial standard. The extended ASCII 31 characters are represented by an 8-bit code series from hexadecimal 80 to hexadecimal FF.

110101 101010 ASCII Code (Cont.) Binary Codes (Cont.) 32

110101 101010 ASCII Code (Cont.) Binary Codes (Cont.) 33