Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore E-LESSON-1-2

E-LESSON-1-2

Published by Teamlease Edtech Ltd (Amita Chitroda), 2020-11-05 09:21:36

Description: E-LESSON-1-2

Search

Read the Text Version

IDOL Institute of Distance and Online Learning ENHANCE YOUR QUALIFICATION, ADVANCE YOUR CAREER.

B.C.A 2 All right are reserved with CU-IDOL Digital Circuit and Logic Design Course Code: BCA 111 Semester: First E-Lesson: 1 SLM Unit: 1-2 www.cuidol.in Unit-1,2(BCA 111)

Digital Circuit & Logic Design 33 OBJECTIVES INTRODUCTION  Student will be able to define number system  Student will be able to define binary operations  Student will be able to describe binary arithmetic  Student will be able to describe inter-conversion of number systems  Student will be able to define digital codes  Student will be able to explain various digital codes  Student will be able to differentiate among various digital codes www.cuidol.in Unit-1,2(BCCA 1611) INASlTl ITriUgThEt OarFeDrIeSsTeArNvCeEd AwNitDh OCNUL-IIDNOE LLEARNING

TOPICS TO BE COVERED 4 1. Decimal numbers, 2. binary numbers, 3. binary arithmetic, 4. 1's and2's complements, 5. octal numbers, 6. hexadecimal numbers, 7. Inter-conversions of number systems 8. Binary coded decimal (BCD), 9. Gray code, 10.Excess-3code, 11. positive and negative number 12.ASCII code www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Introduction 5 A number system defines how a number can be represented using distinct symbols. For example, (2A)16 and (52)8 (42)10 Types of Number Systems:- 1. Decimal 2. Binary 3. Octal 4.Hexadecimal 5. BCD 6. Excess -3 7. Gray Code www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Introduction 6 • The number system is very beneficial for students as they will become familiar with binary decimal, octal and hexadecimal number system. • binary number (base 2) are Internally utilized by Digital computers for presenting the data and performing various arithmetic operations [1]. • The hexadecimal number (base 16) system (called \"hex\" for short) facilitate us with a shorthand technique by utilizing binary numbers. • four binary digits (bits) can be represented by one digit in hex correspondingly and vice versa , so the internal presentation of one byte can be demonstrated either by eight binary digits or two hexadecimal digits [2]. • Less commonly used is the octal number system (base 8), where one digit in octal represents the three binary digits (bits). www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Introduction 7  The decimal number system is also known as position based number system. The decimal number system has a base of 10, minimum number is 0 and highest value is 9.  The octal number system has a base of 8 with highest value is 7 and lowest value 0 [3].  The binary number system has a base of 2,so the numeral with highest value is 1 and lowest 0 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

The decimal system (base 10) 8 In this system the base b = 10 means ten symbols we are using in our day to day life. eg . 0,1,2,3,4,5,6,7,8,9 The following example demonstrate the place values for the integer number 224 in the decimal system [4]. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

The Binary system (base 2) 9 In binary number system, base b = 2 and there are only two symbols, S = {0, 1} The symbols are called as binary digits or bits (binary digit). (11001)2 in binary is the same as 25 in decimal [5]. The corresponding decimal number is N = 16 + 8 + 0 + 0 + 1 = 25. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Binary 10 Arithmetic Rules www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Complement Arithmetic 11 • Complements are used for simplifying the subtraction as well as the logical manipulations. • For each radix-r system (base of number is represented by radix r) there are two approaches [6]. 1. r’s complement 2. (r-1)’s complement • In the binary system , base is 2 so 2's complement and 1's complement are there [7]. • 1's complement • The 1's complement of a binary number is computed by inverting all 1's to 0's and all 0's to 1's. • 2's complement • 2's complement = 1's complement + 1 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Hexadecimal system (base 16) 12 • In hexadecimal number system, base b = 16 and we utilize total sixteen symbols to represent a number [8]. • S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F} • (2AE)16 in hexadecimal number system will be equal to 686 in decimal [9]. • The corresponding decimal number is N = 512 + 160 + 14 = 686 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Octal system (base 8) 13 • In octal number system, the base b = 8 which indicates total eight symbols to represent a number. S = {0, 1, 2, 3, 4, 5, 6, 7} • (1256)8 in octal is the same as 686 in decimal [10]. decimal number is N = 512 + 128 + 40 + 6 = 686. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

14 Summary of the four positional systems [11] www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Comparison of Number Systems 15 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Any base to decimal conversion 16 convert the binary number (110.11)2 to decimal [12]. convert the hexadecimal number (1A.23)16 to decimal. convert (23.17)8 to decimal. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Decimal number conversion to Other Base 17 System • Following steps are used: • Step 1 − the decimal number is divided by the value of the new base. • Step 2 − find out the remainder from Step 1 which will act as the least significant digit of new base number or rightmost digit. • Step 3 − the quotient of the previous value is divided by the new base. • Step 4 − note down the remainder from Step 3 as the next digit (to the left) of the new base number. • Steps 3 and 4 will be repeated again until the quotient becomes zero in Step 3. • For the new base number, the Most Significant Digit (MSD) will be the last remainder obtained. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Converting a Decimal Number to a Binary 18 Number  For converting a decimal number into the binary number, the remainder method can be utilized. This method consists the following four steps: a) decimal number is Divided by the base which is 2 as binary number base. b) Find the remainder and Indicate it at right position. c) each quotient is divided continuously (and indicating the remainder) until the quotient is zero. d) if you start at the bottom, the answer will read from top to bottom to get final binary number. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

CONVERSIONS 19 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Converting a Decimal Number to a 20 Hexadecimal Number • a decimal number can be converted into its hexadecimal equivalent using the same remainder approach, it involves the following four steps: • By dividing the given decimal number by the 16 which is the base. • mention the remainder to the right. If the remainder is between 10 and 15, mention the correspondingly hex digit A through F. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

CONVERSIONS 21 • Division of each quotient take place continuously (and indicating the remainder) until the zero quotient is achieved. • The final hexadecimal is the numeric remainder obtained from the last division to the first. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

22 Binary-hexadecimal conversion and Vice Versa www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Binary Codes 23  Binary Coded Decimal (BCD)  4-bit binary number use to represent each decimal digit  Weighted code: 8-4-2-1  The binary numbers 0000 .. 1001 are used to represent the decimal digits 0 .. 9  The binary values 1010 .. 1111 are not used. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Binary Codes 24 GRAY CODE • Gray Code is a form of binary that uses a another method of incrementing from one number to the next. • With Gray Code, only one bit changes state from one position to other. • These codes are also called as cyclic codes. • Un weighted code • Example: 2-bit Gray Code Binary Gray Code Decimal 00 00 0 01 01 1 10 11 2 11 10 3 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Binary Codes 25 • 3-bit Gray Code www.cuidol.in Decimal All right are reserved with CU-IDOL 0 1 2 3 4 5 6 7 Table 1.3: Gray code and binary codes[7] Unit-1,2(BCA 111)

Binary Codes 26  ASCII Code  American Standard Code for Information Interchange  Commonly code used for the storage and transfer of alphanumeric characters.  7-bit Weighted Code Can represent a entire of 128 characters  Used to represent letters, numbers and additional characters (e.g. special control characters)  Any word or number can be represented (and stored or transfer) using by its ASCII Code. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Binary Codes 27 EXCESS-3 CODE • Excess-3 code is an example of weighted code. • Excess-3 code is equivalent to a decimal number which is obtained by adding 3 and then converting it to a binary format. • consider the example, for finding the excess-3 code of decimal number 5, first 3 is added to 5 and get 8 and then binary equivalent of 7 is 1000 that forms the excess-3 code equivalent. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Binary Codes 28 EXCESS-3 CODE www.cuidol.in DECIMAL EXCESS-3 0 0011 1 0100 2 0101 3 0110 4 0111 5 1000 6 1001 7 1010 8 1011 9 1100 Table 1.4 Excess-3 codes All right are reserved with CU-IDOL Unit-1,2(BCA 111)

Unsigned and Signed Numbers 29 bn – 1 b1 b0 Magnitude MSB Figure : Unsigned number bn – 1 bn – 2 b1 b0 Sign Magnitude 0 denotes + MSB 1 denotes – Figure : Signed number www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Unsigned Binary Numbers 30 • For an n-bit unsigned binary number, all n bits are used to present the magnitude of number.  For an n-bit binary number 0 < D < 2n – 1  where D = decimal equivalent value  For an 8-bit binary number: 0 < D < 28 – 1  28 = 256 0 < D < 216 – 1  For a 16-bit binary number:  216 = 65536 www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Signed Binary Numbers 31 • For an n-bit signed binary number, n-1 bits are used to identify the magnitude of the number. • The leftmost bit (MSB) is, generally, used to specify the sign of the number. 0 = positive number 1 = negative number • Three representations are used for signed binary numbers: 1. Sign-and-Magnitude 2. One's Complement 3. Two's Complement www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Sign and Magnitude 32  The design of arithmetic circuits for sign-and-magnitude binary numbers is difficult.  For an n-bit signed binary number,  The MSB (leftmost bit) is the sign bit.  The remaining n-1 bits represent the magnitude  (2n-1 - 1) <= D <= + (2n-1 – 1)  Includes a presentation for -0 and +0. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

ASCII Code 33  American Standard Code for Information Interchange  Commonly code used for the storage and transfer of alphanumeric characters.  7-bit Weighted Code Can represent a entire of 128 characters  Used to represent letters, numbers and additional characters (e.g. special control characters)  Any word or number can be represented (and stored or transfer) using by its ASCII Code. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

Multiple Choice Questions 1. 1's complement of binary number 110010 is : 34 (a) 001101 (b) (b) 000001 (c) 11110 (d) 1110000 2. 2’s complement of 01000 is: (a) 1110 (b) (b) 11000 (c) 11111 (d) 1111 3. The binary value of 7: (a) 1111 (b) 11110 (c) 0111 (d) 1100 Answers: 1. (a) 2. (b) 3.(c) Unit-1,2(BCA 111) All right are reserved with CU-IDOL www.cuidol.in

Multiple Choice Questions 35 4. Convert Binary 1011 into its Hexadecimal equivalent : (a) A (b) E (c) C (d) B 5. Octal equivalent 011 is: (a) 3 (b) 4 (c) 5 (d) 7 Answers: 4. (d) 5.(a) www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

SUMMARY 36 Let us recapitulate the important concepts discussed in this session: •A numeral system (or system of numeration) is a writing system for expressing numbers; that is, a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner. •The number the numeral represents is called its value. •A numeral system (or system of numeration) is a writing system for expressing numbers; that is, a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner. •The same sequence of symbols may represent different numbers in different numeral systems. For example, “11” represents the number eleven in the decimal numeral system (used in common life), the number three in the binary numeral system (used in computers), and the number two in the unary numeral system (e.g., used in tallying scores). •The number the numeral represents is called its value.. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

FREQUENTLY ASKED QUESTION 37 Q1. What do you understand by 2’s complement of a number? Ans: 2’s complement is obtained by adding 1 to 1’s complement of a binary number. 2’s complement method is used for subtraction operation in digital circuits with the use of 2’s complement representation for negative number, it is possible to use the circuit designed for binary addition for the purpose of binary subtraction also. For more details refer unit 1. Q2. Explain the Digital Codes. Ans: Computers and other digital circuits process data in binary format. Various binary codes are used to represent numbers, alphabets or special characters. In coding, when numbers, letters or special characters are represented by a specific group of symbols, it is said that the number, letter or special characters being encoded and group of symbols is called as a code. For example, 1000001 in binary is 65 in decimal, 41 in BCD and alphabet A in ASCII. For more details refer unit 2. www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL

References 38 All right are reserved with CU-IDOL 1. www.thevbprogrammer.com 2. www.coursehero.com 3. www.tutorialspoint.com 4. www.csie.nuk.edu.tw 5. verticalhorizons.in 6. www.elex.dauniv.ac.in 7. www.probabilitylectures.narod.ru 8. www.ergopalkrishnawithc.blogspot.in 9. www.ensolt.com 10. www.encoder.com 11. www.slideshare.net 12. www.freepatentsonline.com www.cuidol.in Unit-1,2(BCA 111)

39 THANK YOU www.cuidol.in Unit-1,2(BCA 111) All right are reserved with CU-IDOL


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook