Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
479 views
47 pages
R P Jain Chapter 2
kjlkjlj
Uploaded by
golumjet
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save R p Jain chapter 2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
479 views
47 pages
R P Jain Chapter 2
kjlkjlj
Uploaded by
golumjet
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save R p Jain chapter 2 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 47
Search
Fullscreen
CHAPTER 2 NUMBER SYSTEMS AND CODES 2.1 INTRODUCTION We all are familiar with the number system in which an ordered set of ten symbols—0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, known as digits—are used to specify any number. This number system is popularly known as the decimal number system. The radix or base of this number system is 10 (number of distinct digits). Any number is a collection of these digits. For example, 1982.365 signifies a number with an integer part equal to 1982 and a fractional part equal to 0,365, separated from the integer part with a radix point (,) also known as decimal point, There are some other systems also, used to represent numbers. Some of the other commonly used number systems are: binary, octal and hexadecimal number systems. These number systems are widely used in digital systems like microprocessors, logic circuits, computers, etc. and therefore, the knowledge of these number systems is very essential for understanding, analysing and designing digital systems. As discussed in Chapter 1, computers and other digital circuits use binary signals but are required to handle data which may be numeric, alphabets or special characters. Therefore, the information available in any other form is required to be converted into suitable binary form before it can be processed by digital circuits. This means that the information available in the form of numerals, alphabets and special characters or in any combination of these must be converted into binary format, To achieve this, a process of coding is employed whereby each numeral, alphabet or special character is coded in a unique combination of Os and 1s, using a coding scheme, known as a code. The process of coding is known as encoding. There can be a variety of coding schemes (codes) to serve different purposes, such as arithmetic operations, data entry, error detection and correction, etc. In digital systems, a large number of codes are in use. Selection of a particular code depends on its suitability for the purpose. In one digital system, different codes may be used for different operations and it may be necessary to convert data from one code to another code. For this, purpose, code converter circuits are required which will be discussed later. 2.2. NUMBER SYSTEMS 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 which in general has two parts—integer and fractional, set apart by a radix point (.), that isNumber Systems and Codes 29 dn dn2...dh...h do d_5...d-m (v)p = Geetetecetienh dy des deans ndin en Integer portion Redix Fractional portion point where = anumber b= radix or base of the number system number of digits in integer portion m= number of digits in fractional portion d, , = most significant digit (msd) d.,, = least significant digit (1sd) and 0<(dord,)
(1011 2 scomplement of subtrahend +2 1oo1o t Discard final carry The answer is 0.0 1 0 equivalent to (+2),42 Modern Digital Electronics Gi) 5 0101 — Minuend <1 SS>> 1001 Yscomplement of subsrahend -2 1110 The final carry = 0. Therefore, the answer is negative and is in 2’s complement form. 2°s complement of 1110 = 0010 Therefore, the answer is (-2),,. 2.6.2 Addition/Subtraction in 2’s Complement Representation The addition/subtraction of signed binary numbers can most conveniently be performed using 2’s complement representation of both the operands. This is the method most commonly used when these operations are performed using digital circuits and microprocessors. Example 2.19 Perform the following operations using 2’s complement method: (i) 48-23 (ii) 23-48 (iii) 48-23) (iv) -48 = 23 Use 8-bit representation of numbers. Solution (i) 2’s complement representation of +48 ~ 00110000 2's complement representation of -23 = 11101001 48 + (-23) 48 oo1rlo000 => +a) => wiiioiool +25 100011001 +25 tT Discard Carry ii) 2's complement representation of +23 =00010111 2's complement representation of - 48 = 11010000 23-48 =23 + (48) 2B 00 => +a) => wo 25 11100111 & > ~25 48 00110000 => +0 S> wooo +71 01000111 => +71 iii) 48 —(-23) = 48 +23Number Systems and Codes 43 (iv) 4823 = 48) + (23) 48 11010000 = +63) > H1iioio0ot -71 1 10111001 c—=> -71 t Camry be ignored From the above example, we observe the following: (a) If the two operands are of the opposite sign, the result is to be obtained by the rule of subtraction using 2’s complement (Sec. 2.6.1) (b) Ifthe two operands are of the same sign, the sign bit of the result (MSB) is to be compared with the sign bit of the operands. In case the sign bits are same, the result is correct and is in 2’s complement form. If the sign bits are not same there is a problem of overflow, i.e. the result can not be accommodated using eight bits and the result is to be interpreted suitably. The result in this case will consist of nine bits, i.c. carry and eight bits, and the carry bit will give the sign of the number. 2.7, OCTAL NUMBER SYSTEM The number system with base (or radix) eight is known as the octal number system. In this system, eight symbols, 0, 1, 2,3, 4, 5, 6, and 7 are used to represent numbers. Similar to decimal and binary number systems, it is also a positional system and has, in general, two parts; integer and fractional, set apart by a radix (octal) point (.). Any number can be expressed in the form of Eq. (2.1) with = 8 and 0 <(d, or d,) <7.The weights assigned to the various positions are given in Table 2.1. For example, (6327.4051), is an octal number. 2.7.1 Octal-to-Decimal Conversion Any octal number can be converted into its equivalent decimal number using the weights assigned to each octal digit position as given in Table 2.1 Example 2.20 Convert (6327.4051), into its equivalent decimal mumber. Solution Using the weights given in Table 2.1, we obtain (63274051), = 6 * 8° +3 x 842% 847x844 x 8 HOX82HS XB + 1x84 5, 512 * 4096 072+ 192 +16 + 7+ S404 3287.5100098),, Thus, (6327.4051), = (3287.5100098),,Modern Digital Electronics 2.7.2. Decimal-to-Octal Conversion The conversion from decimal to octal (base-10 to base-8) is similar to the conversion procedure for base-10 to base-2 conversion, The only difference is that number 8 is used in place of 2 for division in the case of integers and for multiplication in the case of fractional numbers. Example 2.21 (a) Convert (247),,, into octal (b) Convert (0.6875),, into octal (©) Convert (3287.5100098), , into octal Solution (@) Quotient Remainder sae 30 7 3 _ eo) 3 6 ; a 3 3 0 3 8 1 36 7 Thus, (247),, = (367), (b) 0.6875 0.5000 x8 x8 5.5000 4.0000 4 4 5 4 Thus, (0.6875),, = (0.54), (©) Integer part: Quotient Remainder 3287/8 410 7 ae! 2 an 3 6's 0 5 Thus, (3287),, = (6327), Fractional part: 5100098 0.0800784 0.6406272 0.1250176 4.080784 1250176 1,0001408 4 L 4 L 4 5 1 Thus (0.5100098),, = (0.4051), Therefore, (3287.5100098), , = (6327.4051),Number Systems and Codes 45 From the above examples we observe that the conversion for fractional numbers may not be exact. In general, an approximate equivalent can be determined by terminating the process of multiplication by eight at the desired point. 2.7.3. Octal-to-Binary Conversion Octal numbers can be converted into equivalent binary numbers by replacing each octal digit by its 3-bit equivalent binary, Table 2.6 gives octal numbers and their binary equivalents for decimal numbers 0 to 15 Table 2.6 Binary and Decimal Equivalents of Octal Numbers Octal Decimal Binary 0 0 000 1 1 001 2 2 010 3 3 oul 4 4 100 5 5 101 6 6 110 7 7 1 10 8 001000 ul 9 o01001 12 10 001010 13 "1 oo1011 14 12 001100 1s 13 oo1101 16 14 oo1110 7 Is ool Example 2.22 Convert (736), into an equivalent binary number. Solution From Table 2.6, we observe the binary equivalents of 7, 3 and 6 as 111, 011, and 110, respectively, Therefore, (736), = (111 011 110),. 2.7.4 Binary-to-Octal Conversion Binary numbers can be converted into equivalent octal numbers by making groups of three bits starting from LSB and moving towards MSB for integer part of the number and then replacing each group of three bits46 Modern Digital Electronics by its octal representation. For fractional part, the groupings of three bits are made starting from the binary point Example 2.23 Convert (1001110), to its octal equivalent. Solution (1001110), = (001 001 110), (116), = (116), Example 2.24 Convert (0.10100110), to its equivalent octal number. Solution (0.10100110), = (0.101 001 100), (0.514), =(0.514), Example 2.25 Convert the following binary numbers to octal numbers (a) 11001110001.000101111001 (b) 1011011110.11001010011 (©) 111110001.10011001101 Solution (a) 011 001 110 001.000 101 111 001 = (3161.0571), (6) 001 011 011 110.110 610 100 110 = (1336.6246), (c) 111 110 001.100 110 011 010 = (761.4632), From the above examples we observe that in forming the 3-bit groupi the first (most significant digit) group in the integer part and the fractional part. 0's may be required to complete ignificant digit) group in the (lea: 2.7.5 Octal Arithmetic Octal arithmetic rules are similar to the decimal or binary arithmetic. Normally, we are not interested in performing octal arithmetic operations using octal representation of numbers. This number system is normallyNumber Systems and Codes __47 used to enter long strings of binary data into a digital system like a microcomputer. This makes the task of entering binary data in a microcomputer easier. Arithmetic operations can be performed by converting the octal numbers to binary numbers and then using the rules of binary arithmetic. Example 2.26 Add (23), and (67),- Solution 23= 010011 ()67= 01 (112),= 1001 010 Example 2.27 Subtract (a) (37), from (53), (b) (75), from (26), Solution Using 8-bit representation, (a) (53), 00101011 = (37), = (11100001 Two's complement of (37), (14), = 100001100 Discard carry —? (b) (26). =5)5 =@); 11011001 Two's complement of result 00010110 (4) 11000011 Two's complement of (75), ‘Two's complement of 11011001 = 00 100 111 = (47), Multiplication and division can also be performed using the binary representation of octal numbers and then making use of multiplication and division rules of binary numbers. 2.7.6 Applications of Octal Number System In digital systems, binary numbers are required to be entered and certain results or status signals are required to be displayed. It is highly inconvenient to handle long strings of binary numbers. It may cause errors also. Therefore, octal numbers are used for entering the binary data and displaying certain informations. Therefore, the knowledge of octal number system is very important for the efficient use of microprocessors and other digital circuits. For example, the binary number 011111110 can easily be remembered as 376 and can be48 Modern Digital Electronics entered as 376 using keys. Since digital circuits can process only zeros and ones, the octal numbers have to be converted into binary form using special circuits known as octal-to-binary converters before being processed by the digital circuits, 2.8 HEXADECIMAL NUMBER SYSTEM Hexadecimal number system is very popular in computer uses. The base for hexadecimal number system is 16 which requires 16 distinet symbols to represent the numbers. These are numerals 0 through 9 and alphabets A through F. Since numeric digits and alphabets both are used to represent the digits in the hexadecimal number system, therefore, this is an alphanumeric number system. Table 2.7 gives hexadecimal numbers with their binary equivalents for decimal numbers 0 through 15. From the table, it is observed that there are 16 combinations of 4-bit binary numbers and sets of 4-bit binary numbers can be entered in the computer in the form of hexadecimal (hex.) digits. These numbers are required to be converted into binary representation, using hexadecimal-to-binary converter circuits before these can be processed by the digital circuits. Table 2.7 Binary and Decimal Equivalents of Hexadecimal Numbers Hexadecimal Decimal Binary 0 0 0000 1 1 0001 2 2 0010 3 3 ool 4 4 0100 5 5 o1oL 6 6 ono 7 7 oul 8 8 1000 9 9 1001 4 rt) 1010 B WW loll c 12 1100 D 13 101 E 14 1110 E 15 uu 2.8.1 Hexadecimal-to-Decimal Conversion Using Eq. (2.1), hexadecimal numbers can be converted to their equivalent decimal numbers.Number Systems and Codes ‘The fractional part may not be an exact equivalent and therefore, may give a small error. 2.8.2 Decimal-to-Hexadecimal Conversion For conversion from decimal to hexadecimal, the procedure used in binary as well as octal systems is applicable, using 16 as the dividing (for integer part) and multiplying (for fractional part) factor. Copyrighted materialModern Digital Electronics 2.8.3 Hexadecimal-to-Binary Conversion Hexadecimal numbers can be converted into equivalent binary numbers by replacing each hex digit by its equivalent 4-bit binary number. 2.8.4 Binary-to-Hexadecimal Conversion Binary numbers can be converted into the equivalent hexadecimal numbers by making groups of four bits starting from LSB and moving towards MSB for integer part and then replacing each group of four bits by its hexadecimal representation. Copyrighted materialNumber S) stems and Codes For the fractional part, the above procedure is repeated starting from the bit next to the binary point and moving towards the right. Example 2.31 Convert the following binary numbers to their equivalent hex numbers. (a) 1010010101111 (b) 0,00011110101101 Solution (a) (1010011010111), = 0010 1001 1010, 1111 y 8 4 F (LOLO0L1O101111);. = (294F)« (b) (0.00011110101101), = 90,0001, 1110 1011 0100 SOOO LO YT EF BY -(0.00011110101101), = (0.1EB4),, Example 2.32 Convert the binary numbers of Example 2.25 to hexadecimal numbers. Solution (a) 110 0111 0001.0001 0111 1001 = (671.179), (b) 10 1101 110.1100 1010 011 = (2DB.C46),, () 11111 001.1001 1001 101 = (17 1.994),, From the above examples, we observe that in forming the 4-bit groupings 0’s may be required to complete the first (most significant digit) group in the integer part and the last (least significant digit) group in the fractional part, 2.8.5 Conversion from Hex-to-Octal and Vice-Versa Hexadecimal numbers can be converted to equivalent octal numbers and octal numbers can be converted to equivalent hex numbers by converting the hex/octal number to equivalent binary and then to octal/hex, respectively,52 Modern Digital Electronics Example 2.33 Convert the following hex numbers to octal numbers (a) AT2E (b) 0.BF8S Solution (a) (A72E),, = (1010 0111 0010 1110), = 001 010 O11 100 101 110 = (123456), (0) (0.BF85),, =(0.1011 1111 1000 0101), = 0.101 111 111 000 010 100 = (0.577024), Example 2.34 Convert (247.36), to equivalent hex number. Solution (247.36), = (010 100 111.011 110), =(0 1010 O11 + O111 1000), =(AT.18)\6 2.8.6 Hexadecimal Arithmetic The rules for arithmetic operations with hexadecimal numbers are similar to the rules for decimal, octal, and binary systems. The information can be handled only in binary form in a digital circuit and it is easier to enter the information using hexadecimal number system. Since arithmetic operations are performed by the digital circuits on binary numbers, therefore hexadecimal numbers are to be first converted into binary numbers. Arithmetic operations will become clear from the following examples, Example 2.35 Add (7F),, and (BA),, Solution 7F= oul (4) BA= _10111010 (139),,= 100111001Number Systems and Codes Example 2.36 Subtract (a) (5C),, from (3F),, (©) (74), from (C0), Solution @ 3F oor SC= _(+)10100100 Two's complement of (5C),, -1D 11100011 Two's complement of result Two's complement of 11100011 =0001 1101 =(ID),, () co 11000000 =7A = (+) 10000110 Two's complement of (74). 46= 101000110 Discard cary Multiplication and division can also be performed using the binary representation of hexadecimal numbers and then making use of multiplication and division rules of binary numbers. 2.9 CODES Computers and other digital circuits process data in the binary format, Various binary codes are used to represent data which may be numeric, alphabets or special characters. Although, in every code used the information is represented in binary form, the interpretation of this binary information is possible only if the code in which this information is available is known. For example, the binary number 1000001 represents 65 (decimal) in straight binary, 41 (decimal) in BCD and alphabet A in ASCII code. A user must be very careful about the code being used while interpreting information available in the binary format. Codes are also used for error detection and error correction in digital systems. Some of the commonly used codes are given below. 2.9.1 Straight Binary Code This is used to represent numbers using natural (or straight) binary form as discussed in Section 2.3. Various arithmetic operations can be performed in this form. Binary codes for decimal numbers 0) to 15 are given in Table 2.8. It is a weighted code since a weight is assigned to every position 2.9.2 Natural BCD Code In this code, decimal digits 0 through 9 are represented (coded) by their natural binary equivalents using four bits and each decimal digit of a decimal number is represented by this four bit code individually. For example, (23),. is represented by 0010 0011 using BCD code, rather than (10111),. From this it is observed that it requires more number of bits to code a decimal number using BCD code than using the straight binary code. However, inspite of this disadvantage it is very convenient and usefull code for input and output operations in digital systems. This code is also known as 8-4-2-1 code or simply BCD code, 8, 4, 2, and 1 are the weights of the four bits of the binary code of each decimal digit similar to straight binary number system. Therefore, this isModern Digital Electronics a weighted code and arithmetic operations can be performed using this code, which will be discussed in Chapter 6. BCD codes for decimal digits 0 through 9 are given in Table 2.8. Various Binary Codes Decimal Binary BCD Excess-3 Gray Number BB, BB D C B A &£E, ER G, G, G, G, 0 0 0 0 0 0 0 0 0 0 O 1 1 o 0 0 0 1 oo 01 0 0 oO 1 o 10 0 oo oO 1 2 oo 1 0 o 0 10 0 1 0 1 oo 1 1 3 oo 1 t oo 11 o 110 oo 10 4 o 10 0 o 1 0 0 0 1 41 1 o 1 1 0 o 101 o 1 01 10 0 0 o 11 6 o 110 1 10 1001 o 1 0 1 7 ordi oo rit 10 1 0 o 1 0 0 8 10 0 0 1 0 0 0 too. 1 1 0 0 9 1001 10 0 1 1 10 0 1101 10 10 1 0 tao. 1 to.) 11 1 0 2 110 0 10 1 0 13 11041 1ou.t 14 111 0 100 1 15 Prid 10 0 0 2.9.3 Excess-3 Code This is another form of BCD code, in which each decimal digit is coded into a 4-bit binary code. The code for each decimal digit is obtained by adding decimal 3 to the natural BCD code of the digit. For example, decimal 2 is coded as 0010 + 0011 = 0101 in Excess-3 code. It is not a weighted code. This code is a self-complementing code, which means 1’s complement of the coded number yields 9’s complement of the number itself. For example, Excess-3 code of decimal 2 is 0101, its 1’s complement is 1010 which is Excess-3 code for decimal 7, which is 9’s complement of 2. The self complementing property of this code helps considerably in performing subtraction operation in digital systems. Excess-3 codes for decimal digits 0 through 9 are given in Table 2.8. 2.9.4 Gray code It isa very useful code in which a decimal number is represented in binary form in such a way so that each Gray-code number differs from the preceding and the succeeding number by a single bit. For example, the Gray code for decimal number 5 is 0111 and for 6 is 0101. These two codes differ by only one bit position (third from the left). This code is used extensively for shaft encoders because of this property. It is not a weighted code. The Gray code is a reflected code and can be constructed using this property as given below.lumber Systems and Codes 55 (i) A 1-bit Gray code has two code words 0 and | representing decimal numbers 0 and 1 respectively (ii) An n-bit (7 = 2) Gray code will have first 2" ' Gray codes of (n ~ 1)-bits written in order with a leading 0 appended. (iii) The last 2"' Gray codes will be equal to the Gray code words of an (n ~ 1)- bit Gray code, written in reverse order (assuming a mirror placed between first 2”! and last 2""' Gray codes) with a leading 1 appended, Example 2.37 Determine (a) 1-bit (b) 2-bit (c) 3-bit Gray codes and tabulate along with their equivalent decimal numbers. Solution (a) L-bit Gray code is constructed using (i) above. Decimal number Gray code 0 0 1 1 (b) 2-bit Gray code is constructed using (ii) and (iii) above and Gray code of I-bit Decimal number Gray code 0 00 1 o1 2 IL 3 10 (©) 3-bit Gray code is constructed using 2-bit Gray code. Decimal number Gray code 000 001 Olt 010 110 Tit TOL 100 4-bit Gray code is given in Table 2.8. 2.9.5 Octal Code It is a 3-bit binary code, in which each of the octal digits 0 through 7 is coded into 3-bit straight binary number, For example, code for octal digit 4 is 100. Using this code, octal numbers can be coded into straight binary form or the binary numbers can be represented by octal numbers as discussed in Section 2.7. This code is used for binary inputs in digital computers, microprocessors, etc.Modern Digital Electron 2.9.6 Hexadecimal Code It is a 4-bit binary code (Section 2.8) used for input/output in digital computers, microprocessors, ete. Example 2.38 Represent the decimal number 27 in binary form using (i) Binary Code (iv) Gray code (ii) BCD code (v) Octal code (iii) Excess-3 code (vi) Hexadecimal code Solution (i) The decimal number is converted into straight binary form. Its value is 11011 (ii) Bach digit of the decimal number is coded using 4-bit BCD code as given below 0010 0111 (iii) Each digit of the decimal number is coded using 4-bit Excess-3 code as given below 0101 1010 (iv) 5 bits are required to represent 27, therefore, 5-bit Gray code is constructed and 27 is represented as 10110. () 2) ono i) 27), 0001 1011 1B), Example 2.39 Represent the decimal numbers (a) 396 and () 4096 in binary form in () Binary code (straight binary) (iv) Octal code (ii) BCD code (v) Hex code (iii) Excess-3 code Solution (a) (i) 396= 110001100 Gi) 396 = 001110010110 (ii) 396 = 011011001001 (iv) 396 = (614), = 110001100 (v) 396 =(18C),, = 000110001100 (b) (i) 4096 = 1000000000000 Gi) 4096 = 0100000010010110 (iii) 4096 = 01110011 11001001 (iv) 4096 = (10000), = 001 000 000 000 000 (v) 4096 = (1000),, = 0001 0000 0000 0000Number Systems and Codes __57 2.9.7 Alphanumeric Codes In many situations, digital systems are required to handle data that may consist of numerals, letters, and special symbols. For example, an university with thousands of students may use a digital computer to process the examination results. In this the names of the students, subjects, etc. are to be represented in the binary form, Therefore, it is necessary to have a binary code for alphabets also. If we use an n-bit binary code, we can represent 2" elements using this code. Therefore, to represent 10 digits 0 through 9 and 26 alphabets 4 through Z, we need a minimum of 6 bits (2°= 64, but 2°= 32 is not sufficient). One possible 6-bit alphanumeric code is given in Table 2.9. It is used in many computers to represent alphanumeric characters and symbols internally and therefore can be called internal code. Frequently, there is a need to represent more than 64 characters including the lower case letters and special control characters for the transmission of digital information, For this reason the following two codes are normally used: 1, Extended BCD Interchange Code (EBCDIC) 2. American Standard Code for Information Interchange (ASCII) These are given in Tables 2.9 and 2.10 respectively. Table 2.9 Some Alphanumeric Codes 6-bit 8-bit Character Internal code EBCDIC code 4 010001 11000001 B 010010 11000010 c 10011 11000011 D 010100 11000100 E 010101 11000101 F 10110 11000110 G lol 1000111 H 011000 11001000 1 o11001 11001001 J 100001 11010001 K 100010 11010010 L 100011 1010011 M 100100 11010100 N 100101 11010101 o 100110 11010110 P 100111 1010111 Q 101000 11011000 R 101001 1011001 (Continued)Modern Digital Electronics Table 2.9 (Continued) 6-bit &bit Character Internal code EBCDIC code Ss 110010 11100010 T 110011 11100011 u 110100 11100100 v 110101 11100101 w 110110 11100110 x M0111 1100111 y 111000 11101000 Zz 111001 11101001 0 000000 11110000 1 000001 11110001 2 000010 11110010 3 000011 11110011 4 000100 11110100 3 000101 11110101 6 000110 11110110 7 ooo11t MOLL 8 001000 11111000 9 001001 11111001 blank 110000 01000000 o11011 01001011 ( 111100 01001101 + 010000 1001110 s 101011 1011011 * 101100 01011100 ) 011100 1011101 100000 01100000 ! 110001 01100001 : 11011 o1o1011 = 001011 oun10Number Systems and Codes 59 Table 2.10 The ASCII Code b, o o 0 0 1 1 1 1 Is 0 0 1 1 0 0 1 1 b o 1 0 1 0 1 0 1 b BO, b, 0 1 2 3 4 5 6 7 0 0 0 0 0 NUL DLE SP 0 @ P 0 P 0 oO 1 I SOH bel 1 1 A Q a q 0 oO 1 0 2 STX be2 " 2 B R b r 0 0 1 1 ETX DC3 # 3 Cc s © s 0 1 0 0 EOT DCc4 $ 4 D T d t 0 1 0 1 ENQ NAK % 5 E U e u 0 1 1 0 6 ACK SYN & 6 F v f v 0 1 1 1 7 BEL ETB . 7 G w g w 1 0 0 0 8 BS CAN ( 8 H x h x 1 oO 0 1 9 HT EM ) 9 T Y i y 1 oO 1 0 A LF SUB * J Z j z 1 oO 1 1 B VT ESC + : K [ k t 1 1 0 0 Cc FF FS . < L \ 1 | 1 1 0 1 D CR_ GS = = M ] m } 1 1 1 0 EB so RS. > N “ n ~ 1 1 1 1 F SL Us i T oO - ° DEL. ‘The code is read from this table as: b, by b, b, b, by H=1 0 0 1 0 0 0=(48),, n=l 0 1 1 1 0 = (68), Example 2.40 Encode the following in ASCII Code: (a) My dear Rajendra, (b) Lam 20 years old. Solution Each of the alphabet, numeral, and the special character is represented by 7-bit ASCII code given in Table 2.10.Modern Digital Electronics (a) 1001101 1111001 [} 1100100 1100101 1100001, 1110010 Ziel ees nein ane ane a 2 1010010 1100001 1101010 1100101 1101110 1100100 a a ne i 1110010 1100001 0101100 eS eS ee r a 5 (b) 1001001 1100001, 1101101 0110010, 0110000, 7 a m z 0 1111001 1100101, 1100001, 1110010 1110011 >} ea y € a r 5 1101111 1101100, 1100100, 0101110 Ree OOO REO OOO LONION ° i The code for SPACE has not been added above, which is 0100000 2.10 ERROR DETECTING AND CORRECTING CODES Digital signals are processed for performing various operations and are transmitted from one circuit or system to another circuit or system. When these binary signals are transmitted from one location (transmitter) to another location (receiver), transmission errors may occur because of electrical noise in the transmission channel, Due to transmission error a signal transmitted as @ 0 may be received as a 1 or vice-versa, In complex digital systems, millions of bits per second are manipulated and it is desired to have high data integrity, or at least a violation of data integrity must be detectable. A digital data in the form of a code word such as BCD, ASCII ete. is transmitted and there is always a finite probability of occurrence of an error in a single bit position. The probability of occurrence of error in two or more bit positions simultaneously is substantially smaller. It is desired to detect the error in the received data word, locate its bit position and correct it, Various codes are used for the detection and correction of error. Since the probability of simultaneous occurrence of error in two or more bit positions is negligibly small, therefore, we restrict our discussion to the detection and correction of single error, i.e. error in one bit position. 2.10.1 Error-detecting Codes When a digital information is transmitted, it may not be received correctly by the receiver. At the receiving end it may or may not be possible to detect whether the information has been received correctly or not. Let us consider BCD code given in Table 2.8 is transmitted and the code corresponding to decimal 9, i.e. 1001 is transmitted and is received as 1011. Since 1011 is an invalid BCD code, therefore, it may be detected by the receiver. On the other hand if it is received as 0001 which is a valid BCD code for decimal 1, the receiver will intrepret it as decimal 1 and the error is not detected. In general, the erroneous word received may or may not be a valid code, To ensure that the occurrence of a single error always results in an invalid code, so as to avoid its incorrect interpretation by the receiver, the code must possess the property that the occurrence of any singleNumber Systems and Codes __ 61 error transforms a valid code word into an invalid code word. Since for an n-bit code there are 2* possible combinations, therefore, if it is desired to make this code an error-detecting code, only half of the possible 2" combinations should be included to form the code. This means, if an extra bit is attached to the r-bit code word to make the number of bits + 1 in such a way so as to make the number of ones in the resulting (n+ 1}-bit code even or odd, it will certainly be an error-detecting code. The criterion of minimum distance of a code can also be used as a usefull property of an error-detecting code. The minimum distance of a code is the smallest number of bits in which any two code words differ. A code is an error-detecting code if and only if its minimum distance is two or more. For detection of error an extra bit known as parity bit is attached to each code word to make the number of ones in the code even (even parity) or odd (odd parity), Table 2.11 shows BCD code with parity bit attached making it even parity code or odd parity code. Table 2.11 BCD Code with Parity Bit BCD code BCD code with even parity BCD code with odd parity DC BA POD C BA PD C BA 0 0 0 0 o 0 0 0 0 1 0 0 0 0 o 0 1 1 0 0 0 1 0 0 0 0 1 o 1 0 1 0 0 1 0 o oOo 1 06 oo 1 1 o 0 oOo 1 1 1 0 0 1 4 o 10 0 1 0 1 0 0 0 0 1 0 0 Oo 1 0 1 o Oo 1 0 1 1 0 1 0 1 o 1 1 0 o o 1 1 0 1 0 1 1 0 ee 1 0 1 1 1 oo 1 1 1 0 0 1 1 0 0 0 o 1 0 0 0 10 I o 1 0 o 1 11 oo oOo From Table 2.11 we observe that a parity bit (P) 0 or 1 is attached to every code word so as to make the number of ones even or odd for even and odd parity respectively. It can be easily verified that the minimum distance between any two code words with parity bit attached is two. The parity bit 1 or 0 is attached to the code to be transmitted at the transmitter end and the parity of the received (n + 1)- bit word is checked at the receiving end. If there is only one error, the erroneous code is detected at the receiving end by parity check. If odd number of bits are transmitted erroneously, then also the parity check will detect the incorrect code but if there are even number of bits received incorrectly, this method will not detect error. The parity check method can only detect error in the transmitted word at the receiving end. It can not locate the bit which has changed and, therefore, the question of correction does not arise. The parity generator and parity checker circuits have been discus ed in Chapter 6. Example 2.41 Formulate 8-bit ASCII code for Example 2.40 and represent it in hexadecimal code with (i) even parity (ii) odd parityModern Digital Electronics Solution (i) For Example 2.40(a): The 7-bit ASCII code for M is 1001101, It contains four ones, To make an 8-bit even parity code corresponding to this, one 0 is attached to it as the most-significant bit. Therefore, the 8-bit code will be 01001101. Its hexadecimal representation is 4D. Similarly ASCII code for y is 1111001, which contains five 1s and therefore, a1 as MSB is attached to it for obtaining its 8-bit even parity code, i.e. 11111001. Its hex representation is 9. In the same way each character is formulated. The complete sentence (including the spaces) in hexadecimal code is 4DF9AQE465E17240D2E16A6SEEES72E1AC For Example 2.40 (b): Using the above procedure, we get, C9A0E1EDAQB230A0F96SE172F3A06FOCES2E (ii) For Example 2.40(a): The 7-bit ASCII code for Mis 1001101, when a 1 is attached to this as MSB, it becomes the 8-bit code for M. In hexadecimal code it is CD. Similarly, a 0 is attached as MSB to the 7-bit ASCII code of y to make it 8-bit with odd parity. In the same way each character is formulated. The complete sentence (including the spaces) in hexadecimal code is (CD7920648561F2205261EABS6E64F2612C For Example 2.40 (b): Using the above procedure, we get, 49206 161D2032202079561F27320EFEC64AE Example 2.42 Find out the minimum distance of (a) ASCII code. (b) 8-bit ASCII code with even parity. (c) 8-bit ASCII code with odd parity. Solution From the Table 2.10, examine the ASCII codes of various alphabets, numerals, special characters, etc. and find out the distance between any two code words. For example, ASCII code for alphabet a is 1100001 and for alphabet ¢ is 1100011. These two code words differ in only one bit position (6,), which shows that the minimum distance of ASCII code is 1 (b) ASCII code with even parity for ais 11100001 and for cis OL00011 These two code words differ in two bit positions (6, and b,). Similarly, it ean be verified for any two code words that the distance is 2 or more. Therefore, the minimum distance of ASCII code with even parity is two. (c) Similar to part—(b) it can be verified that the minimum distance of 8-bit ASCII code with odd parity is two.Number Systems and Codes 63 2.10.2 Error-correcting Codes As discussed above, by adding a single parity bit alongwith the information, or message being transmitted, an error in single bit position can be detected. The parity check gives only information that the received message is incorrect. It can not locate the bit position in which error has occurred and, therefore, can not correct the error. Let us consider a 4-bit binary word 0101 is transmitted alongwith an even parity bit. Due to transmission error in one bit position, the erroneous word received may be 00100, 00111, 00001, or 01101 depending on the error in bit position b,, ,, b,, and b, respectively. Let us examine whether these erroneous words are possible with any other message being transmitted. If the word 01100 is transmitted, it results in 00100 at the receiving end due to an error in bit position b,. Similarly, the other erroneous words are received due to the transmission error in some other words being transmitted. This indicates that a minimum distance of two can not locate the bit position in the incorrectly received word. Therefore, for a code to be error correcting, its minimum distance must be more than two. If the minimum distance is three, every error in single bit results in an invalid code word which is at a distance of one from the original code word and at a distance of two from any other valid code word. Therefore, a single bit error can be detected and located using this code, Once the error bit is located it can be inverted to correct the erroneously received message. In general, a code is said to be error-correcting code if the correct code word can be deduced from the erroneous word. The capability of a code to be error detecting and/or error-correcting can be determined from its minimum distance. Ifa code’s minimum distance is 2+ d+ 1, itean correct errors in upto c bits and detect errors in upto d additional bits, Table 2.12 gives possible values of ¢ and d for various values of minimum distance of a code. Table 2.12 Minimum distance of a code e d I 0 0 0 1 3 0 2 1 0 4 0 3 1 I From Table 2.12, we observe that if the minimum distance of a code is 4, it can correct upto one bit (c= 1) and detect errors in upto two (c + d= 1 +1) bits. The same code can also be used for detecting errors in upto 3 bits but correct no errors (c = 0). Example 2.43 Four messages are encoded in the following code words: Message Code M, ou M, 10011 M, 00110 M, 11000 Determine the minimum distance of this code.Modern Digital Electron Solution ‘To determine the minimum distance, we find out the number of locations in which any code word differs from any other code word. These are given below: Distance between the codes M, and M, 4 M, and M, 3 M, and M, 3 M, and M, 3 M, and M, 3 M, and M, 4 ‘Therefore, the minimum distance of this code is three. Example 2.44 Consider the following four codes: Code A Code B Code C Code D 0001 000 o1011 000000 0010 oor 01100 oon 0100 oul 10010 10011 1000 010 10101 10 Ml 101 100 Which of the following properties is satisfied by each of the above codes? (a) Detects single error (b) Detects double errors (c) Detects triple errors (A) Corrects single error (©) Corrects double errors (f) Corrects single error and detects double errors Solution (a) Code 4 has a minimum distance of 2 (b) The minimum distance of code C is 3, therefore, it can detect double errors. (©) Code D has a minimum distance of 4, therefore, it can detect triple errors. (d) Code C and code D (©) None () Code DNumber Systems and Codes Hamming Code Hamming code is an error-correeting code. It is constructed by adding a number of parity bits to each group of n-bit information, or message in such a way so as to be able to locate the bit position in which error occurs. Let us assume that k parity bits p,, p, . ...p, are added to the m-bit message to form an (71+ £)-bit code. The value of k must be chosen in such a way so as to be able to deseribe the location of any of the n+ k possible error bit locations and also ‘no error’ condition. Consequently, k must satisfy the inequality Yontktl (22) The location of each of the 1 + k bits within a code word is assigned a decimal number, starting from 1 to the MSB and n + k to the LSB. k parity checks are performed on selected bits of each code word. Each parity check includes one of the parity bits. The result of each parity check is recorded as 1 if error has been detected and as 0 if no error has been detected. Let the results of the parity checks involving the parity bits p,,p, ,»-. . are c,, Cy, .. respectively. Bit c, is 1 ifan error is detected and 0 if there is no error. Similarly c,, c,, . .., ete. The decimal value of the binary word formed c,, ¢, . . .. ¢, gives the decimal value assigned to the location of the erroneous bit. If there is no error, then the decimal value will be 0. ‘This decimal number is the position or location number. The parity bits p,, p,, .. . are placed in locations 1,2,4,.6,201, Example 2.45 Find out the value of & for converting BCD code into Hamming code and the bit positions of the resulting Hamming code. Solution The value of & must be chosen to satisfy the eqn. (2.2) since n =4, therefore, UDk+S The minimum value of k for which it is satisfied is 3. Therefore, three parity bits are attached to each of the BCD code for constructing the Hamming code. It will be a 7-bit code with bit positions Values (0 or 1) are assigned to the parity bits so as to make the Hamming code have either even parity or odd parity and when an error occurs, the position number will take on the value assigned to the location of the erroneous bit, In the case of BCD code with three parity bits there are seven error positions. Table 2.13 gives these error positions and the corresponding values of the position number.Modern Digital Electronics From Table 2.13 we observe, that if an error occurs in positions 1,3,5,7 2,3,6,7 4,5,6,7 Therefore, p, is selected so as to establish even (or odd) parity in positions 1, 3, 5,7 ‘p, is selected so as to establish even (or odd) parity in positions 2, 3, 6, 7 1p, is selected so as to establish even (or odd) parity in positions 4, 5, 6, 7 (Copyrights materialNumber Systems and Codes 67 Example 2.47 If the Hamming code sequence 1100110 is transmitted and due to error in one position, is received as 1110110, locate the position of the error bit using parity checks and give the method for obtaining the correct sequence. Solution Parity check on 4, 5, 6, 7 (0110) positions gives ¢, = 0 (even parity) Parity check on 2, 3, 6, 7 (1110) positions gives ¢, = 1 (odd parity) Parity check on 1, 3, 5, 7 (1110) positions gives ¢, = I (odd parity) Therefore, the position number formed is c, ¢, ¢, = 011, which means that the location of the error is in position 3, To correct the error the bit received in location 3 is complemented and the correct message 1100110 is received. Example 2.48 (a) Find the distance between the BCD digits 0110 and 0111. (b) Determine Hamming codes for 0110 and 0111 and find the distance between them. Use even parity. Solution (a) The distance between the BCD numbers 0110 and 0111 is I since only the LSB is different. (b) The Hamming codes for these are given below Hamming code BCD code PA Pm Pom mm DCBA 1234 567 or 1 0 1100 1 1 0 ori. oo oO 1 1 1 1 ‘These Hamming codes differ in positions 1, 2, 4, and 7, thus the distance between them is four. Example 2.49 Some $-4-2-1 code words are transmitted in Hamming code with even parity checking. The following words are received, (a) 0101000 (©) 1110011 (b) 0011101 (0 1111001 (©) 1100100 (g) 1101001 (@) 1100110 (h) 1000010 (i) Find out the correctly received words, if any. ii) Determine the words that have single error and specify the correct decimal digit. (Gii) Find out the words received with double error, if any.Modern Digital Electron Solution (a) 0101000 Parity check in positions 4,5, 6,7 1000 Parity check in positions 2,3, 6,7 1000 Parity check in positions 1,3, 5,7 0000 The error position is ¢, ¢, c,= 110 = (6),. Therefore, the correct message is 0101010 which is decimal 2. (b) By performing the parity checks, we obtain ¢, ¢, ¢,= 101 =S ‘Therefore, the correct message is 0011001 which corresponds to decimal 9. (©) Here, ¢, ¢, ¢,= 110=6. ‘Therefore, the correct message is 1100110 which corresponds to decimal 6, (d) Here, ¢, c, c, = 000 which means there is no error. This code corresponds to decimal 6 (c) The parity checks give c, c, c, = 001 = (1),,, which means the correct message is 0110011. This corresponds to 4-bit message 1011 which is not a valid BCD digit. This shows that there is one more error in this, which can not be corrected i.e. its location can not be determined. (f) Here, ¢, ¢, ¢, = 011 =(3),,. The correct message is 1101001 which corresponds to BCD 1 (g) Here, c, c, ¢,=000, which means there is no error. The BCD word is 1. (h) The parity checks give ¢, ¢, ¢, = 111 =(7),., The correct message is 1000011 corresponding to BCD 3. Example 2.50 For ASCII code (a) determine the number of parity bits which must be appended to the code to make it an error-correcting code i.e. Hamming code. (b) determine the locations of the parity bits. Solution (a) Since n= 7, therefore using Eq. (2.2), we obtain DET +k+1 where, k is the number of parity bits to be attached. Thus gives k= 4. (b) To determine the locations in which the parity bits are to be attached, we construct Table 2.14 which gives the error positions and the corresponding values of the position numbers,Number Systems and Codes 69 Table 2.14 Error position e G4 & 0 oO 0 0 oO 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 oO 1 0 0 5 o 1 0 1 6 oO 1 1 oO 7 oO 1 1 1 8 1 0 0 0 9 1 0 0 1 10 1 0 1 0 ut 1 0 1 1 From Table 2.14 we observe, that if an error occurs in positions 1,3,5,7,9,01 then c,=1 2,3,6,7, 10, 11 then c, 4,5, 6,7 8,9, 10, 11 Therefore, p, is selected so as to establish even parity in positions ‘1, 3, 5, 7.9, 11 p, is selected so as to establish even parity in positions 2,3, 6,7,10,11 »p, is selected so as to establish even parity in positions 4, 5, 6, 7 ’p, is selected so as to establish even parity in positions 10,11 Since one parity bit must be involved in each value of c, therefore, we observe that the parity bits must be located in positions 1, 2, 4.and 8. Thus the Hamming code will be Poo Pr Py Py MM 1 2 3 4 5 6 7 8 9 0 SUMMARY Various number systems that are widely used in digital circuits, microprocessors, computers, ete. have been presented. The rules of arithmetic operations like addition, subtraction, multiplication, division, ete. are given.70 Modern Digital Electronics Different codes are in use in digital systems for representing numerals, alphabets and special symbols and some of the more commonly used codes have been introduced. The ASCII is the most commonly used code in computers. Any programme and data are entered into the memory of the computer using key-board. When any key is pressed, its ASCII code is generated which gets stored in the memory. The knowledge of these number systems and codes is very essential for the effective understanding of various digital systems including microprocessors. When digital data is transmitted from one location to another location error may occur in transmission due to the presence of electrical noise. To detect and correct the error, error-detection and error-correction codes are used. These codes are based on the principle of parity checking. The concepts of error- detection, error-correction together with the codes used have been discussed. GLOSSARY Alphanumeric codes Codes that represent numerals, alphabets (letters) and other usual symbols, for example, ASCII code. ASCH Code (American Standard Code for Information Interchange) A 7-bit code widely used in computers and related areas for representation of alphanumeric characters and special symbols. Base (or Radix) of a number system ‘The number of distinct symbols (digits) used in a number system. BCD (Binary-coded decimal) A code for representing decimal numbers is which each decimal digit is represented by its 4-bit binary code, See also Natural BCD. Byte A group of eight bits. Code system of representation of numeric, alphabets or special characters in a binary form for processing and transmission using digital techniques. Complement Inversion of the value of a binary number, variable, or expression. Complementation The process of determining complement of a binary number, variable, or expression. Decimal number system A number system with base (or radix) 10. The ten digits used to represent any number are: 0, 1, 2,3, 4, 5, 6, 7, 8, and 9. Encoding The process of coding alphabets, numerals and symbols in binary format. Even parity A digital word (string of Os and 1s) having an even number of ones. Error correcting code A code used for correction of error in the transmis: n of digital signals, Error detecting code A code sed for detection of error in the transmission of digital signals Excess-3 code ABCD code formed by adding 3(0011) to the binary equivalent of the decimal number. Gray code A code in which only one bit changes between successive numbers. Hamming code An error correcting code, HEX Abbreviation for hexadecimal. Hexadecimal code A method of representing binary numbers in which each group of 4 bits (starting from the right most bit) is represented by its hex digit Hexadecimal number system A number system that uses digits 0 through 9 and the alphabets A through F. Its base (or radix) is 16.Number Systems and Codes Least significant bit (LSB) The right-most bit of a binary number. It has the least weight. Least significant digit (LSD) The right most digit of a number. Most significant bit (MSB) The left-most bit of a binary number. Most significant digit (MSD) The left-most digit of a number. Natural BCD BCD representation that uses natural binary numbers. Nibble A group of four bits. Nine’s complement Nine’s complement of an V-digit-decimal numbers the number obtained by subtracting it from an N-digit number consisting of all 9’s. Octal code A code in which each group of three bits starting from LSB is represented by its equivalent octal digit. Octal number system A number system with base (or radix) 8 that uses digits 0, 1, 2, 3, 4, 5, 6, and 7 Odd parity A digital word having an odd number of ones. One's complement ‘The number obtained by complementing each bit of a binary number. One’s complement representation Abinary representation used for representing positive as well as negative numbers (signed numbers) Parity A term used to specify the number of ones in a digital word as odd or even. Parity bit An extra bit attached to a binary word to make the parity of the resultant word even or odd. Parity checker A logic circuit that checks the parity of a binary word. Parity generator A logic circuit that generates an additional bit which when appended to a di makes its parity as desired (odd or even). tal word Positional number system A number system in which value of a digit depends upon its position in the number. Radix Same as the base Sign bit The MSB of a signed binary number. If 0, the number is positi negative. e, when it is 1, the number Signed binary number A binary number that is either positive or negative Sign-magnitude representation A representation system for signed binary numbers in which the MSB represents the sign and the remaining bits represent the magnitude of the number. Two's complement Binary number obtained by adding one to the one’s complement of a binary number. Two's complement representation A method of representation of binary number in which negative numbers are represented by two's complement of their positive equivalents. Weighted code A binary code in which weight is assigned to each position in the number. Word A group of bits. REVIEW QUESTIONS 2.1. The radix of a binary number system is, and the digits used are 2.2 In, number system, 16 distinet symbols are used to specify any number.24 2.5 2.6 27 2.8 2.9 2.10 21 212 2.13 2.14 2.15 2.16 217 2.18 2.19 2.20 2.21 Modern Digital Electronics ‘The weights assigned in an 8-bit binary number to LSB and MSB are and respectively. ‘The MSB of a signed-binary number indicates its 2's complement of a 2’s complement is ‘The number of bits required to represent 25 in BCD is. ‘The Excess-3 code for decimal number 8 is ‘The number of bits in ASCII code is, : ‘The number of characters represented by ASCII code is, The parity of 01110010 is The minimum distance required for a code to be error detecting code is, Aminimum distance of, is required for a code to be error correcting code. The process of subtraction gets converted into that of addition by using Gray code is a. . (weighted/non-weighted) The distance between the code words 10010 and 10101 is Asingle parity bit attached to 8421 code makes its minimum distance Aminimum of. parity bits are required for generating Hamming code for 8421 code. The number of parity bits required for generating Hamming code for ASCII code is In 7-bit Hamming code for BCD, the parity bits are at locations. The minimum distance of ASCII code changes from to in its Hamming code. PROBLEMS 2A 22 24 25 2.6 Determine the decimal numbers represented by the following binary numbers: (a) L101 (©) M0 (ec) 101.0011 (g) 0.11100 (6) 101001 (a) 1100100 (f) 1010.1010 Determine the binary numbers represented by the following decimal numbers: (a) 37 (©) 15 (e) 11.75 (b) 255 (d) 26.25 (01 ‘Add the following groups of binary numbers: loi 10.10.1101 ® stor (6) + 101.01 Perform the following subtractions using 2°s complement method: (a) 01000 - 01001 (b) 01100 - 00011 (c) 0011.1001 — 001.1110 Convert the following numbers from decimal to octal and then to binary. Compare the binary numbers obtained with the binary numbers obtained directly from the decimal numbers, (a) 375 (b) 249 (c) 27.125 Convert the following binary numbers to octal and then to decimal. Compare the decimal numbers obtained with the decimal numbers obtained directly from the binary numbers. (a) 11011100.101010 (6) 01010011.010101 (c) 1011001127 28 2.9 2.10 2 2.12 213 2.14 2.15 2.16 247 218 219 2.20 2.21 2.22 2.23 2.24 Number Systems and Codes 73 Convert the decimal numbers in Problem 2.5 to hexadecimal and then to binary. Compare the binary numbers obtained with the binary numbers obtained directly from the decimal numbers. Convert the binary numbers in Problem 2.6 to hexadecimal and then to decimal. Compare the decimal numbers obtained with the decimal numbers obtained directly from the binary numbers. Encode the following decimal numbers in BCD code: (a) 46 (b) 327.89 (©) 20.305 Encode the decimal numbers in Problem 2.9 to Excess-3 code. Encode the decimal number 46 to Gray code. Use the 6-bit internal code to represent the statement. P=3*0 Write your full name in (a) ASCII code (b) EBCDIC code —_(c) 6-bit internal code Include blanks wherever necessary. Attach an even parity bit as MSB for (a) ASCII code (b) EBCDIC code Repeat Problem 2.14 for odd parity, Find the number of bits required to encode: (a) 56 elements of information (b) 130 elements of information Write 8-bit ASCI code (parity and 7-bit code) ob’ format. Develop the binary subtraction rules using one’s complement representation for negative numbers. How many bits of memory are required for storing 100 names of a group of people, assuming that no name occupies more than 20 characters (including spaces)? Assume 7-bit ASCII code with parity bit. A line printer is capable of printing 132 characters in a single line and each character is represented by ASCII code. How many bits are required to print each line? How many words can be added to code A, in Example 2.44, without changing its error-detection and correction capabilities? Give a possible set of such words. Is this set unique? Find the number and positions of parity bits to be added to construct Hamming code for an 8-bit data word. Determine Hamming code sequence with odd parity for natural BCD for making it an error correcting code. For ASCII code words 1010010 and 1010000 ed in Problems 2.14 and 2.15 in hexadecimal (a) determine the distance between them. (b) Determine Hamming code words and distance between them. Construct Hamming codes for the following 8-bits words (a) 10101010 (b) 00000000 (©) dui For some 8-bit data words, the following Hamming code words are received. Determine the correct data words. Assume even parity check. (a) 000011101010 —(b) 101110000110 (ce) 101111110100CHAPTER 3 SEMICONDUCTOR DEVICES—SWITCHING MODE OPERATION 3.1 INTRODUCTION The basic functional blocks of digital systems have been discussed in Chapter 1. It was also shown there that these functions can be realised using switches. If we make a digital system requiring hundreds of gates using mechanical switches, perhaps we may not be able to operate the switches as desired. Even if'a system with a few gates using mechanical switches is used, the operation will be quite complex and slow. The speed of switching can be increased if we use relays. Relays are bulky and generate a lot of electrical noise and hence are not very convenient except for large power handling systems. These difficulties can be overcome if semiconductor devices such as p-n junction diode, bipolar junction transistor (BJT) or unipolar transistor like metal-oxide-semiconductor field-effect transistor (MOSFET) are used as switches. These devices much faster than relays and mechanical switches, and are best suited for digital circuits. Earlier di systems, including the complex digital computers, used vacuum tubes as switches which were later replaced by semiconductor devices. This resulted in considerable savings in terms of cost, size, weight, and power requirements, These circuits were also faster in comparison to vacuum tube circuits Because of the tremendous progress in semiconductor technology, itbecame possible to fabricate thousands of components like diodes, transistors, resistors, and capacitors on tiny chips of silicon. This made possible integration, that is the fabrication of complete circuits on a small silicon chip. The resulting devices are popularly known as ICs (integrated circuits). ICs have significant advantages over discrete circuits as far as size, weight, power consumption, cost, speed of operation, and reliability are concerned. A large number of circuits can be fabricated on a single chip, requiring processes that are essentially similar to those for discrete transistors resulting in a considerable savings in size and cost. With the developments in semiconductor technology there has been a steady improvement in reliability, production yields, packaging density, and speed of operation. In fact, the number of components per chip has doubled every year since 1959, when the planar technology for the manufacture of transistors was introduced. These developments have made possible electronic calculators, wrist watches, microcomputers, ete. on single chips of a few millimetre square size.
You might also like
Chapter 1.2 - Number Systems and Codes
PDF
No ratings yet
Chapter 1.2 - Number Systems and Codes
74 pages
Unit 3: Data Representation
PDF
No ratings yet
Unit 3: Data Representation
20 pages
Unit - 1 Number Systems & Boolean Algebra: Introduction About Digital System
PDF
100% (1)
Unit - 1 Number Systems & Boolean Algebra: Introduction About Digital System
111 pages
SBSA1101
PDF
No ratings yet
SBSA1101
97 pages
EC302 Digital System Design - MOD-1
PDF
No ratings yet
EC302 Digital System Design - MOD-1
265 pages
Digital Electronic
PDF
No ratings yet
Digital Electronic
197 pages
COA Module 3
PDF
No ratings yet
COA Module 3
99 pages
Digital Electronics & Computer Fundamentals Theory.
PDF
50% (2)
Digital Electronics & Computer Fundamentals Theory.
137 pages
Week 4
PDF
No ratings yet
Week 4
33 pages
4CS015Lecture1HCK 90180
PDF
No ratings yet
4CS015Lecture1HCK 90180
57 pages
Screenshot 2025-05-14 at 6.32.49 PM
PDF
No ratings yet
Screenshot 2025-05-14 at 6.32.49 PM
131 pages
SM 3rd-Sem Cse Digital-Electronics
PDF
No ratings yet
SM 3rd-Sem Cse Digital-Electronics
38 pages
BEEE-Unit-6 Digital Electronics
PDF
No ratings yet
BEEE-Unit-6 Digital Electronics
22 pages
Unit 1
PDF
No ratings yet
Unit 1
118 pages
1.number Sys
PDF
No ratings yet
1.number Sys
7 pages
CA Unit 1
PDF
No ratings yet
CA Unit 1
259 pages
Chapter 2 - Number System
PDF
No ratings yet
Chapter 2 - Number System
62 pages
Number Sysytem
PDF
No ratings yet
Number Sysytem
12 pages
Programmable Logic Controls, Chapter 3 Number Systems and Codes
PDF
No ratings yet
Programmable Logic Controls, Chapter 3 Number Systems and Codes
18 pages
ECE 421-Week 2
PDF
No ratings yet
ECE 421-Week 2
30 pages
Intcom Number System - 20240927 - 202622 - 0000
PDF
No ratings yet
Intcom Number System - 20240927 - 202622 - 0000
24 pages
Cam Scanner
PDF
No ratings yet
Cam Scanner
20 pages
Sem 3
PDF
No ratings yet
Sem 3
22 pages
Number System
PDF
No ratings yet
Number System
22 pages
Number System Codes
PDF
No ratings yet
Number System Codes
29 pages
Lesson 2 - Data in Computer
PDF
No ratings yet
Lesson 2 - Data in Computer
78 pages
Ee202chapter1numberandcodesystembaia 131112193950 Phpapp02
PDF
No ratings yet
Ee202chapter1numberandcodesystembaia 131112193950 Phpapp02
81 pages
Code Conversion
PDF
No ratings yet
Code Conversion
132 pages
Lec - A-01 - Number Systems and Codes
PDF
No ratings yet
Lec - A-01 - Number Systems and Codes
84 pages
3
PDF
No ratings yet
3
145 pages
CSC 209 Notes Split
PDF
No ratings yet
CSC 209 Notes Split
57 pages
Ch1 Number Systems Codes July 2023
PDF
No ratings yet
Ch1 Number Systems Codes July 2023
43 pages
Ece 3sem 147302nol
PDF
No ratings yet
Ece 3sem 147302nol
98 pages
Digital Logic
PDF
No ratings yet
Digital Logic
156 pages
Logic Lectures
PDF
No ratings yet
Logic Lectures
121 pages
Lect 14 15 NumberSystems
PDF
No ratings yet
Lect 14 15 NumberSystems
56 pages
Unit 1 Number Systems
PDF
No ratings yet
Unit 1 Number Systems
54 pages
Module3 CFD Notes
PDF
No ratings yet
Module3 CFD Notes
27 pages
1digital Number System
PDF
No ratings yet
1digital Number System
19 pages
Chapter 1 Binary System
PDF
No ratings yet
Chapter 1 Binary System
76 pages
Numerical Analysis Chapter 2
PDF
No ratings yet
Numerical Analysis Chapter 2
7 pages
CA Chapter 1 Number System
PDF
No ratings yet
CA Chapter 1 Number System
75 pages
Chapter 1 Binary System
PDF
No ratings yet
Chapter 1 Binary System
73 pages
De & MP Lecture Note
PDF
No ratings yet
De & MP Lecture Note
156 pages
Digital Logic Design (R17a0461) (1) - 7-130
PDF
No ratings yet
Digital Logic Design (R17a0461) (1) - 7-130
124 pages
CH-1 Number System
PDF
No ratings yet
CH-1 Number System
44 pages
Number System
PDF
No ratings yet
Number System
20 pages
Unit-3 IT
PDF
No ratings yet
Unit-3 IT
5 pages
Ade Units Iii-V
PDF
No ratings yet
Ade Units Iii-V
101 pages
BADASS Tutorial On Chapter 1 Number System
PDF
No ratings yet
BADASS Tutorial On Chapter 1 Number System
27 pages
Unit 2 - Binary Numbers and Arithmetic
PDF
No ratings yet
Unit 2 - Binary Numbers and Arithmetic
8 pages
Digital Electronics
PDF
No ratings yet
Digital Electronics
64 pages
Number System
PDF
No ratings yet
Number System
6 pages
Module - 4 Number System and Codes
PDF
No ratings yet
Module - 4 Number System and Codes
20 pages
Module 3b
PDF
No ratings yet
Module 3b
9 pages
Chapter 1 - Ee202
PDF
No ratings yet
Chapter 1 - Ee202
18 pages