Sie sind auf Seite 1von 12

Unit-4 Digital Electronics 1/12

Digital And Analog Signals:


Electronic circuits are classified into analog and digital circuits. Analog circuits are those in which voltages and currents vary continuously throughout some range. It means that the output of an analog circuit could vary through an infinite number of possible values within the range of its operation e.g. the output of 0 to 30V power supply can be adjusted to any one of values between 0V to 30V. Sine wave signal generators, power supplies, radio receivers TVs etc. are examples of analog instruments. Digital circuits are those in which the output voltage can have only two values or two states. The two states are called variously as ON or OFF, High or Low, True or False, 1 or 0. In practice the output of a digital circuit is either a high or low voltage and no other values of the output are allowed. The exact value of output voltage is not important if the voltage is distinguishable as low or high. The two states are generally denoted as 1 or 0. Hence the circuit is called circuits. Digital circuits are more accurate, efficient, fast, small in size and cheaper.

Number System:
A number system has its own set of symbols to represent any number (or countings) and own set of rules to manipulate these numbers. Examples of number system are Decimal number system, Binary number system, octal number system and Hexadecimal number system.

Decimal Number System:


We use decimal number system in every day work. There are ten digits 0 to 9 i.e. ten different independent symbols to represent any counting, hence base of decimal system is 10. Base or Redix of a number system is the number of different independent symbols used to express any counting, here it is 10. The following example will explain the base and value of the each digit of a decimal number. 1. 4598 = 4103 + 5102 + 9101 + 8100 The value of the 1st digit of the number from the right side = 1st digit 100 nd The value of the 2 digit of the number from the right side = 2nd digit 101 The value of the 3rd digit of the number from the right side = 3rd digit 102 th The value of the 4 digit of the number from the right side = 4th digit 103 -------------------------------------------------------------------------------------------The value of the nth digit of the number from the right side = nth digit (base)n-1 2. 216.23 2 1 6 . 2 3 Weights 2 1 0 -1 -2 Value 2102 + 1101 + 6100 + 210-1 +310-2

Binary Number System:


In binary number system we have only two independent symbols to represent any number therefore base of binary number system is 2. The two binary digits are 0 and 1 which are called bits. In binary number system zero is represented by 0 and one by 1 there is no digit for counting two or more, therefore combination of 0 and 1 is used to express these numbers giving different weights ot the digits. We write decimal 2 as 10, 3 as 11, 4 as 100, The following example illustrates the base and weights of each digit. 1. 1011 = 123 + 022 + 121 + 120 The value of the 1st digit of the number from the right side = 1st digit 20 The value of the 2nd digit of the number from the right side = 2nd digit 21 The value of the 3rd digit of the number from the right side = 3rd digit 22 th The value of the 4 digit of the number from the right side = 4th digit 23 -------------------------------------------------------------------------------------------The value of the nth digit of the number from the right side = nth digit (base)n-1

Unit-4 Digital Electronics 2/12 2. 110.01 1 1 0 . 0 1 Weights 2 1 0 -1 -2 Value 122 + 121 + 020 + 02-1 +12-2 = 7.25 Decimal Binary Octal Hex. Number Equivalent Equivalent Equivalent 0 0 0 0 1 1 1 1 2 10 2 2 3 11 3 3 4 100 4 4 5 101 5 5 6 110 6 6 7 111 7 7 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F 16 10000 200 10 Rules for Conversion from Decimal to Binary It will be more convenient if number is separated into an integer part and fractional part. Each part is converted separately. Steps to convert decimal to binary: A. Integer Part: 1. Divide the integer part of the number with 2. Note down the quotient and remainder. 2. The quotient obtained in above step is again divided by 2 to give new quotient and remainder. 3. Repeat step 2 till the integer quotient becomes zero. 4. Note down the remainder in opposite order i.e. from bottom to top. B. Fractional Part: 1. The fractional part is multiplied by 2 which will give integer and fractional part. 2. Note down the integer part separately. 3. Multiply again the new fractional part obtained in above step with 2 which in turn gives integer and fractional part. 4. Repeat above procedure till the number of digits has sufficient accuracy. 5. Note down the integer part of each step in same order i.e. Top to Bottom. e.g. (41.6875)10 = ( ? )2 A. Integer Part = 41 2 2 2 2 2 2 41 20 10 5 2 1 0 Remainder 1 0 0 1 0 1

Unit-4 Digital Electronics 3/12 (41)10 = (101001 )2 B. Fractional Part = 0.6875 0.6875 2 0.3750 2 0.7500 2 0.5000 2 = = = = Integer Part 1.3750 1 0.7500 0 1.5000 1 1.0000 1 (0.6875)10 = (0.1011 )2

Thus (41.6875)10 = (101001.1011 )2 Rules for Conversion from Decimal to Octal Same as above except use 8 in place of 2. Steps to convert decimal to Octal: C. Integer Part: 1. Divide the integer part of the number with 8. Note down the quotient and remainder. 2. The quotient obtained in above step is again divided by 8 to give new quotient and remainder. 3. Repeat step 2 till the integer quotient becomes zero. 4. Note down the remainder in opposite order i.e. from bottom to top. D. Fractional Part: 1. The fractional part is multiplied by 8 which will give integer and fractional part. 2. Note down the integer part separately. 3. Multiply again the new fractional part obtained in above step with 8 which in turn gives integer and fractional part. 4. Repeat above procedure till the number of digits has sufficient accuracy. 5. Note down the integer part of each step in same order i.e. Top to Bottom. e.g. (1526.632)10 = ( ? )8 A. Integer Part = 1526 8 8 8 8 1526 190 23 2 0 Remainder 6 6 7 2 (1526)10 = (2766 )8 B. Fractional Part = 0.632 0.632 8 = 0.056 8 = 0.448 8 = 0.584 8 = 0.672 8 = 0.376 8 = Thus (1526.632)10 = ( 2766.503453 )8 Rules for Conversion from Decimal to Hexadecimal Same as above except use 16 in place of 8. Steps to convert decimal to Hexadecimal: E. Integer Part: Integer Part 5.056 5 0.448 0 3.584 3 4.672 4 5.376 5 3.008 3 (0.632)10 = (0.503453 )8

Unit-4 Digital Electronics 4/12 1. Divide the integer part of the number with 16. Note down the quotient and remainder, If the remainder is between 10 to 15, write corresponding alphabets such as A for 10, B for 11 F for 15. 2. The quotient obtained in above step is again divided by 16 to give new quotient and remainder. 3. Repeat step 2 till the integer quotient becomes zero. 4. Note down the remainder in opposite order i.e. from bottom to top. F. Fractional Part: 1. The fractional part is multiplied by 16 which will give integer and fractional part. 2. Note down the integer part separately. If this is between 10 to 15, write corresponding alphabets such as A for 10, B for 11 F for 15. 3. Multiply again the new fractional part obtained in above step with 16 which in turn gives integer and fractional part. 4. Repeat above procedure till the number of digits has sufficient accuracy. 5. Note down the integer part of each step in same order i.e. Top to Bottom. e.g. (1526.632)10 = ( ? )16 A. Integer Part = 1526 16 1526 16 95 16 5 0 Remainder 6 F 5 (1526)10 = (5F6 )16 B. Fractional Part = 0.632 0.632 16 = 0.112 16 = 0.792 16 = 0.672 16 = 0.752 16 = Thus (1526.632)10 = ( 5F6.A1CAC )16 Rules for Conversion from Binary to Decimal To convert a binary number to decimal: 1. Weights are given (Counting is done) from the decimal point. Towards right side of decimal each digit is assigned a number in increasing order starting from zero, similarly towards left of decimal point each digit is assigned a number starting with (-1). 2. Multiply each digit with 2 having power the weight of corresponding digits. 3. Add all the numbers obtained in step 2. e.g. to convert (101001.101)2 to decimal Binary No. Weights 1 5 125 =32 0 4 024 =0 1 3 123 =8 0 2 022 =0 0 1 021 =0 1 0 120 =1 .
Decimal Point

Integer Part 10.112 A 1.792 1 12.672 C 10.752 A 12.032 C (0.632)10 = (0.A1CAC )16

Step-I Step-II

1 -1 12-1 =0.5

0 -2 02-2 =0

1 -3 12-3 =0.125

Unit-4 Digital Electronics 5/12 Step-III 32+0+8+0+0+1+0.5+0+0.125 = 41.625 Thus (101001.101)2 = (41.625)10 SIMILARLY 1. FOR OCTAL TO DECIMAL: USE 8 IN PLACE OF 2 IN STEP-II. 2. FOR HEXADECIMAL TO DECIMAL: USE 16 IN PLACE OF 2 IN STEP-II and write corresponding digits in place of alphabets such as 10 for A 15 for F. Rules for Conversion from Binary to Octal To convert a binary number to octal decimal system: 1. Make groups of 3-bits, starting from decimal point in both directions (integral part and fractional part both). 2. Each group is replaced by its octal equivalent. e.g. (10110101.01101)2 = (?)8 Whole part can be partitioned into three 3-bits group by adding one zero bit to its left. Similarly fractional part can be partitioned into two 3-bits group by adding one zero bit to its right. 0 Now 2 6 5 . 3 2 1 0 1 1 0 1 0 1 . 0 1 1 0 1 0

Therefore (10110101.01101)2 = (265.32)8 Rules for Conversion from Binary to Hexadecimal To convert a binary number to hexadecimal system: 3. Make groups of 4-bits, starting from decimal point in both directions (integral part and fractional part both). 4. Each group is replaced by its hexadecimal equivalent. e.g. (110101.01101)2 = (?)16 Whole part can be partitioned into two 4-bits group by adding two zero bit to its left. Similarly fractional part can be partitioned into two 4-bits group by adding three zero bit to its right. 0 Now 3 5 . 6 8 0 1 1 0 1 0 1 . 0 1 1 0 1 0 0 0

Therefore (110101.01101)2 = (35.68)16 Rules for Conversion from Hexadecimal/Octal number to Binary numbers: To convert a hexadecimal number into binary write each digit in its 4-bit binary equivalent form. Similarly to convert an octal number into binary write each digit in its 3-bit binary equivalent form. e.g. Hexadecimal to Binary (35.68)16 = (?)2 3 5 . 6 8

Unit-4 Digital Electronics 6/12 0011 0101 . 0110 (35.68)16 = (110101.01101)2 e.g. Octal to Binary (265.32)16 = (?)2 2 6 5 . 1000 3 2

010 110 101 . 011 010 (265.32)8 = (10110101.01101)2 1s Complement of a binary number: The 1s complement of a binary number is obtained by subtracting each bit of the number from 1. In other words replace the bit 1 with 0 and 0 with 1 of the number to get its 1s complement. e.g. 1s complement of 100110 = 011001 1s complement of 000000 = 111111 1s complement of 111111 = 000000 2s Complement of a binary number: The 2s complement of a binary number is obtained by adding 1 to the 1s complement of that number. e.g. 2s complement of 100110 = 1s complement of 100110 + 1 = 011001 + 1 = 011010 2s complement of 000000 = (111111+1) =1000000 2s complement of 111111 = (000000+1) = 000001 Application of 2s Complement: In binary number system negative of a number is nothing but its 2s complement. e.g. consider a binary number 1001 2s complement of 1001 = 1s complement of 1001 + 1 = 0110 + 1 = 0111 Now adding 1001 with its 2s complement i.e. 1001 + 0111 1 0000 carry If sum it considered upto 4 bits the last carry is lost and the answer we get is 0000. i.e. if we add 1001 with its 2s complement we get 0 (leaving the last carry) hence 2s complement of 1001 is equivalent to negative of 1001 i.e. (-1001). Therefore a numbers 2s complement is equivalent to it negative. 2s complement of 1001 = -1001 2s complement of 1101 = -1101 Question: Represent (-12)10 in binary form. Answer: (12)10 = (1100)2 2s complement of 1100 =1s complement of 1100+1 =0011+1 = 0100 thus (-12)10 = 2s complement of 1100 = (0100)2

Subtraction using 1s & 2s complement


Binary Subtraction using 1s complement: In binary number system subtraction of second number with first is equivalent to addition of 1s complement of second number with first number. Steps: 1. Number of bits of first and second operand must be same. 2. Find the 1s complement of second operand. 3. Add the first number with 1s complement of second number. 4. Answer is-

Unit-4 Digital Electronics 7/12 a. If there is end carry, remove it and add 1 to the least significant digit.(End-around carry). b. If there is no end carry then the answer is negative and it is in 1s complement form. To get the answer take 1s complement of the number obtained in step2 and put a negative sign at the front. e.g. Evaluate 11001 110 by 1s complement method: 1. Matching the bits, second operand = 00110 2. 1s complement of 00110 = 11001 3. adding first no. and 1s complement of second number 11001 + 11001 end carry 1 10010 4. . 1 10011 Thus 11001-110 = 10011 25-6=19 Evaluate 110 11001 by 1s complement method: 1. Matching the bits, Second operand = 11001 2. 1s complement of 11001 = 00110 3. Adding first no. and 1s complement of second number 00110 + 00110 no end carry 1 01100 5. Since there is no end carry there fore answer = (1s complement of 01100) = 10011 Binary Subtraction using 2s complement: In binary number system subtraction of second number with first is equivalent to addition of 2s complement of second number with first number. Steps: 1. Number of bits of first and second operand must be same. 2. Find the 2s complement of second operand. 3. Add the first number with 2s complement of second number. 4. Answer isc. If there is end carry, it is ignored and the remaining part is the answer. d. If there is no end carry then the answer is negative and it is in 2s complement form. To get the answer take 2s complement of the number obtained in step2 and put a negative sign at the front. e.g. Evaluate 11001 110 by 2s complement method: 1. Matching the bits, second operand = 00110 2. 2s complement of 00110 = 1s complement of 00110 +1 = 11001+1 = 11010 3. adding first no. and 2s complement of second number 11001 + 11010 end carry ignored 1 10011 4. . Answer 10011 Thus 11001-110 = 10011 25-6=19 Evaluate 110 11001 by 2s complement method: 1. Matching the bits, Second operand = 11001 2. 2s complement of 11001 = 1s complement of 11001+1 = 00110+1

Unit-4 Digital Electronics 8/12 = 00111 3. Adding first no. and 2s complement of second number 00110 + 00111 no end carry 1 01101 6. Since there is no end carry there fore answer = (2s complement of 01101) = (1s complement of 01101 +1) = (10010 +1) = (10011) Assignment: 1. Do as directed: i) Convert 30010 in to binary. ii). Convert 10358 into decimal. iii) Add 1001012 and 11011112. iv). Divide E03B16 by 8916 2. Do as directed: i) Multiply 3FF16 FF16 3. Do as directed. 1. Convert 2456.04410 into its hexadecimal equivalent. 2. Multiply 3AF16 and FAC16 4. Convert the decimal no. 250.5 to base 2, 8, 16. 5. Convert the following decimal to binary 12.0625, 104, 673.23, 1998, 22.8 6. Convert following binary to decimal 10.10001, 101110.0101, 1110101.110, 1101101.111, 11001.01101 7. Perform the subtraction with the following binary numbers using a. 2's complement and b. 1's complement method, check your answer by straight subtraction i. 11010-1101 ii. 1001010011 iii. 11010-10000 iv. 100-110000 8. Divide A9CDB.2F by 97B, 3ABH by FH 9. Express (-18) in 2's complement form. 10. Multiply 438768 ,Divide 25368 by 538, Add B2CE516+AB2C16, Multiply 3AF16 with FAC16, perform 45078+3568+26348 11. Divide 11001 by 100 12. Add B2CE516 and AB2C16

Unit-4 Digital Electronics 9/12 Logic Gates A logic gate is a digital circuit with one or more input signals but only one output signal and it has ability to make logical decisions depending upon the combination of input signals regardless the existing output state. Logic functions can be described in terms of algebraic statements with designation 1 or 0. Here 1 represents high state and 0 the low state. Fundamental Logic Gates: Fundamental logic gates are the basic logic gates which are designed independently, and using fundamental logic gates other logic gates are derived. The three fundamental logic gates are AND, OR and NOT gates. The AND gate An AND gate is a device whose output is at high state (i.e. 1) if and only if all its inputs are at high state. If any of the input is at low state (i.e. 0) the output is at low state. An AND gate may have two or more inputs but only one output. Input A Logic Symbol: Logic symbol of two input AND gate Output Y Logic Expression: Y = A.B Input B Truth Table: A 0 0 1 1 Equivalent Electrical Circuit: Two switches in series A B C B D2 D Y B 0 1 0 1 Y = A.B 0 0 0 1 Diode Circuit: A D1

Working of Diode Circuit: 1. When A=0, B=0 i.e. both connected to earth, D1 & D2 diodes get forward biased and conduct. The diodes being ideal no voltage drop takes place across the diodes. A voltage drop of 5V takes place across R with C at zero potential with respect to earth. Thus output Y=0. 2. When A=0, B=1 i.e. if B is connected to the terminal of 5V battery, then diode D1 will conduct & D2 will not. Since D1 is ideal no voltage drop takes place across D1. A voltage drop of 5V takes place across R with C=0 volt with respect to earth. The output Y=0. 3. When A=1, B=0 i.e. if A is connected to the terminal of 5V battery, then diode D2 will conduct & D1 will not. Since D2 is ideal no voltage drop takes place across D2. A voltage drop of 5V takes place across R with C=0 volt with respect to earth. The output Y=0. 4. When A=1, B=1 then none of the diode will conduct. There will be no current through R. Now potential at C is equal to potential at D = 5V with respect to earth. Hence Y = 1. The OR gate An OR gate is a device whose output is at high state (i.e. 1) if at least one of its input is at high state. The output is at low (0) state only when all the inputs are at low (0) state. An OR gate may have two or more inputs but only one output. Input A Logic Symbol: Logic symbol of two input OR gate Output Y Input B

Unit-4 Digital Electronics 10/12 Logic Expression: Truth Table: A 0 0 1 1 Equivalent Electrical Circuit: Two parallel switches A B B 0 1 0 1 Y = A+B 0 1 1 1 Diode Circuit: A B D1 C D2 D Y Y = A+B

Working of Diode Circuit: 1. When A=0, B=0 i.e. both connected to earth, D1 & D2 diodes wont conduct and therefore no voltage develops across R, voltage at C is zero with respect to earth. Hence output Y=0. 2. When A=0, B=1 i.e. B is connected to the terminal of 5V battery then diode D2 being in forward bias conducts while D1 do not. Since D2 is ideal no voltage drop takes place across D2. A voltage drop of 5V takes place across R with C=+5V with respect to earth. The output Y=1. 3. When A=1, B=0 i.e. A is connected to the terminal of 5V battery then diode D1 being in forward bias conducts while D2 do not. Since D1 is ideal no voltage drop takes place across D1. A voltage drop of 5V takes place across R with C=+5V with respect to earth. The output Y=1. 4. When A=1, B=1 then both diodes conducts. A voltage drop of 5V takes place across R with c=+5V with respect to earth. The output Y=1. The NOT gate An NOT gate or inverter is a device with only one input and one output. The output is at high state (i.e. 1) if input is at low state (0) state, and the output is at low state if the input is at high state. Input A Output Y Logic Symbol: Logic symbol of NOT gate Logic Expression: Y= Truth Table: A 0 1 Equivalent Electrical Circuit: A A Y= 1 0 Transistor Circuit: Rb C E Y

Unit-4 Digital Electronics 11/12 Working of Transistor Circuit: 1. When A=0, the base of the transistor is earth. Base-Emitter junction is not forward biased, but Base-Collector junction is reversed biased. As IE & IB are zero, therefore IC=0. Now the transistor will be in cut-off mode and voltage at C will be +5V with respect to earth due to battery at collector circuit. Hence output Y=1. 2. When A=1, the Base-Emitter junction gets forward biased & there will be IE, IB & IC. Rb & Rc are so adjusted that a large collector current flows. The transistor is now in a saturation state. Voltage drop across Rc=5V due to forward biasing of emitter. Which is equal & opposite to the potential drop across Rc due to battery in collector circuit. Hence voltage at C is at Zero volt and output Y=0. The Universal Gates: NAND & NOR gates NAND & NOR gates are considered as universal logic gate because we can perform functions of basic OR, AND & NOT gates and we can design any logic circuit using NAND/NOR gate only. NAND gate: The gate is a combination of AND gate and NOT gate. The gate performs the logic as an AND gate followed by an inverter. Which means the output of NAND gate is opposite to AND gate. The output of NAND gate is at high state (1) if at least one of its input is at low state (0). Logic Symbol of NAND gate: A B B Logic Expression: Truth Table: Electrical Circuit of NAND gate:

Y = A.B
A 0 0 1 1 B 0 1 0 1 A

Y = A.B
1 1 1 0

NAND gate as NOT gate

Y = A. A = A

NAND as AND gate

A B

A.B

Y = A.B = A.B

( )

NAND as AND gate A


A
B

Y = A.B = A + B

Unit-4 Digital Electronics 12/12 NOR gate: The gate is a combination of OR gate and NOT gate. The gate performs the logic as an OR gate followed by an inverter. Which means the output of NOR gate is opposite to OR gate. The output of NOR gate is at low state (0) if at least one of its input is at high state (1). Logic Symbol of NOR gate: A B Electrical Circuit of NOR gate:

Logic Expression: Truth Table:

Y = A+ B
A 0 0 1 1 B 0 1 0 1 A

Y = A+ B
1 0 0 0

NOR gate as NOT gate

Y = A + A= A

NOR as OR gate

A B

A+ B

Y = A+ B = A+ B

NOR as AND gate A


A

Y = A + B = A.B

Das könnte Ihnen auch gefallen