Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this document? Why not share!

- Digital Electronics by Vodafone Albania 874 views
- Intro_Programmation_Informatique by Emeric Tapachès 531 views
- Algorithmic Forex Trading by InvestingTips 423 views
- JASPARD, M. LOGIC un service GeoWe... by IT-Gatineau2011 1268 views
- Combinators - Lightning Talk by Mike Harris 92 views
- Bca i sem de lab by Adisesha k 6737 views

2,412 views

Published on

No Downloads

Total views

2,412

On SlideShare

0

From Embeds

0

Number of Embeds

2

Shares

0

Downloads

115

Comments

0

Likes

1

No embeds

No notes for slide

- 1. Courses In Electrical Engineering Volume II LESSONS IN DIGITAL ELECTRONICS By Jean-Paul NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 1
- 2. FOREWORD The need of pedagogical resources in the domain of the teaching ofEngineering Sciences is a great challenge in Cameroon. Many efforts have beenmade through the contribution of teachers, and also through the policy of promotionof technical education led by the government. However, much work is still to be donein order to build a real culture of Engineering in our country. This document is acontribution for the achievement of that goal. The course in digital electronics presented in this document is made up of ninechapters prepared following the official program in digital circuits of class six F3 andF2 series in Cameroon. However some extra material is added in order to open themind of students to the world of digital electronics and computer science. This courseis being taught by me (Mr. NGOUNE Jean-Paul) in the Government Technical HighSchool, KUMBO, Republic of Cameroon. Some amelioration may be brought to italong the years, according to the suggestions of readers and users of this course. ‘Courses In Electrical Engineering’ is a series of courses in various subjectsof electronics and electrotechnics. This is the volume II of the series; the volume Itreating the matter of the Analysis of electrical circuits (Class five F3 and F2 syllabus)is to be published very soon. This course and many other pedagogical documentsproduced by me are available and freely downloadable at the following address:www.scibd.com/jngoune. Jean-Paul NGOUNE (12 Sep. 11, 03:45).Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 2
- 3. CONTENTSTopic PageChapter One: Numeration systems and codes 4Chapter Two: Logic gates 25Chapter Three: Boolean algebra 44Chapter Four: Karnaugh mapping 58Chapter Five: Digital arithmetic 69Chapter Six: Combinatory logic 82Chapter Seven: Multivibrators 111Chapter Eight: Counters 133Chapter Nine: Digital storage 148About the Author 158Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 3
- 4. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER ONE: NUMERATION SYSTEMS AND CODES By J-P. NGOUNE DIPET I ( Electrotechnics), DIPET II (Electrotechnics) DEA ( Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 4
- 5. Chapter One NUMERATION SYSTEMS AND CODES1.0 Specific objectives: At the end of this chapter, the student will be able to: - know binary, hexadecimal and octal numeration systems; - Know Gray, BCD and ASCII codes; - Master the principle of conversion from each numeration system to another.1.1 Introduction: Numbers are used to express quantities. There are many numerationssystems used in the field of digital electronics, one of the most important being thebinary system of numeration on which is based the computer science. Each of thevarious numerations systems and codes has its advantages but also inconvenient.The aim of this chapter is to present and explain the most common numerationsystems and codes used in the conception of digital circuits.1.2 Digital versus Analogue representation: There are two basic ways we can represent quantities: Analoguerepresentation and digital representation. With analogue representation, the quantityis symbolised in a way that is infinitely divisible. With digital representation, thequantity is symbolised in a way that is discretely packaged.Example 1.1: • The height of the red column which indicates the temperature measured by a thermometer is an analogue representation. • An electronic watch whose digits changes second after second, minute after minute, shows a digital representation.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 5
- 6. The comparison between digital and analogue representations can be given as in thefollowing chart: Analogue representation Digital representation Infinitely divisible Discrete (Step by step) Prone to errors of precision Absolute precision1.3 Systems of numeration: To represent quantities in the different systems of numeration, specificsymbols are used, which are also called ciphers.1.3.1 Decimal numeration system: Decimal system is the most common numeration system for daily uses. It isconstituted by 10 symbols or ciphers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each cipherrepresents an integer quantity and each place from right to left in a decimal notationrepresents a weight for each integer quantity.Example 1.2: Let’s consider the decimal notation 1253. This number can be broken into itsconstituent weight-products as such:1253 = 1000 + 200 + 50 + 31253 = 1 × 1000 + 2 × 100 + 5 × 10 + 3 × 11253 = 1 × 103 + 2 × 10 2 + 5 × 101 + 3 × 100 We can easily notice that the cipher 1 is more weighted than the cipher 2which in his turn is more weighted than the cipher 5. The cipher 3 is the lessweighted. In the decimal numeration system, each cipher is called a digit. Each weight orplace value is ten that of the one to the immediate right. The less weighted ciphercarries the One place, the cipher at the immediate left carries the Tens place, thefollower carries the Hundreds place, thousands place, and so on…Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 6
- 7. 1.3.2 Binary numeration system: The binary numeration system uses only two ciphers instead of ten as thedecimal numeration system. Those two ciphers are “0” and “1”. In binary system ofnumeration, ciphers are called bit (Binary Digit). Cipher are arranged right to left indoubling values of weight ( instead of multiplying the weight by 10 as in the case ofdecimal system).Example 1.3:Let’s consider the following binary number Weights 543210A = 1 0 1 1 0 12 Base 2A = 1 × 25 + 0 × 2 4 + 1 × 23 + 1 × 2 2 + 0 × 21 + 1 × 20A = 32 + 0 + 8 + 4 + 1A = 4510 Each weight is 2 that of the one in the immediate right. The less weightedcipher carries the Ones place (20), the cipher at the immediate left carries the twosplace (21), the following cipher carries the fourth place (22)…Exercise 1.1:Convert the following binary numbers to decimal numbers:A = 110101 C = 11110111101B = 100110101 D = 101100001111Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 7
- 8. 1.3.3 Binary versus decimal numeration system: Let us count from 0 to 15 using binary and decimal systems of numeration Binary D(MSB) C B A(LSB) Decimal 0 0 0 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 10 1 0 1 1 11 1 1 0 0 12 1 1 0 1 13 1 1 1 0 14 1 1 1 1 15 It is obvious that the representation of a quantity in binary numeration systemtakes mores ciphers than in decimal system. We can therefore ask ourselves why thebinary system is preferred to decimal system in computer sciences. The reason isthat in electronics, it is easier to materialise two quantities-“0” and “1”-(by twodifferent voltages for example) than to materialises 10 different quantities – “0” ,”1”,”2”,”3”,”4”,”5”,”6”,”7”,”8”, and”9”- (by 10 different voltages). In fact, in digital circuits, 0and 1 are materialised by specific ranges of voltages or current; this will be discussedlater.Remark 1.1:With n bits we can represent 2 n different binary numbers. The higher H number isgiven using the following formula.H = 2n − 1 (1)Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 8
- 9. Example 1.4:With 4 bits we can represent 24 = 16 different binary numbers (from 0 to 15), and thehigher number is H = 24 – 1 = 15.Remark 1.2: Conversion from binary to decimal To convert a number written in binary numeration system to its equivalent indecimal, we just have to calculate the products of the bits with their respectiveweights, as in example 1.3 above. For binary numbers with “binary point” (equivalent of decimal point for decimalnumbers), the conversion is done as follow. 2 1 0 -1 -2 -3A = 1 0 1. 1 0 1A = 1 × 2 2 + 0 × 21 + 1 × 20 + 1 × 2 −1 + 0 × 2 −2 + 1 × 2 −3 1 0 1A = 4 + 0 +1+ 1 + 2+ 3 2 2 2A = 5.62510Exercise 1.2:Convert from binary to decimal:A = 10110.01 C = 11110111.1011B = 111.111 D = 10110101101.1111011.3.4 Octal numeration system: The octal numeration system is a place weighted system with a base of eight.Valid ciphers include the symbols “0”,”1”,”2”,”3”,”4”,”5”,”6”, andf”7”. To convert from binary to octal numeration system, we just have to divide thenumber into groups of binary numbers having 3 bits each. And each group of 3 bits isreplaced by its equivalent in octal.Example 1.5:Let’s convert the following binary numbers in octal:A = 10110101B = 11010111.01Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 9
- 10. A = 010 110 101 101101012 = 2658 2 6 58 The bits are grouped from the right to the left. A zero has been added to thetwo firs bits to form a group of 3 bits. That zero is called an implied zero.B = 011 010 111 . 010 11010111.012 = 327.28 3 2 7 . 28 Two implied zeros have been added to the number to form groups of 3 bits.1.3.5 Hexadecimal numeration system: The hexadecimal numeration system is a place weighted system with a baseof sixteen. Valid ciphers include the normal decimal symbols“0”,”1”,”2”,”3”,”4”,”5”,”6”,”7”;”8”;9” plus six alphabetical characters A, B, C, D, E, andF. The following table summarises the equivalence between decimal, binary, octaland hexadecimal systems. Decimal Binary Octal Hexadecimal 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 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 To convert from binary to hexadecimal numeration, we group bits in fours.Each group of four bit is replaced by its hexadecimal equivalent.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 10
- 11. Example 1.6:Convert the following binary numbers in hexadecimal.A = 1101011101B = 11101011101.11As explained above, we just have to group the binary number in groups of four bitseach:A =0011 0101 1101 11010111012 = 35D16 3 5 D16The binary number has been grouped is groups of four bits each, from the right to theleft two implied zeros have been added at the extreme left. In the same way thenumber B can also be converted.B =0111 0101 1101 . 1100 11101011101.112 = 75DC16 7 5 D C161.4 Changing of base: We have already seen in the previous section how to change from binary todecimal, octal or hexadecimal systems of numeration. The present section isintended to show how to move from a given system of numeration to any othersystem.1.4.1 From octal and hexadecimal to binary and decimal: The octal and hexadecimal systems are actually used by computer engineerjust to obtain a “shorthand” representation of binary numbers (because octal andhexadecimal representations take a few numbers of ciphers or symbols as comparedto binary system). It should therefore be understood that only binary system isimplemented in the electronic circuits of digital systems (through two levels ofvoltages or currents: high (1) and low (0)), the others systems being used byengineers just for simplification issues. However, we sometimes have the need to convert either of those systems tobinary or decimal forms.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 11
- 12. 1.4.1.1 Octal and hexadecimal to binary: It is obvious that, to convert from octal to binary, we just have to convert eachoctal cipher to its binary equivalent in 3 bits. In the same way, to convert fromhexadecimal to binary, we should convert each hexadecimal symbol into its binaryequivalent in 4 bits.Example 1.7:a) Convert the following octal number to digital 5238.b) Convert the following hexadecimal number to binary 4DC216.5238 = 101 010 0112 5238 = 1010100112 5 2 34DC216 = 0100 1101 1100 00102 4DC216 = 1001101110000102 4 D C 21.4.1.2 Octal to decimal: Because octal is a base of eight numeration system, each place weight valuediffers from either adjacent place by factor of eight.Example 1.8: Let us convert the following octal number to decimal: A = 264.748 2 1 0 -1 -2A = 2 6 4. 7 48A = 2 × 82 + 6 × 81 + 4 × 80 + 7 × 8−1 + 4 × 8−2 1 1A = 2 × 64 + 6 × 8 + 4 × 1 + 7 × + 4 × 8 64A = 180.937510Exercise 1.3:Convert the following octal number to decimal:A = 4562.368 C = 264.3658B = 523411.2328 D = 4516328Is the number 12586 an octal number?Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 12
- 13. 1.4.1.3 Hexadecimal to decimal: The technique for converting hexadecimal notation to decimal is the same asthe one used above, except that each successive place weight changes by a factorof sixteen.Example 1.9:Let us convert the following hexadecimal number to decimal: A = 34DF.AC216 3 2 1 0 -1-2-3A = 3 4 D F.A C 216A = 3 × 163 + 4 × 16 2 + 13 × 161 + 15 × 160 + 10 × 16 −1 + 12 × 16−2 + 2 × 16 −3A = 12288 + 1024 + 208 + 15 + 0.625 + 0.046875 + 0.000488281A = 13535.6723610Exercise 1.4:Convert from hexadecimal to decimal.X = A23C.DF16Y = 7D3E16Z = D96EC.FA161.4.2 Conversion from decimal numeration system to others systems: The conversion from decimal numeration system to others systems ofnumeration is an important task for everyone dealing with computer science, becauseit permits to move from daily world to digital world.1.4.2.1 General method: To convert a number from decimal numeration system to binary, octal orhexadecimal, we use repeated cycles of divisions to break the decimal numerationdown into multiples of binary, octal or hexadecimal place weight values. In the first cycle of division, we take the original decimal number and divide itby the base of the numeration system that we are converting to: It meant that forbinary, we should divide by 2, for octal we should divide by 8, for hexadecimal weshould divide by 16. Then we take the whole number portion of the division result anddivide it by the result again, and so on, until we end up with a quotient of less thanthe base value.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 13
- 14. 1.4.2.1 Decimal to binary conversion: Let us convert the decimal number 8710 to binary, using the principledescribed above. It meant that the decimal number should be repeatedly divided by2. 87 2 43 2 1 21 2 1 10 2 1 5 2 0 2 2 1 1 0 The coloured ciphers are the reminders of repeated division of the decimalnumber by 2. To obtain the binary number, we just have to take those reminders,beginning with the last one, as indicated by the arrow. Then we have:8710 = 10101112 In short, the binary bits are assembled from the reminders of the successivedivision steps, beginning with the LSB (Least Significant Bit) and proceeding to theMSB (Most significant Bit).Exercise 1.5:Convert the following decimal numbers to binaryA = 15310 C = 4610B = 25510 D = 38101.4.2.2 Conversion of decimal numbers less than 1 to binary: For converting a decimal number less than 1 to binary, we use repeatedmultiplication by 2, taking the integer portion of the product in each step as the nextdigit of our converted number. Let us convert the decimal number 0.37510 to binary: 0.375x2 = 0.75 Integer portion of the product = 0 0.75x2 = 1.5 Integer portion of the product = 1 0.5x2 = 1 Integer portion of the product = 1 (we stop when the product is a pure integer)Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 14
- 15. Each step gives us the next bit further away from the binary point, so thebinary number is obtained taking the bits from up to down.0.37510 = 0.0112Remark 1.3: With integer division, worked from the LSB to the MSB (down to up), but withrepeated multiplication, we worked from up to down.Exercise 1.6: Convert from decimal to binary:A = 0.812510 C = 0.87510B = 0.62510 D = 0.4062510Remark 1.4: To convert a decimal number greater than 1 with a less than 1 component, weshould use both techniques, one at time. Let us convert the decimal number 23.12510to binary.Step one: repeated division for the integer portion 2310. 23 2 11 2 1 5 2 1 2 2 1 1 0Partial answer:2310 = 101112Step two: repeated multiplication for the less than 1 portion 0.12510.0.125x2 = 0.25 Integer portion of the product = 00.25x2 = 0.5 Integer portion of the product = 00.5x2 = 1 Integer portion of the product = 1Partial answer:0.12510 = 0.0012Complete answer:101112 + 0.0012 = 10111.0012Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 15
- 16. Exercise 1.7: Convert from decimal to binaryA = 17.37510 C = 27.87510B = 43.62510 D = 49.40625101.4.2.3 Decimal to octal conversion: Let us convert the number 12310 from decimal to octal numeration system. Asexplained before, we just have to divide the decimal number successively by 8. 123 8 15 8 3 1 712310 = 1738 The octal digits are determined by the reminders left over by each divisionstep. These reminders are between 0 and 7.Exercise 1.7: Convert the following numbers from decimal to octal:A = 32310 C = 12810B = 45210 D = 99101.4.2.4 Decimal to hexadecimal conversion: Let us convert the number 45616 from decimal to hexadecimal. Thisconversion is obtained by repeated division of the decimal number by 16. 456 16 28 16 8 1 12 (C16)45616 = 1C816Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 16
- 17. Exercise 1.8:Convert from decimal to hexadecimal:A = 452310 C = 99710B = 86710 D = 1238101.5 Codes: A code is a system of letters, numbers or symbols that represent information.We have seen in previous sections that every decimal number can be converted inbinary; by so doing, we can say that we are achieving a pure binary codification.There are many codes used in computer science to facilitate the operation of certaindigital circuits. Some of those codes are: BCD code, Gray code, and alphanumericalcodes.1.5.1 Binary coded decimal (BCB) code: The BCD code of a decimal number is obtained by replacing each digit of thenumber by its equivalent in four bits, within the interval 0000 to 1001. Because of thefact that the maximal digit of the decimal numeration system is 9, the allowable codesgoes from 0 (0000) to 9 (1001). So, the BCD code does not use the codes 1010,1011, 1100, 1101, and 1111. Let us convert the number A = 45610 to BCD.A= 4 5 6 Decimal 0100 0101 0110 BCDA = 010001010110BCDExample 1.10:Convert the following BCD number in decimal: X = 0110100000111001. Can thefollowing series of bits be the BCD code of a decimal number? Y = 011111000001.X = 0110 1000 0011 1001 6 8 3 9X = 683910Y =0111 1100 0001 7 ? 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 17
- 18. The second group of bit (1100) is not allowable in the BCD code, so the number Ycannot be the BCD code of a decimal number.Exercise 1.9:Determine the equivalent BCD code of the following decimal numbers:A = 153610 C = 5698910B = 8975610 D = 23569810Determine if possible the decimal numbers corresponding to the following BCDnumbers:A = 100101110110B = 110111100111Remark 1.5: Difference between BCD code and binary number It is important to realise that the BCD code is not a numeration system asbinary, octal or hexadecimal numerations systems. In fact, it is just a decimal systemwhose digits have been replaced by their binary equivalent in four bits. On the otherhand it should be noticed that a BCD number is not a binary number. When we are toconvert a decimal number to binary, the whole number is taken into considerationmeanwhile to convert from decimal to BCD, each individual digit is replaced by itsbinary equivalent in four bits. For example, let us convert 1910 to binary and to BCD:3510 = 10001123510 = 0011 0101 (BCD). It is obvious that the conversion from binary to BCD takes more bits than theconversion from decimal to binary. So the BCD code is not as efficient as the binarysystem. The advantage of the BCD code is just the fact that it is very easy to convertfrom decimal to BCD and vice versa. The BCD code is found in digital systems using 7 segments displays likedigital voltmeters, digital watch…1.5.2 Gray code: The Gray code is a non weighted code in which each coded representationdiffers from the previous representation only by one bit. It is not the case for binarysystem where many bits can change when we move from a number to the followingDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 18
- 19. number. For example, when we move from 0111 (710) to 1000 (810), all the four bits ofthe representation are changed. The Gray code is not suitable for arithmeticalcalculations (because it is not weighted); it is used in the determination of outputsequations of digital circuits (Karnaugh mapping) and in the design of Analog – DigitalConverters. The following table gives us the equivalence between binary representationand Gray code. Decimal Binary Gray 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101 10 1010 1111 11 1011 1110 12 1100 1010 13 1101 1011 14 1110 1001 15 1111 1000Remark 1.6: How to generate a Gray sequence If you observe attentively the Gray sequence above, you will notice that: • For the first column of ciphers (coming from the right to the left), the first zero is followed by two ones, which are followed by two zeros, two ones, two zeros… • For the next column of ciphers you can notice that the two first zeros are followed by four ones, which are followed by four zeros, four ones…Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 19
- 20. • For the third column of ciphers, the four first zeros are followed by eight ones, which are followed by eight zeros, eight ones… This is the principle to be used in order to generate a Gray sequence.1.5.3 Alphanumerical codes A computer would have been useless if it wasn’t able to treat non numericalinformation. In fact, a computer should be able to recognize codes corresponding tonumbers, letters or some special characters. Such codes are called alphanumericalcodes. Generally the keyboard of a computer should contain the following symbols: • The 26 letters of the alphabet (capital and small letters); • The 10 ciphers of the decimal numeration system, • Almost 25 special characters like +, /,>, <, @, %... There are almost 87 characters and to represent those characters, we need atleast 7 bits because with 7 bit, we can have up to 27 = 128 different binary numbers.So, we use 87 of those binary numbers to codify the 87 characters. The most known alphanumerical code is called American Standard code forInformation Interchange (ASCII). This code is used by almost all the computerconstructors. The following table gives the ASCII code corresponding to some of thecharacters. Character ASCII code Octal Hexadecimal A 100 0001 101 41 B 100 0010 102 42 C 100 0011 103 43 D 100 0100 104 44 E 100 0101 105 45 F 100 0110 106 46 G 100 0111 107 47 H 100 1000 110 48 I 100 1001 J 100 1010 K 100 1011Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 20
- 21. L 100 1100 M 100 1101 N 100 1110 O 100 1111 P 101 0000 Q 101 0001 R 101 0010 S 101 0011 T 101 0100 U 101 0101 V 101 0110 W 101 0111 X 101 1000 Y 101 1001 Z 101 1010 0 011 0000 1 011 0001 2 011 0010 3 011 0011 4 011 0100 5 011 0101 6 011 0110 7 011 0111 8 011 1000 9 011 1001 Blank 010 0000 . 010 1110 ( 010 1000 + 010 1011 $ 010 0100 * 010 1010 ) 010 1001 - 010 1101Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 21
- 22. / 010 1111 , 010 1100 = 011 1101Exercise 1.10: • Give the octal and hexadecimal equivalent for all the ASCII codes given above. • The following instruction coded in ASCII is composed on the keyboard of a computer. Give its signification: 101 0011, 101 0100, 100 1111, 101 0000.Answer: Using the table above we find that the instruction is STOP.1.6 Conclusion This chapter has permitted us to study and to master (I hope so) the mostcommon numeration systems and codes. We have also studied methods ofconversion from each numeration system to another. In the next chapter, we willstudy the behaviour of logic gates, which can be considered as elementary ‘bricks’used in the construction of any digital circuit. REVIEW QUESTIONS 1. Give the difference between analogue and digital representations. 2. Convert from binary to decimal: A = 110112 D = 10010.0112 B = 10111012 E = 101001111112 C = 10111112 F = 1110111.00012 3. Convert from binary to octal: A = 111011.011012 D = 111011111012 B = 101101112 E = 10011101.1102 C = 11011110.01012 F = 100111101011112Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 22
- 23. 4. Convert from binary to hexadecimal. A = 1111010.11102 C = 111010111.112 B = 101111101111012 D = 10110110.1111012 5 Convert from octal to binary: A = 1238 C = 3578 B = 6538 D = 5478 6 Convert from hexadecimal to binary. X = F47B16 Z = 8CE016 Y = 5FD316 P = FFFC16 7 Convert from octal to decimal : A = 1258 C = 5638 B = 2568 D = 4538 8. Convert from hexadecimal to decimal: X = F47B16 Z = 8CE016 Y = 5FD.316 P = FFF.C16 9. Convert from decimal to binary: A = 2310 C = 5310 B = 25.37510 D = 101.2510 10. Convert from decimal to octal: A = 42310 C = 43810 B = 126410 D = 342310 11. Convert from decimal to hexadecimal: A = 126210 C = 256310 B = 356210 D = 56423610 12. Convert from octal to hexadecimal: A = 123.628 B = 432.58Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 23
- 24. 13 Determine the highest decimal number that can be represented using 8bits, 16 bits. 14 In most of the computers, the addresses of memory locations are expressed in hexadecimal. Those addresses are sequential numbers that identify each memory location. a) A computer can store data of 8 bits (1byte) in each of his memory location. If the addresses of the memory locations run from 000016 to FFFF16, then give the number of memory locations of that computer. Deduce the capacity of its memory. b) Another computer has 4096 memory locations. Give the interval of their addresses starting from 000016. 15 Determine the number of bits to be used to represent the decimal numbers from 00010 to 99910: a) using pure binary code b) using BCD code. 16 Express in ASCII the following instruction: “X = 25/Y” 17 Convert from BCD to binary: A = 01110100 (BCD).References: 1. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 2. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 24
- 25. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER TWO : LOGIC GATES By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 25
- 26. Chapter Two LOGIC GATES2.0 Specific objectives: At the end of this chapter, the student will be able to: - Understand the functioning of the logic gates; - Draw the truth table of simple logic circuits; - Know logic voltage levels for TTL and CMOS technologies; - Design a simple logic circuit using logic gates.2.1 Introduction: Logic gates are “elementary bricks” used in the construction of digital circuits.While the binary numeration system studied in the precedent chapter was aninteresting mathematical abstraction, we have not yet seen its practical application toelectronics. This chapter is devoted to practically apply the concept of binary digits tocircuits. A logic gate is a special type of circuit designed to accept (inputs) andgenerate (outputs) voltages signals corresponding to binary digits (1 and 0).2.2 Digital signals and gates: Let us consider the following circuit: Vcc 1 LED S R 0 Figure 2.1: Logic circuit.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 26
- 27. When the switch is connected to the ground (0V), the light emitting diode(LED) does not shine. If we were using this circuit to represent binary digits, wewould say that the input signal is a binary “0” and that the output is a binary “0” or thatthe output is at the low logic level. Moving the switch to the other position (Vcc), weapply a binary “1” to the input and receive a binary “1” at the output. The output isalso said to be at the high logic level. The gate shown by this simple circuit is a “buffer” or “yes” gate, because thelogic state of its input is identical to that of its output. Many types of gates are used indigital electronics: single input gates like the buffer and the NOT gates; multipleinputs gates like AND, NAND, OR, NOR, and XOR gates. The aim of this chapter isto study the functioning of each of those logic gates and also how they can becombined to design a simple logic function.2.3 The NOT gate: The NOT gate or Inverter is a logic gate which functions in such a way that thelogic state of the output is exactly the opposite of that of the input.Remark 2.1: The truth table A truth table is a standard way of representing the Inputs/outputs relationshipsof a digital circuit, listing all the possible input logic level combinations with theirrespective output logic levels. • The NOT gate truth table: Input Output 0 1 1 0 • SymbolInput OutputRemark 2.2: the buffer gate If we were to connect two inverter gates together so that the output of one fedinto the input of another, the two inversion functions would “cancel” each other out sothat there would be no inversion from input to final output.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 27
- 28. 1 0 0 Figure 2.2: Principle of the buffer gate A buffer is a special logic gate manufactured to perform the same function astwo inverters connected together. Buffer gates serve to amplify signals, taking a weaksignal source that is not capable of providing much current, and boosting the currentcapacity of the signal so as to be able to drive a load. • Symbol of a buffer gate:Input Output • Truth table of the buffer gate: Input Output 0 0 1 12.4 Multiple input gates: With a single input gate such as the inverter or buffer, there can only be twopossible input states: either 1 or 0. With multiple input gates, many possibilities areavailable for input states. The number of possible input states is equal to two to thepower of the number of inputs. So, if a gate has n inputs, therefore there are 2npossible input combinations.2.4.1 The AND gate: The output of the AND gate is high if and only if all inputs are high. If any inputis low, the output is guaranteed to be in a low state as well. • Truth table: Let us draw the truth table of a two inputs AND gate. A B A.B 0 0 0 0 1 0 1 0 0 1 1 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 28
- 29. As you can notice on the truth table above, the output is high only when all thetwo inputs are high. • SymbolA OutputBExercise 2.1: Draw the truth table of a three inputs AND gate.Exercise 2.2: Complete the chronogram of the output Q of a two inputs AND gate. A B t t Q t The following solution can be given for the exercise 2.2 above: A 1 0 B t 1 0 t Q 1 0 t2.4.2 The NAND gate: The word NAND is a verbal contraction of the words NOT and AND.Essentially, a NAND gate behaves the same as an AND gate with a not gateconnected to the output terminal. • SymbolA OutputBDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 29
- 30. • Truth table: Let us draw the truth table of a two inputs NAND gate. A B A.B 0 0 1 0 1 1 1 0 1 1 1 0 As with AND gates, NAND gates can be made with more than two inputs.Exercise 2.3: Complete the chronogram of the output Q of a two inputs NAND gate. A B t t Q t2.4.3 The OR gate: The output of the OR gate is high if any of the inputs is high. The output of anOR gate goes low if and only if all inputs are low. • Truth table: A B A+B 0 0 0 0 1 1 1 0 1 1 1 1 • Symbol:A OutputBDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 30
- 31. Exercise 2.4: Draw the truth table of a three inputs OR gate.Exercise 2.5: Complete the chronogram of the output Q of a two inputs OR gate. A B t t Q tExercise 2.6: Let us consider the following digital circuit:ABC XE a. Give the expression of the output X. b. Draw the truth table of the digital circuit.Exercise 2.7: Draw the truth table of the digital circuit described by the following equation:X = AB + ABC + ACExercise 2.8: Let us consider the following digital circuit:AB C D X E a. Give the expression of the output X.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 31
- 32. b. Draw the truth table of the circuit. c. Answer the two previous questions considering the following digital circuit: A B X C2.4.4 The NOR gate: The NOR gate is an OR gate with its output inverted. • Truth table: A B A+ B 0 0 1 0 1 0 1 0 0 1 1 0 • Symbol:A OutputB The NOR gate can also be manufactured with more than two inputs.Exercise 2.9:Let us consider the following digital circuit: A B C D X E a. Give the expression of the output X. b. Draw the truth table of the circuit.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 32
- 33. Remark 2.3: The negative AND gate, the negative OR gate. Let us consider the following digital circuit: A X B a. Draw the truth table of this circuit. b. Show that this circuit is equivalent to a NOR gate. The expression of the output X can be written as follow: X = A.B . Therefore,the truth table of the circuit can be easily deduced: A B X 0 0 1 0 1 0 1 0 0 1 1 0 We can notice that the truth table of this circuit is identical to that of a NORgate. The gate described in this exercise is called the negative AND gate and itssymbol is given as follow:A OutputB Let us consider the following gate circuit: A X B a. Draw the truth table of the circuit. b. Show that the circuit is equivalent to a NAND gate.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 33
- 34. The expression of the output X can be written as follow: X = A. + B . Therefore,the truth table of the circuit can be easily deduced: A B X 0 0 1 0 1 1 1 0 1 1 1 0 We can notice that the truth table of this circuit is identical to that of a NANDgate. The circuit described in this exercise is called the negative OR gate. Its symbolis given as follow: 1A 3 2 OutputBRemark 2.4: The previous remark leads us to two important theorems of the Booleanalgebra (the Boolean algebra will be studied in detail in the next chapter). Thosetheorems are called De Morgan’s theorems: A + B = A..B A.B = A + B Where A and B are two Boolean variables (A Boolean variable is that whichcan only take values 0 and 1).2.4.5 The exclusive-OR gate: The exclusive-OR gate outputs a high level only if the inputs are at differentlogic levels, either 0 and 1 or 1 and 0. Conversely, its output is low if the inputs are atthe same logic levels. The exclusive-OR gate is sometimes called XOR gate. • Truth table: A B A⊕ B 0 0 0 0 1 1 1 0 1 1 1 0Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 34
- 35. • Symbol:A OutputBExercise 2.10: Let us consider following gate circuit: A Y B a. Determine the expression of the output. b. Deduce the truth table. c. Conclude.Remark 2.5: From the exercise above the following property can be deduced:A.B + A.B = A ⊕ B2.4.6 The exclusive-NOR gate: The exclusive-NOR gate is equivalent to an exclusive OR gate with aninverted output. The truth table is exactly opposite as for the exclusive-OR gate. Theexclusive-NOR gate also known as the XNOR gate. • Truth table: A B A⊕ B 0 0 1 0 1 0 1 0 0 1 1 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 35
- 36. • Symbol: 1A 3 2 OutputBExercise 2.11: Let us consider the following gate circuit: A X B a. Determine the expression of the output. b. Deduce the truth table. c. Conclude.Remark 2.6: From the previous exercise, the following property can be deduced:A..B + A.B = A ⊕ B The exclusive-OR and exclusive-NOR gates are very useful for circuits wheretwo or more binary numbers are to be compared bit-for-bit, and also for errordetection (parity check).2.5 Gate universality: NAND and NOR gates posses a special property: they are universal. That is,given enough gates, either type of gate is able to mimic the operation of any othergate type. This ability for a single gate type to be able to mimic any other gate type isenjoyed only by the NAND and the NOR gate.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 36
- 37. 2.5.1 Constructing the NOT function: VccInput Output Output Input InputInput Output Output2.5.2 Constructing the buffer function: Vcc Vcc Output Input Input Output2.5.3 Constructing the AND function: A Output B A Output B2.5.4 Constructing the NAND function: A Output BDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 37
- 38. 2.5.5 constructing the OR function: Vcc A Vcc Output B A B Output2.5.6 Constructing the NOR function: Vcc Vcc A Output Vcc B2.6 Voltages for logic states: Logic gate circuits are designed to input and output only two types of signals;‘high’ (1) and ‘low’ (0), as represented by a variable voltage: Full power supplyvoltage for a high state and zero voltage for a low state. However, in reality, logicstate voltage levels rarely attain these perfect limits. TTL gates (Transistor Transistor Logic) operate on a nominal power supplyvoltage of 5 volts+/- 0.25 volts. Acceptable input signal voltages range from 0 volt to0.8 volt for low logic state, and 2 volts to 5 volts for high logic state. Acceptableoutput signal voltages range from 0 volt to 0.5 volt for low logic state and 2.7 volts to5 volts for high logic state.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 38
- 39. High High High level noise margin Low Low level noise margin low Figure 2.3: Voltage levels for TTL gates The noise margin of a gate is the difference between the tolerable output andinput ranges. For CMOS gates (Complementary Metal Oxide Semiconductor) operating at apower supply of 5 volts, the acceptable input signal voltages range from 0 volt to 1.5volts for low logic state, and 3.5 volts to 5 volts for a high logic state. Acceptableoutput signal voltages range from 0 volt to 0.05 volt for a low logic state and 4.95volts to 5 volts for a high logic state.Exercise 2.12: Calculate the high level noise margin and the low level noise margin for CMOScircuits operating at a power supply of 5 volts. Compare that noise margin with that ofa TTL circuit.Remark 2.7: Unlike TTL, which is restricted to a power supply voltage of 5 V, CMOS maybe powered by voltages as high as 15 volts or 18 volts.2.7 DIP gate packaging: Digital logic gates are manufactured as integrated circuits: all the constituenttransistors and resistor built on a single piece of semiconductor material. Thetechnicians and engineers find logic gates enclosed in DIP (Dual Inline Package)housing. Part numbers given to these DIP packages specify what type of gates areenclosed, and how many. These part numbers are industry standards.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 39
- 40. A ‘74LS02’ manufactured by Motorola will be identical in function to a ‘74LS02’manufactured by Fairchild or by other manufacturers. Letter codes added to the partnumber are unique to the manufacturer and are not industry standard codes. Forinstance, a ‘SN74LS02’ is a quad-2 inputs TTL NOR gate manufactured by Motorolawhile a ‘DM74LS02’ is the exact same circuit manufactured by Fairchild. Logic circuit part numbers beginning with ‘74’ are commercial-grad TTL. If thepart number begins with the number ‘54’, the chip is a military grad unit having agreater operating temperature range, and typically more robust in regard to allowablepower supply and signal voltage levels. The letters ‘LS’ immediately following the 74 or 54 prefix indicate low powershottky circuitry. Figure 2.4: Examples of TTL DIP circuit packages:Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 40
- 41. Figure 2.5: Examples of CMOS DIP circuit package2.8 Conclusion: In this chapter, we have studied the functioning of logic gates which are basictools used in the design of any logic circuit. An introduction has also been madeconcerning the input and output voltage levels for TTL and CMOS circuits. The aim ofthe next chapter is the study of the Boolean algebra. It is a set of mathematicalproperties and identities governing the functioning of logic circuits.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 41
- 42. REVIEW QUESTIONS 1. Consider the following gate circuit: A X B C D a. Give the expression of the output X. b. Draw the truth table of the circuit. 2. Draw the gate circuits corresponding to the following expressions: X = A.B(C + D) Y = A + B + C D E + BC D ( ) Z = A + B + PQ ⊕ C D 3. For each of the following circuits, give the expression of the output and draw the truth table. A B X C A B Y CDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 42
- 43. A B C Z DReferences: 3. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 4. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 43
- 44. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER THREE : BOOLEAN ALGEBRA By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 44
- 45. Chapter Three BOOLEAN ALGEBRA3.0 Specific objectives: At the end of this chapter, the student will be able to: - Master the rules of Boolean arithmetic; - Master Boolean algebraic identities and properties; - Convert truth tables of logic circuits into Boolean expressions.3.1 Introduction: The Boolean algebra was created by the English mathematician George Boole(1815-1864). The Boolean algebra codifies rules of relationship betweenmathematical quantities to one of two possible values: true or false, 1 or 0. So, allarithmetic operations performed with Boolean quantities have but one of two possibleoutcomes: either 1 or 0. There are three basic Boolean arithmetic operations: • Boolean addition which is equivalent to the OR logic function, as well as parallel switch contacts; • Boolean multiplication, which is equivalent to the AND function as well as series switch contacts; • Boolean complementation which is equivalent to the NOT logic function.3.2 Boolean arithmetic: This section presents the basic relationship concerning the three basicBoolean arithmetic operations.3.2.1 Boolean addition: As we have already said, Boolean addition is equivalent to the OR logicfunction. Therefore, we have the following relationships:0+0=00+1=11+0=11+1=1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 45
- 46. 0+0=0 0 00 0 000+1=1 1 0 U10 1 111+0=1 1 1 U21 1 001+1=1 1 1 U31 1 11Remark 3.1: There is a difference between Boolean addition and binary addition; for binaryaddition we have the following relationships.0+0=00+1=11+0=11 + 1 = 10 (1 + 1 = 0 + report of 1).3.2.2 Boolean multiplication: The Boolean multiplication is equivalent to the AND logic function:0x0=00x1=01x0=01x1=1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 46
- 47. 0x0=0 00 0 0 000x1=0 0 10 0 1 011x0=0 01 1 0 001x1=1 11 1 1 113.2.3 Boolean complementation: The Boolean complementation is equivalent to the NOT logic function./0 = 1 0 1/1 = 0 1 03.3 Boolean algebraic identities: An identity is a statement that is true for all possible values of its variables.There are two groups of Boolean algebraic identities: additive identities andmultiplicative identities.3.3.1 Additive identities If A is a Boolean variable, then the following statements are always true.A+0=AA+1=1A+A=AA + /A = 1 AA+0=A AA A0 0 A A+1=1 1A 11 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 47
- 48. A A+A=A AA AA A AA + /A = 1 1A 1/A /A3.3.2 Multiplicative identities: A being a Boolean variable, the following statements are always true.0xA=01xA=AAxA=AA x/A = 00xA=0 0 A 00 0A1xA=0 1 A A1 AAAxA=A A A AA AAA x /A = 0 A /A 0A 0/ARemark 3.2: Double complementation Complementing a variable twice results in the original Boolean value. /AA //A = ADigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 48
- 49. 3.4 Boolean algebraic properties: Let us consider three Boolean variables A, B and C. The following propertiesare true. • Commutative property: - Addition:A+B=B+A - Multiplication:AxB=BxA • Associative property: - Addition:A + (B + C) = (A + B) + C - Multiplication:A(B.C) = (A.B)C • Distributive property:A(B + C) = A.B + A.C3.5 Boolean rules for simplification: There are several rules for Boolean algebra intended to be used in reducingcomplex Boolean expressions to their simplest forms. The simplification of theBoolean expressions of logic circuits brings many advantages: - Higher operating speed (less delay time from input signal transition to output signal transition). - Less power consumption (few IC used). - Less cost. - Greater reliability.3.5.1 Rule n° A + AB = A 1:A + AB = A (1 + B) = A (1) =A3.5.2 Rule n° A + AB = A + B 2:A + AB = A + AB + AB (Apply the previous rule to expand A term to A + AB) ( ) = A + B A + A (Factorising B)Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 49
- 50. = A + B(1) (Applying identity A + A = 1 ) = A+ B3.5.3 Rule n° 3: ( A + B )( A + C ) = A + BC( A + B )( A + C ) = A. A + A.C + A.B + B.C (Distributing terms) = A + AC + AB + BC (Applying identity AA = A) = A + AB + BC (Applying A + AC = A) = A + BC (Applying A + AB = A)3.6 Circuit simplification example: Let us consider the following logic circuit.AB QC 1. Write the Boolean expression of the output Q:Q = AB + BC (B + C ) ) 2. Reduce this expression to its simplest form using the rules of Boolean algebra.Q = AB + BCB + BCC = AB + BC + BC (Using the identity A.A =A) = AB + BC (Identity A.A = A)Q = B( A + C ) 3. Generate the schematic diagram of the simplest expressionB QACRemark 3.3 To convert Boolean expression to a gate circuit, you should evaluate theexpression using standard order of operation: - Multiplication before addition, - Operation within parenthesis before anything else.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 50
- 51. Exercise 3.1: Simplify the following expressions using Boolean algebra and generate theschematic diagrams of the simplest expressions.X = A.B.C + A.BC + ABC + AB.C + A.B.C ( )( )Y = B+C B+C + A+ B+CZ = (C + D ) + AC D + AB.C + A..BCD + A.C.D3.7 The exclusive-OR functionA A⊕ BBA ⊕ B = A.B + A.B3.8 DeMorgan’s theoremAB = A + BA + B = A..B DeMorgan’s theorem may be thought in terms of breaking a long bar symbol.When a long bar is broken, the operation directly imply the changes from addition tomultiplication or vice versa, and the broken bar pieces remains over the individualvariables.Remark 3.4: When multiple layers of bar exists in an expression, you may only break onebar at a time.Example 3.1: Let us simplify the following expressions:A + BC = A.BC (The superior bar broken) = A.BC A + B + C = A.B.C = A.BCDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 51
- 52. 3.9 Converting truth table into Boolean expression: We can convert truth table into Boolean expression using one of the followingmethods: - Sum of products (SOP) - Product of sums (POS)3.9.1 Sum of products: Boolean expressions may be generated from truth table quite easily using thefollowing steps: - Determine which rows of the table have an output of 1; - Write one product for each raw; - Sum all the product terms.This creates a Boolean expression representing the truth table as a whole.Example 3.2: Let’s consider a logic circuit having the following truth table: A B C Q 0 0 0 0 Row 1 0 0 1 0 Row 2 0 1 0 0 Row 3 0 1 1 1 Row 4 1 0 0 0 Row 5 1 0 1 1 Row 6 1 1 0 1 Row 7 1 1 1 1 Row 8 The rows 4, 6, 7 and 8 have an output of 1, each raw gives us a product. Bysumming those products, we obtain the following Boolean expression which is that ofthe output Q.Q = ABC + A BC + ABC + ABCExercise 3.2: Simplify the expression of the output Q treated in the example above usingBoolean algebra and generate the schematic diagram of the simplest expression.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 52
- 53. 3.9.2 Product of sums: Boolean expression may be also generated from truth table quite easily bydetermining which rows of the table have an output of 0, writing one sum term foreach row and finally multiplying all the terms.Example 3.3: Let us consider a logic circuit having the following truth table. A B C Q 0 0 0 0 Row 1 0 0 1 1 Row 2 0 1 0 1 Row 3 0 1 1 1 Row 4 1 0 0 1 Row 5 1 0 1 1 Row 6 1 1 0 1 Row 7 1 1 1 0 Row 8 The rows 1 and 8 have an output of 0; each row gives us a sum. The productof those sums gives us a Boolean expression which is that of the output of the logiccircuit. In fact, we have:Q = A.B.C + ABCQ=Q ( ) = A..B..C + ABC = (A..B..C ). A.B.C = A + B + C (A + B + C ) = ( A + B + C )(A + B + C )Q = ( A + B + C ).( A + B + C ) In reality for each row having an output of 0, we should notice that we have butthe inverted output product ( Q ). By inverting that output ( Q ), we obtain a sum usingDeMorgan’s theorem. Finally, the product of all those sums gives us the output of thelogic circuit.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 53
- 54. Remark: Generally, the sum of products is more used than the product of sums toconvert a truth table into Boolean expression. However, when a few number of rowshave an output of 0, it is preferable to use the POS than to use the SOP.Exercise 3.3: Generate the logic diagram of the circuit treated the example 3.3.Exercise 3.4: Assuming that A ⊕ B = A.B + A.B , proof that A ⊕ B = A.B + A..B3.10 Conclusion: This chapter has permitted us to study the identities and the properties of theBoolean algebra. Those are tools used for the simplification of the Booleanexpressions. However, this simplification is sometime very difficult to carry out,especially for logic circuit having complex Boolean expression. To solve this problem,another method of simplification has been proposed: that is Karnaugh mapping. It isthe topic of the next chapter. REVIEW QUESTIONS 1. Simplify the following expressions using Boolean algebra: X = ABCD + A..B.C.D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCDY = ABC + ABC + ABC + ABC 2. Simplify the following circuit using the Boolean algebra.ABC XDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 54
- 55. 3. Conceive de logic circuit corresponding to the following truth table. A B C X 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 4. Logic gates can be realised using diodes and resistors. Consider the following circuits: Vcc Va Va S S Vb Vba. Analyse the functioning of each circuit by filling the following truth table. Va Vb Vs 0 0 0 1 1 0 1 1b. Deduce the logic gate described by those circuitsDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 55
- 56. 5. Logic gates can also be realised using resistor and transistor: That is resistor transistor logic (RTL). Consider the following circuits: Vcc Vcc VoutVa Va Vout VbVb Vcc Vout VinStudy the functioning of each of those circuits and determine the logic gate describedby each of them. 6. Logic gates can also be realised using diodes and transistors. VccVa VoutVbStudy the functioning of the circuit and deduce the logic gate that it describes.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 56
- 57. 7. A3A2A1A0 is a binary number having four bits. A3 is the MSB and A0 is the LSB. Conceive a logic circuit that produces an output of 1 when the binary number is superior to 0010 and inferior to 1000. 8. A logic circuit has 4 inputs A, B, C and D, and one output X. The output X is high only if C and D are low while A or B or both (A and B) are high. Conceive the logic circuit so described. NB: The conception of a logic circuit requires the following steps: - Truth table; - Determination of the simplified expression of the output; - Logic diagram of the circuit using logic gates.References: 5. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 6. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 57
- 58. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER FOUR: KARNAUGH MAPPING By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 58
- 59. Chapter Four KARNAUGH MAPPING4.0 Specific objectives: At the end of this chapter, the student will be able to simplify Booleanexpressions using Karnaugh mapping.4.1 Introduction: Karnaugh map, like Boolean algebra is a simplification tool applicable to digitallogic. Maurice Karnaugh, a telecommunication engineer developed the k-map at Belllabs in 1953 while designing digital logic based telephone switching circuits. K-mapreduces logic functions more quickly and easily compared to Boolean algebra. Byreduce we mean simplify, reducing the number of gates and inputs. K-map workswell for up to six input variables (in this course we will study up to 4 input variables).For more than six variables, simplification should be done by CAD (ComputerAutomated Design).4.2 Karnaugh maps, truth tables and Boolean expression: Karnaugh map is filled using Gray code. As we have already seen in the firstchapter, Gray code is a numeration code which is such that, in a given Graysequence, each number differs from the next or the previous number only with onebit. In order to know how to generate a Gray sequence of number, please go back tothe first chapter which treated the matter of numeration systems and codes.4.2.1 Transferring the content of a truth table into a k-map: Let us consider the following truth table:A B X0 0 00 1 11 0 01 1 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 59
- 60. The content of the truth table can be transferred to the truth table as follow:X B 0 1 A Top 0 0 1 1 0 1 Side The logic states of the output are written in the table according to the combination of the input variable A and B. Each location of the table corresponds to one logic state of the output. So we have four locations here because we have four output combinations according to our truth table. The logic states of the inputs A and B are filled using Gray code. To determine the simplified Boolean expression of the output, we should follow the following steps: • Look for adjacent cells; that is above or to the side of a cell. Diagonal cells are not adjacent. • Circle the two adjacent ones. • Find the variables top and/or side which are the same for the group. It is the variable B in our case. It means that, as we can notice, for the group of ones, the variables B remains unchanged and equal to 1. Write this as the Boolean result. • Ignore variables which are not the same for the cell group. In our case, A varies. It is both 1 and 0. So A should be ignored; it cannot be written as Boolean result. • Ignore any variable not associated with cells containing ones. • Then the Boolean expression of the output is: X = B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 60
- 61. Exercise 4.1: Consider the following logic diagram: A B X a. Establish the truth table of the circuit. b. Give the Boolean expression of the output using SOP (Sum of products) method. c. Give the simplified Boolean expression of the output using K-map.Exercise 4.2: For each of the following truth table, write the Boolean expression of theoutput using k-maps.A B X A B X0 0 1 0 0 00 1 1 0 1 11 0 0 1 0 11 1 0 1 1 1A B X A B X0 0 1 0 0 10 1 0 0 1 11 0 1 1 0 01 1 1 1 1 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 61
- 62. Remark 4.1: How to determine the Boolean expression of a gate circuit. • Write the Boolean expression of the output using SOP method; • Transfer the product terms to the k-map; • Form groups of adjacent cells; • Deduce simplified Boolean expression of the output. • Draw the simplified logic circuit. Example 4.1: Let us determine the simplified Boolean expression of the following circuit using k- map. A B X • Using the SOP method the Boolean expression of the output can be written as follow: X = A B + AB • The expression can then be transfer in a k-map:X B 0 1 A 0 0 1 1 1 0 • It is not possible to form groups of adjacent ones. The two ones of the k-map are isolated. • No simplification is therefore possible. The Boolean expression should be left as it is. X = AB + AB = A ⊕ B Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 62
- 63. This is not a simplified expression. This ‘simplification’ is just intended to make a schematic diagram look nicer. In fact exclusive-or function is a combination of other functions. 4.2.2 Logic simplification with Karnaugh map: Boolean simplification that we have done above could be achieved with Boolean algebra quickly. Real world logic simplification problems call for larger k- maps so that we may do serious work. We will now develop tools that we need for more complex application in combinatory logic. 4.2.2.1 General method These are the steps which should be followed for the simplification of a Boolean expression using Karnaugh mapping. • Draw the k-map filling the ones and the zeros in the corresponding cells; • Observe with attention the k-map and detect the ones which are isolated: those are the ones that are not adjacent to another one. Circle them. • Find the ones which are adjacent only to one another one. Circle them to form groups of two ones. • Find groups one eight ones which are adjacent and circle them, even if among them there are ones belonging already to a group of two ones. • Find groups of four adjacent ones and circle them. Among the four ones there should be at least one one which has not yet been grouped. • Then deduce the simplified Boolean expression. The following sizes of k-map will be used X CD AB 00 01 11 10X 00 BC A 00 01 11 10 01 0 11 1 10 K-map for 3 Boolean input variables K-map for four Boolean input variables Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 63
- 64. As we have already said, the input logic states are filled using Gray code, so for instance, if we have two variables A and B, the Gray sequence will be: 00,01,11,10 (a binary sequence would have been 00,01,10,11!). 4.2.2.2 K-map for three input Boolean variables: Let us consider the following three variables Boolean expression. X = A.B.C + A.B.C This expression can be transferred in a k-map as follow:X BC A 00 01 11 10 0 1 1 0 0 1 0 0 0 0 The simplified Boolean expression of the output can therefore be determined. X = A.B Exercise4.3: Simplify the following Boolean expressions using k-maps: X = A.B.C + A.B.C + A.BC + A.B.C Y = A.B.C + A.BC + ABC + ABC Z = A.B.C + A.B.C + ABC + A.BC + ABC + ABC Example 4.2: Let us simplify the following Boolean expression using k-map. X = A.B.C + A.B.C + A.BC + A.B.C + A.B.C + ABC The first step consists of filling the k-map.X BC A 00 01 11 10 0 1 1 1 1 1 1 0 0 1 After grouping the ones, we can now deduce the simplified expression of the output: X = A+C Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 64
- 65. 4.2.2.3 K-map for four input Boolean variables: Let us consider the following Boolean expression:X = A.BCD + A.BCD + ABCD + ABCD + ABC.D + ABC D + ABC D This expression can be transferred in the k-map as follows: X CD AB 00 01 11 10 00 0 0 1 0 01 0 0 1 0 11 1 1 1 1 10 0 0 1 0 The simplified Boolean expression of the output can therefore be deduced:X = AB + CDExample 4.3: Consider the k-map bellow and give the simplified Boolean expression theoutput X: X CD AB 00 01 11 10 00 1 1 1 1 01 1 0 0 1 11 1 0 0 1 10 1 1 1 1 The simplified Boolean expression of the output is therefore determined:X = B+DExercise 4.4: Simplify the following Boolean expression using k-map:X = A.B.C.D + A..B.C.D + AB.C.D + A.B.C.DY = A.B.C.D + A.B.C.D + A.B.CD + A.B.C.D + A.B..C.D + A.B.C.D + AB.CD + A.B.C.DDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 65
- 66. Remark 4.2: Condition of indifference Some logic circuits are conceived in such a way that for certain combination ofinput variables, the output is neither high nor low. In fact, those input combinationsshould never occur. In the k-maps, the cells representing those combinations arefilled with a X. Let us consider for instance the following truth table: X BC 00 01 11 10 A We deduce that 0 0 0 1 X X=B 1 0 X 1 14.3 Conclusion: This chapter has permitted us to study Karnaugh mapping which is used for aneasier simplification of Boolean expression. It is one of the most important tools thatshould be deeply understood in order to succeed in the study of combinatory logiccircuit. The next chapter will be focused on the study of digital arithmetic. That is, onhow digital systems perform arithmetical operations such as addition, subtraction,multiplication and division. REVIEW QUESTIONS 1. Simplify the following Boolean expressions using k-maps:X = A.B.C + A.BC + ABC + AB.C + A.B.C ( )( )Y = B+C B+C + A+ B+CZ = (C + D ) + AC D + AB.C + A..BCD + A.C.DS = ABCD + A..B.C.D + A.B.C D + A.B.C.D + A.BCD + ABC.D + ABC D + ABC D + ABCDT = ABC + ABC + ABC + ABCDigital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 66
- 67. 2. For each of the following k-maps, determine the Boolean expression of the output X. X X CD CD AB 00 01 11 10 AB 00 01 11 10 00 1 1 0 1 00 1 1 1 1 01 0 1 1 0 01 1 1 0 1 11 0 1 1 0 11 1 1 0 1 10 0 0 0 1 10 1 1 0 1 X X CD CD AB 00 01 11 10 AB 00 01 11 10 00 0 0 1 0 00 1 1 1 1 01 0 0 0 0 01 0 1 1 0 11 1 1 1 1 11 0 0 0 0 10 0 1 1 0 10 1 0 0 1 X X BC BC 00 01 11 10 00 01 11 10 A A 0 0 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1 1 X X BC BC 00 01 11 10 00 01 11 10 A A 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1 0 1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 67
- 68. References: 7. Digital systems, principles and applications, Ronald J.Tocci, 3rd edition, Prentice-Hall inc., Englewood Cliffs, New Jersey , USA,1985. 8. Lessons In Electric Circuits Volume IV – Digital, Tony R. Kuphaldt, Fourth Edition, 2007, www.allaboutcircuits.com . www.ibiblio.org/obp/electricCircuits. 9. Cours de systèmes logiques, Notes de cours, Première année du génie électrique, ENSET de Douala, J.C Tsokezo, 2004-2005.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 68
- 69. Courses In Electrical Engineering Volume II DIGITAL ELECTRONICS CHAPTER FIVE: DIGITAL ARITHMETIC By J-P. NGOUNE DIPET I (Electrotechnics), DIPET II (Electrotechnics) DEA (Electrical Engineering) Teacher in the Electrical Department, GTHS KUMBO, Cameroon.Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 69
- 70. Chapter Five DIGITAL ARITHMETIC5.0 Specific objectives: At the end of this chapter, the student will be able to perform arithmeticaloperations such as addition, subtraction, and multiplication using binary numbers5.1 Introduction: Many arithmetical operations are carried out in digital systems like computersand calculators. The most common of these operations are addition, subtraction andmultiplication. The aim of this chapter is to understand the principle used by digitalsystems to perform those operations.5.2 Binary addition: The addition of two binary numbers is similar to that of two decimal numbers.Let us consider the following case: 354+66310 1 7 This operation is performed using the following steps: • We begin by adding the two less significant digits of the two decimal numbers: 3 + 4 =7. There is no carry out. • Then we proceed by adding the two digits situated directly at the left: 5 + 6 = 11. We write 1 and the carry out is 1. • We add the two next digits: 3 + 6 = 9; the carry out is added: 9 + 1 = 10. So the result of the addition is 1017. For binary number, the principle is the same. However, only four cases can bemet while adding binary numbers:0+0=01+0=1Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 70
- 71. 1 + 1 = 0 + a carry out of 11 + 1 + 1 = 1 + a carry out of 1.Example 5.1:Let us add the following binary numbers: A = 1001 (910), B = 1111 (1510). 1001+111111000 • We begin by adding the two LSB (Least Significant Bit): 1 + 1 = 0 + carry out of 1. • Then we add that carry to the two bits situated directly at the left: 0 + 1 + 1(Carry) = 0 + carry out of 1. • The same operation is performed for the next rank. • Then for the most significant bits, we have: 1 +1 + 1(Carry from the previous rank) = 11. • Finally, the result of the operation gives us 11000 (2410).Exercise 5.1:For each of the following cases, add the binary numbers A and B. a) A = 11101; B = 1001. b) A = 101111; B = 11111. c) A = 11101; B = 11111.5.3 Signed numbers: In order to differentiate positive numbers to negative numbers, a specific bitcan be added in front of the binary number. That bit is called bit of sign. The bit ofsign is 0 for positive numbers and 1 for negative numbers.Example 5.2:+9 = 01001-24 = 111000Digital Electronics_Jean-Paul NGOUNE_www.scribd.com/jngoune. 71

No public clipboards found for this slide

Be the first to comment