Page 1 :
BEEE, , 4. DIGITAL ELECTRONICS, INTRODUCTION:, Analog Quantity & Digital quantity:, An analog quantity is one having continuous value., A digital quantity is one having a discrete set of values., , Figure: (a) Analog Signal, , (b) Digital Signal, , Digital System and Analog System:, A digital system is a combination of devices designed to manipulate logical information or, physical quantities that are represented in digital form; that is, the quantities can take only discrete, values. These devices are most often electronic, but they can also be mechanical, magnetic, or, pneumatic. Some of the more familiar digital system includes digital computers and calculators,, digital audio and video equipment, and the telephone system- the world’s largest digital system., An analog system contains devices that manipulate physical quantities that are represented, in analog form. In an analog system, the quantities can vary over a continuous range of values. For, example, the amplitude of the output signal to the speaker in a radio receiver can have any value, between zero and its maximum limit. Other common analog systems are audio amplifiers, magnetic, tape recording and playback equipment and a simple light dimmer switch., Advantages of digital signals:, 1., 2., 3., 4., , Noise Margin, Error Correction and Detection, Easily Programmable, Cheap Electronic Circuits, , Numbers:, We use numbers,, To communicate, To perform tasks, To quantify, To measure, 1. Numbers have become symbols of the present era., 2. Many consider what is not expressible in terms of numbers is not worth knowing, Whole Numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9 ..., Integers: --4, -3, -2, -1, 0, 1, 2, 3, 4 ...
Page 2 :
BEEE, , Irrational Numbers: π (approx. 3.1415927), e (approx. 2.718281828), square root of any, prime, Real Numbers: (All one-dimensional numerical values, negative and positive, including zero,, hole, integer, and irrational numbers), Complex Numbers: 3 - 4i, 3 + 5i, Different types of numbers find different application in the physical world. Whole numbers, work well for counting discrete objects, such as the number of resistors in a circuit., Number Systems:, 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., In a number system the information is divided into a group of symbols; for example, 26, English letters, 10 decimal digits etc., In conventional arithmetic, a number system based upon ten units (0 to 9) is used. However,, arithmetic and logic circuits used in computers and other digital systems operate with only 0's and, 1's because it is very difficult to design circuits that require ten distinct states. The number system, with the basic symbols 0 and 1 is called binary. i. e. A binary system uses just two discrete values., The binary digit (either 0 or 1) is called a bit., A group of bits which is used to represent the discrete elements of information is a symbol., The mapping of symbols to a binary value is known a binary code. This mapping must be unique., For example, the decimal digits 0 through 9 are represented in a digital system with a code of four, bits., In general in a number system with a base or radix r, the digits used are from 0 to r-1 and the, number can be represented as, r= base or radix of the system, a= number of digits having values between 0 and r-1, Binary Digits:, Each of the two digits in the binary system, ‘1’ or ‘0’ is called a bit, which is contraction of, the words ‘Binary Digit’. In digital circuits, two different voltage levels are used to represent two, bits., Generally, ‘1’ is represented by the higher voltage, which we will refer to as HIGH, and 0 is, represented by the lower voltage level, which we will refer to as a LOW. This is called positive logic., HIGH=1, &, LOW=0, Another system in which a ‘1’ represented by a LOW and a ‘0’ are represented by HIGH is, called negative logic., Groups of bits (combinations of ones and zeros), called codes, are used to represent, numbers, letters, symbols, instructions and anything else required in a given application., Types of Number systems:, 1. Binary Number System, 3. Octal Number System, , 2. Decimal Number System, 4. Hexadecimal Number System, , 1. Binary Number System:, 1) The binary number system has two digits (bits).
Page 3 :
BEEE, , 2), 3), 4), 5), 6), 7), , The binary number system has a base or radix 2., Has only two numerals, 0 and 1, It is an eight bit binary number., The binary digits are also known as bits, Example: (N) 2 = (11100110)2. (N)2 is an 8-bit binary number, The place values of different digits in a mixed binary number, starting from the binary point,, are 2 0 , 21 , 2 2 and so on (for the integer part) and 2 1 , 2 2 , 2 3 and so on (for the fractional, part)., 8) Example: 1110 2, Weighting, 23, 22, 21, 20, 1, 1, 1, 0, Bit 3 or MSB, Bit 2, , Bit 0 or least significant bit (LSB), Bit 1, , Binary Weights:, , 256 128, , 2, , 8, , 2, , 7, , 64, , 32, , 16, , 6, , 5, , 4, , 2, , 2, , 2, , 8, , 2, , 4, 3, , 2, , 2, , NEGATIVE POWERS OF TWO, (Fractional Part), , Binary, Point, , POSITIVE POWERS OF TWO, (Integer Part), , 2, 1, , 2, , 1, 0, , 2, , ½, , , , 2-1, , ¼, , 2, , -2, , 1/8, , 2, , -3, , 1/16 1/32 1/64, , 2, , -4, , 2, , -5, , 2, , -6, , 1/128, , 2-7, , Some features of Binary Numbers:, 1) Require very long strings of 1s and 0s, 2) Some simplification can be done through grouping, 3) 3-bit groupings: Octal (radix 8) groups three binary digits. Digits will have one of the, eight values 0, 1, 2, 3, 4, 5, 6 and 7, 4) 4-digit groupings: Hexadecimal (radix 16) Digits will have one of the sixteen values 0, through 15. Decimal values from 10 to 15 are designated as A (=10), B (=11), C (=12), D, (=13), E (=14) and F (=15), 2. Decimal Number System:, 1) The decimal number system is a radix-10 number system and therefore has 10 different, digits or symbols., 2) These symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9., 3) The decimal number system has ten digits., 4) The decimal number system has a base of 10., 5) It is also called ‘Base-10’ system because it has 10 digits., 1) The place values of different digits in a mixed decimal number, starting from the decimal, point, are 100 , 101 , 102 and so on (for the integer part) and 10 1 , 10 2 , 10 3 and so on (for, the fractional part)., Decimal Weights:, The position of each digit in a decimal number indicates the magnitude of the, quantity represented and can be assigned a weight.
Page 4 :
BEEE, , The weights for whole numbers are positive powers of ten that increase from right to, left from decimal point. The weights for whole numbers are negative powers of ten that, increases from left to right from decimal point (For fractional part)., The value of a digit is determined by its position in the number, , 107 106 105 10 4 103, , 10 2, , 101, , POSITIVE POWERS OF TEN, (Integer Numbers), , 100, , ·, , 10-1, , Decimal, Point, , 10 -2, , 10 -3, , 10 -4, , 10-5, , 10 -6, , 10 -7, , NEGATIVE POWERS OF TEN, (Fractional Numbers), , 3. Octal Number System:, 1) Digital systems operate only on binary numbers., 2) Since binary numbers are often very long, two shorthand notations, octal and hexadecimal,, are used for representing large binary numbers., 3) The octal number system has a base or radix of 8 and therefore has eight distinct digits., 4) Thus it has digits from 0 to 7. As in the decimal and binary systems, the positional valued of, each digit in a sequence of numbers is fixed., 5) Each position in an octal number is a power of 8, and each position is 8 times more, significant than the previous position., 1) The place values for the different digits in the octal number system are 8 0 , 81 , 8 2 and so on, (for the integer part) and 81 , 82 , 83 and so on (for the fractional part)., 4. Hexadecimal Numbers:, 1) The hexadecimal number system is a positional numeral system with radix or base 16., 2) It uses 16 distinct symbols, most often symbols decimal digits 0 to 9 represent values zero to, nine, and A, B, C, D, E and F, which represent the values 10, 11,12,13,14 and 15 respectively., 3) Hexadecimal numbers are often used in describing the data in computer memory., 4) A computer memory stores a large number of words, each of which is a standard size, collection of bits., 5) An 8-bit word is known as a Byte., 6) A hexadecimal digit may be considered as half of a byte., 7) Two hexadecimal digits constitute one byte, the rightmost 4 bits corresponding to half a byte,, and the leftmost 4 bits corresponding to the other half of the byte. Often a half-byte is called, nibble., 8) The place values for the different digits in the hexadecimal number system are, 160 , 161 , 162 and so on (for the integer part) and 16 1 , 16 2 , 16 3 and so on (for the fractional, part). E.g. 1E0.2A16, Number Conversion:, There are infinite ways to represent a number. The four commonly associated with modern, computers and digital electronics are: decimal, binary, octal, and hexadecimal., , Binary numbers to Decimal Number:, Example: Convert the given Binary number into Decimal number., A given binary number (N) 2 = (11100110) 2
Page 5 :
BEEE, , Its decimal value is given by,, , (11100110) 2 = 1 × 2 7 + 1 × 2 6 + 1 × 2 5 + 0 × 2 4 + 0 × 2 3 + 1 × 22 + 1 × 21 + 0 × 20, = 128 + 64 + 32 + 0 + 0 + 4 + 2 + 0, = 23010, , Answer: (11100110) 2 = 23010, , Binary fractional number to Decimal number:, Example: Convert given Binary number into Decimal number., A given binary fractional number (N) 2 = 101.1012, Its decimal value is given by,, , 101.1012, , = 1 × 22 + 0 × 21 + 1 × 20 + 1 × 2 -1 + 0 × 2 -2 + 1 × 2 -3, = 4 + 0 + 1 + ½ + 0 + 1/8, = 5 + 0.5 + 0.125, = 6.625 10, , Answer: 101.1012 = 6.625 10, , Binary to Octal Number:, Make a group of 3 bits starting from least significant bit (rightmost bit) and replace each group, by its equivalent octal number., Example: Convert the given binary number into octal number., A given binary number (N) 2, = 11011001 2, Its octal value is given by,, , 11011001 2, , =0 1 1 0 1 1 0 0 1, =, 3, = 3318, , 3, , 1, Answer: 11011001 2 = 3318, , Binary to Hexadecimal Number, , , Group the binary digits into groups of four, , Binary Number into Hexadecimal Number:, Make a group of 4 bits of binary number and replace each group by its equivalent, hexadecimal number., Group starting from least significant bit (rightmost bit)., Example: Convert the Binary number into Hexadecimal number., A given binary number (N) 2, = 11011001 2, Its hexadecimal value is given by,, , 11011001 2, , = 0 0 0 0 1 1 0 1 1 0 0, =, , 0, , D, , 9, , 1
Page 6 :
BEEE, , = 0D9 16, , Answer: 11011001 2 = 0D9 16, , Decimal to Octal Number:, Example: Convert the Decimal number into octal number., N 10 = 0.565 10, A given decimal number N 10 = 67810, Its octal value is given by,, Its octal value is given by,, , 678 8, 84 8, 10 8, 1 8, , Quotient Remainder, 84, 6, 10, 4, 1, 2, 0, 1, , Answer: 67810 = 01246 8, , 0.565 * 8, 0.52 * 8, 0.16 * 8, 0.28 * 8, 0.24 * 8, , 4, 4, 1, 2, 1, , = 0.52, = 0.16, = 0.28, = 0.24, = 0.92, , Answer: 0.565 10 = 0.44121.....8, , Decimal to Binary Number:, Example: Convert the Decimal number into Binary number., N 10 = 0.357810, A given decimal number N 10 = 156 10, Its binary value is given by,, , 156 2, 78 2, 39 2, 19 2, 9 2, 4 2, 2 2, 1 2, , Quotient Remainder, 78, 0, 39, 0, 19, 1, 9, 1, 4, 1, 2, 0, 1, 0, 0, 1, , Answer: 156 10 = 0100111002, , 0.3578 * 2, 0.7156 * 2, 0.4312 * 2, 0.8624 * 2, 0.7248 * 2, 0.4496 * 2, 0.8992 * 2, 0.7984 * 2, , = 0.7156, = 0.4312, = 0.8624, = 0.7248, = 0.4496, = 0.8992, = 0.7984, = 0.5968, , 0, 1, 0, 1, 1, 0, 1, 1, , Answer: 0.357810 = 01011011....2, , Decimal to Hexadecimal Number:, Example: Convert the Decimal number into Hexadecimal number., A given decimal number N 10 = 67810, Its hexadecimal value is given by,, , 678 16, 42 16, , Quotient Remainder, 6, 42, 2, A, , N 10 = 0.678 10, Its hexadecimal value is given by,, , 0.678 * 16, 0.848 * 16, 0.568 * 16, , = 0.848, = 0.568, = 0.088, , A, D, 9
Page 7 :
BEEE, , 2 16, , 0, , 0.088 * 16, , 2, , Answer: 67810 = 02A616, , = 0.408, , 1, , Answer: 0.678 10 = 0.AD91....16, , Example: Convert the Decimal number into Hexadecimal number., A given decimal number N 10 = 0.326510, Its hexadecimal value is given by,, , 0.3265 * 16, 0.2240 * 16, 0.5840 * 16, 0.3440 * 16, 0.5040 *16, 0.064 *16, 0.024 *16, , 5, 3, 9, 5, 8, 1, 0, , = 0.2240, = 0.5840, = 0.3440, = 0.5040, =0.0640, =0.0240, = 0.3840, , Answer: 0.326510 = 0.539581016, , Octal Number into Decimal Number, Example: Convert the Octal number into Decimal number., A given Octal number N 8 = 33.56 8, Its Decimal value is given by,, , 33 .56 8, , = 3 × 81 + 3 × 8 0 + 5 × 8-1 + 6 × 8-2, = 24 + 3 + 5/8 + 6/16, = 27.6987510, , Answer: 33 .56 8 = 27.6987510, , Octal Number into Binary Number:, , , Convert the octal number into its equivalent binary number in a group of 3 bits., , Example: Convert the octal number into binary number., A given Octal number N 8 = 542.4 8, Its binary value is given by,, , 542.4 8, , =, , 5, , 4, , = 1 0 1, 1 0 0, = 101100010.1002, , 2, , , , 0 1 0, , 4, , 1 0 0, Answer: 542.4 8 = 101100010 1002, , Octal Number into Hexadecimal Number:, Convert the octal number into its equivalent Binary number., Make a group of 4 bits, starting from the LSB and replace each group by its equivalent, Hexadecimal number., Example: Convert the Octal number into Hexadecimal number., A given Octal number N 8 = 154.48
Page 8 :
BEEE, , Its hexadecimal value is given by,, , 154.48, , =, , 1, , = 0, , 0 1, , =0, , 5, , 4, , 1 0 1, 6, , , , 1 0 0, , 4, , 1 0 0, , C, , 0, , 8, Answer: 154.48 = 06C.816, , Hexadecimal number into Binary Number:, Example: Convert the hexadecimal number into binary number., A given Hexadecimal number N 16 = 374F 16, Its binary value is given by,, , 374F 16, , =, , 3, , 7, , 4, , F, , = 0 0 1 1 0 1 1 1 0 1 0 0 1 1 1 1, , Answer: 374F 16 = 00110111010011112, Hexadecimal Number in to Octal Number:, 1. Convert the Hexadecimal number into its equivalent Binary Number., 2. Make a group of 3 bits and replace each group by its equivalent octal number., Example: Convert the hexadecimal number into octal number., A given Hexadecimal number N 16 = 374F 16, Its Octal value is given by,, , 374F 16, , =, , 3, , 7, , 4, , 0011, , 0111, , 0100, , F, , 1111, , =, , 000, , 011, , 011, , 101, , 001, , =, , 0, , 3, , 3, , 5, , 1, , 111, 7, Answer: 374F16 = 0335178, , BCD Code:, , , , , BCD stands for Binary-Coded Decimal. A BCD number is a four-bit binary group that, represents one of the ten decimal digits 0 through 9. The binary coded decimal (BCD) is a, type of binary code used to represent a given decimal number in an equivalent binary form., BCD-to-decimal and decimal-to-BCD conversions are very easy and straightforward., The BCD equivalent of a decimal number is written by replacing each decimal digit in the, integer and fractional parts with its four-bit binary equivalent., Example: The BCD equivalent of 23 .15 10 is written as 0010 0011.00010101BCD .
Page 9 :
BEEE, , , , Ex.:- Decimal number 4926 BCD, , (, , Decimal, Digit, , 1) Uncompressed BCD:, Each numeral is encoded into one byte, with, four bits representing the numeral and the remaining bits, having no significance., E.g.: Binary pattern of two bytes, 9, 1, Decimal :, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 01, Binary :, , BCD, 8, , 0100 1001 0010 0110 ), , 4, , 2, , 1, , 0, 0 0, 1, 0 0, 2, 0 0, 3, 0 0, 4, 0 1, 5, 0 1, 6, 0 1, 7, 0 1, 8, 1 0, 9, 1 0, Binary Addition:, , 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, , 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, , 2) Packed BCD:, Two numerals are encoded into a single byte, with, one numeral in the least significant nibble (bits 0-3) and, the other numeral in the most significant nibble (bits 4-7)., E.g.: Binary pattern of one byte., Decimal :, Binary :, , 9, 1001, , 1, 0001, , a) When two binary numbers are added, the result consists of sum and carry. Binary numbers, can have values of either o or 1, so four binary additions are possible as shown below., , 0+0, = 0, With carry 0, 0+1, = 1, With carry 0, 1+0, = 1, With carry 0, 1+1, = 0, With carry 1, b) Adding binary numbers employs the same procedures as adding decimal numbers:, 00, 01, 00, + 00, +00, +01, = 00, = 01, = 01, c) Examples:, (1), , (2), , (3), , 1 1, 1 1 0 1 0 1, + 1 1 1 0 0 0, , 1 1 1, 1 1 1, 1 0 1 0 1 0 1, +, 1 1 0 0 1 1, , 1111, 111101, + 101110, , Carry, Number 1, Number2, , 1 1 0 1 1 0 1, , 1 0 0 0 0 0 0 0, , 1000011, , Addition, , Binary Subtraction:, , Binary subtraction is also carried out in a similar method to decimal subtraction. The subtraction, is carried out from the LSB and proceeds to the higher significant bits. When borrow is 1, as in the, second row, this is to be subtracted from the next higher binary bit as it is performed in decimal, subtraction., 0-0, 0-1, 1-0, , =, =, =, , 0, 0, 1, , With borrow 0, With borrow 1, With borrow 0
Page 10 :
BEEE, , 1-1, , =, , 0, , With borrow 0, , Examples:, , Subtraction Using the Direct Method, The direct method of subtraction uses the concept of borrow. In this method, we borrow a 1, from a higher significant position when the minuend digit is smaller than the corresponding, subtrahend digit., , Example: Using direct method to perform the subtraction (1001-1000), Solution:, (-), , 1, 1, 0, , 0, 0, 0, , 0, 0, 0, , 1, 0, 1, , Example: Using direct method to perform the subtraction (1000-1001), Solution:, (-), `, , 1, 1, , 1, 1, 1, 1, , 0, 0, 1, 1, , 0, 0, 1, 1, , 0, 1, Borrow, 1, , End borrow has to be ignored., Answer: 1111 = (2’s complement of 0001)., When the minuend is smaller than the subtrahend the result of subtraction is negative and in, the direct method the result obtained is in 2’s complement form. So to get back the actual result we, have to perform the 2’s complement again on the result thus obtained., But to tackle the problem shown in Example 27 we have applied a trick. When a digit is, smaller in the minuend than that in the subtrahend we add 2 (the base of the binary system) to the, minuend digit mentally and we perform the subtraction (in this case 1 from 2) in decimal and write, down the result in the corresponding column. Since we have added 2 to the column, we have to add, 1 to the subtrahend digit in the next higher order column. This process is to be carried on for all of, the columns whenever the minuend digit is smaller than the corresponding subtrahend digit. The
Page 11 :
BEEE, , rest of the two binary subtraction methods, i.e., the r’s complement and the (r – 1)’s complement, methods will be discussed in due course., , Borrow , , (+1), , (+2), , (+2), , (+2), , (+2), , 1, , 0, , 0, , 0, , 1, , 0, , 0, , 1, , (+1), , (+1), , (+1), , 1, , 1, , End Borrow , 1, 1, End Carry has to be ignored., , 1, , Complement of a Number:, In digital work, two types of complements of a binary number are used for complemental subtraction:, 1’s Complement:, The 1’s complement of a binary number is obtained its each 0 into 1 and each 1 into 0. It is, also called radix-minus-one complement., E.g. 1’s complement of (100) 2 is (011) 2 ., 2’s Complement:, The 2’complement of a binary number is obtained by adding 1 to its 1’s complement., 2’ Complement = 1’ complement + 1, 1’S AND 2’S COMPLEMENT ARITHMETIC, Digital circuits perform binary arithmetic operations. It is possible to use the circuits, designed for binary addition to perform binary subtraction. Only we have to change the problem of, subtraction into an equivalent addition problem. This can be done if we make use of 1’s and 2’s, complement form of the binary numbers as we have already discussed., Subtraction Using 1’s Complement, Binary subtraction can be performed by adding the 1’s complement of the subtrahend to the, minuend. If a carry is generated, remove the carry, add it to the result. This carry is called the endaround carry. Now if the subtrahend is larger than the minuend, then no carry is generated., The answer obtained is 1’s complement of the true result and opposite in sign., , Example: Subtract 10012 from 11012 using the 1’s complement method. Also subtract using the, direct method and compare., Solution:, , 1’s complement method, , Direct subtraction, (-), , 1, 1, 0, , 1, 0, 1, , 0, 0, 0, , 1, 1, 0, , 1’s complement method , Carry , Add carry , , 1, , 1, 0, 0, , 1, 1, 0, , 0, 1, 1, , 1, 0, 1, 1, , 0, , 1, , 0, , 0, , (+)
Page 12 :
BEEE, , Example: Subtract 1100 2 from 10012 using the 1’s complement method. Also subtract using the, direct method and compare., Solution:, , 1’s complement method, , Direct subtraction, (-), , Carry , 2’s complement, True result, , 1, , 1, 1, 1, 0, , 0, 1, 1, 0, , 0, 0, 0, 1, , 1, 0, 1, 1, , 0, , 0, , 1, , 1, , 1’s complement , , 1, 0, 1, 0, , 0, 0, 1, 0, , 0, 1, 0, 1, , 1, 1, 0, 1, , True result, , 0, , 0, , 1, , 1, , 1’s complement , , (+), , In the direct method, whenever a larger number is subtracted from a smaller number, the, result obtained is in 2’s complement form and opposite in sign. To get the true result we have to, discard the carry and make the 2’s complement of the result obtained and put a negative sign before, the result., In the 1’s complement subtraction, no carry is obtained and the result obtained is in 1’s, complement form. To get the true result we have to make the 1’s complement of the result obtained, and put a negative sign before the result., Steps for 1’ complement Subtraction:, 1), 2), 3), 4), , Find the 1’ complement of the subtrahend by changing all its 1’s to 0’s and all its 0’s to 1’s., Add this complement to the minuend., Perform the end-around carry of the last 1 or 0., If there is no end-around carry (i.e. o carry), then the answer must be recomplemented and a, –ve sign attached to it., 5) If the end-around carry is 1, no recomplementing is necessary., Steps for 2’ complement Subtraction:, 1), 2), 3), 4), 5), , Find the 2’ complement of the subtrahend., Add this complement to the minuend., Drop the final carry., If the carry is 1, the answer is positive and needs no recomplementing., If there is no carry, recomplement the answer and attach minus sign., , Subtraction Using 2’s Complement, Binary subtraction can be performed by adding the 2’s complement of the subtrahend to the, minuend. If a carry is generated, discard the carry. Now if the subtrahend is larger than the, minuend, then no carry is generated. The answer obtained is in 2’s complement and is negative. To, get a true answer take the 2’s complement of the number and change the sign. The advantage of the, 2’s complement method is that the end-around carry operation present in the 1’s complement, method is not present here., , Example: Subtract 0111 2 from 11012 using the 2’s complement method. Also subtract using the, direct method and compare., Solution:, , Direct subtraction, , 1’s complement method
Page 13 :
BEEE, , (-), , 1, 0, 0, , 1, 1, 1, , 0, 1, 1, , 1, 1, 0, , 2’s complement , Carry, , (Result) Discard Carry , , 1, , 1, 1, 0, 0, , 1, 0, 1, 1, , 0, 0, 1, 1, , 1, 1, 0, 0, , (+), , Example: Subtract 1010 2 from 10012 using the 1’s complement method. Also subtract using the, direct method and compare., Solution:, , 1’s complement method, , Direct subtraction, , 1 0 0 1, 1 0, 0 1 (+), (-), 1 0 1 0, 2’s complement , 0 1, 1 0, Carry, 1 1 1 1 1, 1 1, 1 1, 2’s complement , 0 0 0 1, 2’s complement , 0 0, 0 1, True Result, - 0 0 0 1, True Result, - 0 0, 0 1, In the direct method, whenever a larger number is subtracted from a smaller number, the, result obtained is in 2’s complement form and opposite in sign. To get the true result we have to, discard the carry and make the 2’s complement of the result obtained and put a negative sign before, the result. In the 2’s complement subtraction, no carry is obtained and the result obtained is in 2’s, complement form. To get the true result we have to make the 2’s complement of the result obtained, and put a negative sign before the result., Comparison between 1’s and 2’s Complements:, A comparison between 1’s and 2’s complements reveals the advantages and disadvantages of, each., (i) The 1’s complement has the advantage of being easier to implement by digital components, (viz. inverter) since the only thing to be done is to change the 1s to 0s and vice versa. To, implement 2’s complement we can follow two ways: (1) by finding out the 1’s complement, of the number and then adding 1 to the LSB of the 1’s complement, and (2) by leaving all, leading 0s in the LSB positions and the first 1 unchanged, and only then changing all 1’s to, 0s and vice versa., (ii) During subtraction of two numbers by a complement method, the 2’s complement is, advantageous since only one arithmetic addition is required. The 1’s complement requires, two arithmetic additions when an end-around carry occurs., (iii) The 1’s complement has an additional disadvantage of having two arithmetic zeros: one, with all 0s and one with all 1s. The 2’s complement has only one arithmetic zero. The fact, is illustrated below:, We consider the subtraction of two equal binary numbers 1010 – 1010., Using 1’s complement: 1010 – 1010, (+), (+), , 1, 0, 1, , 0, 1, 1, , 1, 0, 1, , 0, 1, 1, , (1’s Complement of 1010), , We complement again to obtain (-0000) (positive zero)., Using 2’s complement:, 1, , 0, , 1, , 0
Page 14 :
BEEE, , (+), , 0, 0, , 1, 0, , 1, 0, , 0, 0, , (2’s Complement of 1010), , In this 2’s complement method no question of negative or positive zero arises., Logical Operations:, The three basic logical operations are:, AND, , OR, , NOT, , AND is denoted by a dot ( )., OR is denoted by a plus (+)., NOT is denoted by an overbar ( ¯ ), a single quote mark (') after, or (~) before the variable., Logic Gates:, A computer circuit with several inputs but only one output that can be activated by particular, combinations of inputs. A logic gate is an elementary building block of a digital circuit. Most logic, gates have two inputs and one output. The complex logic gates are XOR (exclusive-OR), NAND, (NOT-AND), NOR (NOT-OR), and XNOR (exclusive-NOR)., , Logic Gates, , Basic Gates, , Universal Gates, , AND gate, OR gate, NOT gate, EX-OR, , , , , , , , , , NAND gate, NOR gate, , Universal Gates:, , , , , Universal gates are the ones which can be used for implementing any gate like AND, OR and, NOT, or any combination of these basic gates;, NAND and NOR gates are universal gates., But there are some rules that need to be followed when implementing NAND or NOR based, gates., , Truth Tables:, A truth table provides a complete enumeration of the inputs and the corresponding output, for a function. A truth table is a mathematical table used in logic., Following table shows the logic gates with symbol, logical equation, inputs and output., , , Sr., , Inputs = A & B, , Logic Gates, , , , Symbol, , Output = Y, , Logical Equation/, , Truth Table
Page 15 :
BEEE, , No., 1, , 2, , 3, , 4, , 5, , Boolean expression, Buffer, , NOT, (Inverter), , AND, , OR, , NAND, (NOT-AND), , I/O, , O/P, , A, , Y, , 0, , 0, , 1, , 1, , A, , Y, , 0, , 1, , 1, , 0, , Y=A, , Y= A, , Y=A B, , Y=A+B, , Y = AB, , A, , B, , Y, , 0, , 0, , 0, , 0, , 1, , 0, , 1, , 0, , 0, , 1, , 1, , 1, , A, , B, , Y, , 0, , 0, , 0, , 0, , 1, , 1, , 1, , 0, , 1, , 1, , 1, , 1, , A, , B, , Y, , 0, , 0, , 1, , 0, , 1, , 1, , 1, , 0, , 1, , 1, , 1, , 0
Page 16 :
BEEE, , Sr., No., , 6, , 7, , 8, , Logic Gates, , Symbol, , Logical Equation/ Truth Table, Boolean expression, I/P, I/P, , NOR, (NOT-OR), , Y = AB, , XOR, (Exclusive OR), , Y= A B, = A B+A B, , XNOR, (Exclusive, NOR), , Y = AB, , NAND Gate Equivalent:, , =, Figure: Equivalent NAND gate and symbol, Nor Gate Equivalent:, , =, Figure: Equivalent NOR gate and symbol, Ex-OR Gate Equivalent Circuit:, , A, , B, , Y, , 0, , 0, , 1, , 0, , 1, , 0, , 1, , 0, , 0, , 1, , 1, , 0, , A, , B, , Y, , 0, , 0, , 0, , 0, , 1, , 1, , 1, , 0, , 1, , 1, , 1, , 0, , A, , B, , Y, , 0, , 0, , 1, , 0, , 1, , 0, , 1, , 0, , 0, , 1, , 1, , 1
Page 17 :
BEEE, , Figure: Equivalent Ex-OR gate, Ex-NOR Gate Equivalent Circuit:, , Figure: Equivalent Ex-NOR gate, Realization of basic gates using NAND gates:, AND Gate:, , Figure: Realization of AND gate using NAND, gate, , , , OR gate:, , Figure: Realization of OR gate using, NAND, , An OR gate can be replaced by, AND gate can be replaced by NAND gates, NAND gates as shown in the figure (The OR, as shown in the figure (The AND is replaced by a, gate is replaced by a NAND gate with all its, NAND gate with its output complemented by a, inputs complemented by NAND gate, NAND gate inverter)., inverters).
Page 18 :
BEEE, , , , NOT Gate:, , Figure: Realization of NOT gate using NAND gate, , Realization of basic gates using NOR gates:, , , AND gate:, , Figure: Realization of AND gate using NOR, , , , OR Gate:, , Figure: Realization of OR gate using NOR, , An AND gate can be replaced by NOR, An OR gate can be replaced by NOR, gates as shown in the figure (The AND gate is gates as shown in the figure (The OR is, replaced by a NOR gate with all its inputs replaced by a NOR gate with its output, complemented by NOR gate inverters), complemented by a NOR gate inverter), , , NOT Gate:, , Figure: Realization of NOT gate using NOR, gate, Ex-OR Function Realization using NAND gates:
Page 19 :
BEEE, , Figure: Realization of Ex-OR gate using NAND gates, Ex-NOR Function Realization using NAND gates:, , Figure: Realization of Ex-NOR gate using NAND gates, Boolean algebra:, A new kind of Algebra, , Values, Operators, , Regular Algebra, Integers, Real Numbers, Complex Numbers, +- /×√±, , Boolean Algebra, Zero (0), One (1), AND, OR, Complement, , What is Boolean algebra?, Binary logic deals with variables that have two discrete values: ‘1’ for TRUE and ‘0’ for, FALSE., A simple switching circuit containing active elements such as a diode and transistor can, demonstrate the binary logic, which can either be ON (switch closed) or OFF (switch open)., Electrical signals such as voltage and current exist in the digital system in either one of the, two recognized values, except during transition., The switching functions can be expressed with Boolean equations. Complex Boolean, equations can be simplified by a new kind of algebra, which is popularly called Switching, Algebra or Boolean Algebra,
Page 20 :
BEEE, , Boolean algebra was invented by George Boole in 1854., maps logical propositions to symbols, permits manipulation of logic statements using mathematics, Boolean addition is equivalent to the OR operation, , , Different Logical Operations:, , , , , Complement operation (‘ ΄ ’), Logical AND operation(‘ ’), Logical OR Operation (‘ + ’), , A two-valued Boolean algebra is defined on a set of 2 elements B= {0, 1} with 3 binary, operators OR (+), AND ( ) and NOT (‘ ΄ ’) as shown in following tables., A, 0, 0, 1, 1, , B, 0, 1, 0, 1, , A+B, 0, 1, 1, 1, , A, 0, 0, 1, 1, , B, 0, 1, 0, 1, , A B, 0, 0, 0, 1, , A, 0, 1, , A’, 1, 0, , Laws & Rules of Boolean algebra:, The basic laws of Boolean algebra:, a) The commutative laws, b) The associative laws, c) The distributive laws, a) Commutative Law:, The commutative law of addition for two variables is written as: A+B = B+A, , The commutative law of multiplication for two variables is written as: AB = BA, , b) Associative Law:, The associative law of addition for 3 variables is written as: A+(B+C) = (A+B)+C, , The associative law of multiplication for 3 variables is written as: A(BC) = (AB)C, , c) Distributive Law:, The distributive law is written for 3 variables as follows: A (B+C) = AB + AC
Page 21 :
BEEE, , d) Complementation Law:, 2) 0 = 1, , 1) A = A, 3) 1 = 0, Rules of Boolean algebra:, , 1., 2., 3., 4., 5., 6., 7., , A+0=A, A+1=1, A 0=0, A 1=A, A+A=A, A +A = 1, A A=A, , 8. A A = 0, 9. A = A, 10. A + AB = A, 11. A + A B = A + B, 12. (A+B) (A+C) = A+BC, , A, B or C can represent a single variable or a combination of variables., , Rule 1:, , A+0=A, , A variable ORed with 0 is always equal to the variable. If the input variable A is 1, the output, variable X is 1, which is equal to A. If A is 0, the output is 0, which is also equal to A. This rule is, illustrated in figure, where the lower input is fixed at 0., , Rule 2:, , A+1=1, , Rule 3:, , A.0=0
Page 22 :
BEEE, , Rule 4:, , A.1=A, , Rule 5:, , A+A=A, , Rule 6:, , A+A=1, , Rule 7:, , A.A=A, , Rule 8:, , A.A=0, , Rule 9:, , A= A
Page 23 :
BEEE, , A + AB = A, , Rule 10:, A + AB = A( 1 + B), =A.l, =A, , Factoring (distributive law), Rule 2: (1 + B) = 1, Rule 4: A . 1 = A, , A, , B, , AB, , A+AB, , 0, , 0, , 0, , 0, , 0, , 1, , 0, , 0, , 1, , 0, , 0, , 1, , 1, , 1, , 1, , 1, , Equal, A + AB = A + B, , Rule 11:, , This rule can be proved as follows:, A + AB = (A + AB) + AB, Rule 10: A = A + AB, = (AA + AB) + AB, Rule 7: A = AA, =AA +AB +AA +AB, Rule 8: adding AA = 0, = (A + A)(A + B), Factoring, = 1. (A + B), Rule 6: A + A = 1, =A + B, Rule 4: drop the 1, , A, , B, , AB, , A+ A B, , A+B, , 0, , 0, , 0, , 0, , 0, , 0, , 1, , 1, , 1, , 1, , 1, , 0, , 0, , 1, , 1, , 1, , 1, , 0, , 1, , 1, Equal
Page 24 :
BEEE, , (A + B) (A + C) = A + BC, , Rule 12:, , This rule can be proved as follows:, (A + B)(A + C) = AA + AC + AB + BC, = A + AC + AB + BC, = A( 1 + C) + AB + BC, = A. 1 + AB + BC, = A(1 + B) + BC, = A. 1 + BC, = A + BC, A, , B, , C, , 0, 0, 0, 0, 1, 1, 1, 1, , 0, 0, 1, 1, 0, 0, 1, 1, , 0, 1, 0, 1, 0, 1, 0, 1, , A+B A+C (A+B)(A+C), 0, 0, 1, 1, 1, 1, 1, 1, , 0, 1, 0, 1, 1, 1, 1, 1, , 0, 0, 0, 1, 1, 1, 1, 1, , Distributive law, Rule 7: AA = A, Rule 2: 1 + C = 1, Factoring (distributive law), Rule 2: 1 + B = 1, Rule 4: A . 1 = A, BC, 0, 0, 0, 1, 0, 0, 0, 1, , A+BC, 0, 0, 0, 1, 1, 1, 1, 1, , Equal, DeMorgan’s Theorems:, DeMorgan’s theorems provide mathematical verification of:, The equivalency of the NAND and negative-OR gates, The equivalency of the NOR and negative-AND gates., , Theorem 1:, , Theorem 2:, , The complement of sum of two or more, variables is equivalent to product of, complements of the individual variables., For two variables X and Y as shown below, , The complement of product is equal to sum of, complements. For two variables X and Y as, shown below.
Page 25 :
BEEE, , Boolean expression for logic circuit:, To derive the Boolean expression for a given logic circuit, begin at the left- most inputs and, work toward the final output, writing the expression for each gate. For the example circuit in Fig,, the Boolean expression is determined as follows:, The expression for the left-most AND gate with inputs C and D is CD., The output of the left-most AND gate is one of the inputs to the OR gate and B is the other, input. Therefore, the expression for the OR gate is B + CD., The output of the OR gate is one of the inputs to the right-most AND gate and A is the other, input., Therefore, the expression for this AND gate is A(B + CD), which is the final output, expression for the entire circuit., , SIMPLIFICATION OF LOGICAL EXPRESSIONS USING BOOLEAN ALGEBRA:, A simplified Boolean expression uses the fewest gates possible to implement a given, expression., Example:, Using Boolean algebra techniques, simplify this expression:, AB + A (B + C) + B (B + C)
Page 26 :
BEEE, , Solution:, Step 1: Apply the distributive law to the second and third terms in the expression, as follows:, AB + AB + AC + BB + BC, Step 2: Apply rule 7 (BB = B) to the fourth term., AB + AB + AC + B + BC, Step 3: Apply rule 5 (AB + AB = AB) to the first two terms., AB + AC + B + BC, Step 4: Apply rule 10 (B + BC = B) to the last two terms., , Figure: Gate circuits for above example., Examples:, Simplify the Boolean expressions:, 1., 2., , A B A B C B B C , , AB C BD A BC, , 3. ABC AB C ABC ABC ABC, --------------------------------------------------------------------------------------------------------------------