EET105 Fall 2018 Digital Electronics Charles Rubenstein Ph
EET-105 – Fall 2018 Digital Electronics Charles Rubenstein, Ph. D. Adjunct Professor of Engineering Session 2: MON 09/10/18 /*/ WED 09/05/18 Mon/Wed: 9: 25 am – 11: 15 am // Wed/Fri: 11: 40 am – 1: 30 pm Lupton Hall 247 1
105 Mon/Wed: Teams Chart To be adjusted as needed NEXT WEEK 12 11 10 Kasey Najendra Brandon Michael V Kevin Al 9 Milos James 7 6 Basher Christina Muhammad Rich ? Ronald Connor 5 Sam Xiao 4 3 2 Xhovani Kenny Nick Michael S Jino 1 Urfa Mark Instructor Station Copyright © 2018 C. P. Rubenstein 8 2
105 Wed/Fri: Teams Chart To be adjusted as needed NEXT WEEK 12 11 10 Steven David Roel Shane Jamie Andre 9 Talha Victor 7 6 Al Anthony Jeremy Elijah Anthony Alan & Farzan 5 Michael Mike 4 3 2 Joe Muhammad Jordan Matt Israel Vinny 1 Jackie Amar Instructor Station Copyright © 2018 C. P. Rubenstein 8 3
Instructor Contact Information Dr. Charles Rubenstein <c. rubenstein@ieee. org> Adjunct Professor of Engineering Office hours (by appointment *) in LH 247 Mon: 9: 00 am – 9: 20 am Wed: 9: 00 am – 9: 20 am Fri: 11: 00 am – 11: 30 am (*Please email me at least a day in advance if you plan on coming to office hours…) Send me an email … Subject line: 105 Copyright © 2018 C. P. Rubenstein 4
** World Maker Faire – NY ** For the seventh year, Dr. Rubenstein will be coordinating the IEEE (Sponsored by Region 1, IEEE-USA, EAB and The IET) at the Booth World Maker Faire New York NY Hall of Science - Queens, NY Saturday-Sunday 22 -23 September 2018 Copyright © 2018 C. P. Rubenstein 5
Class Session Archives http: //www. Charles. Rubenstein. com/105/ 18 fa 02. pdf (Class Power. Point slides) * 18 fa 02_h. pdf (slides in handout format) * *Archive materials are normally online four days after class Copyright © 2018 C. P. Rubenstein 6
EET 105 – Digital Circuits 1 Chapters & Topics covered in this Class: Tocci, et al: Digital Systems – principles & applications CHAPTER 1: Introductory Concepts CHAPTER 2: Number Systems and Codes CHAPTER 3: Describing Logic Circuits CHAPTER 4: Combinational Logic Circuits CHAPTER 6: Digital Arithmetic: Operations and Circuits CHAPTER 9: MSI Logic Circuits Copyright © 2018 C. P. Rubenstein 7
EET 105 – Digital Electronics Lab Manual - Table of Contents 1. Logic Gates 2. Simple Logic Circuits 3. Logic Circuits using NAND/NOR gates 4. Majority Circuits 5. Exclusive OR gates 6. Adder Circuits 7. Code Conversion using Combinational Circuits 8. BCD-to-Seven Segment Display Decoder/Driver 9. Multiplier 10. Comparator 11. Decoder 12. Multiplexer Copyright © 2018 C. P. Rubenstein 8
EET 105 Class Schedule Preliminary, subject to change Mon/Wed: Wed/Fri: 01 02 5 -Sep 31 -Aug 10 -Sep 5 -Sep 12 -Sep 7 -Sep 12 -Sep 19 -Sep 14 -Sep 24 -Sep 19 -Sep 21 September 2018 26 -Sep Class Session Topic 1. Syllabus Overview, Decimal and Binary Number Systems 2. Octal and Hex Number Systems; OR, AND, NOT Gates 3. Boolean Algebra; Logic Circuits; Truth Tables; NOR, NAND 4 L 1. Equipment Review; IC Pin Diagrams; LAB 1: Logic Gates 5 L 2. LAB 2: Simple Logic Circuits 6 L 3. LAB 3: Logic circuits using NAND/NOR Gates OPEN LAB SESSION EXAM 1 - Wednesday 26 September Copyright © 2018 C. P. Rubenstein 9
In Today’s Class: • 2 Do: Distribute: Updated Syllabus • 2 Do: Review Lab Team Partner Assignments • 2 Do: Class Lecture material: Review Decimal and Binary Number Systems; Octal and Hex Numbering Systems; Basic Boolean Algebra; OR and AND Gates and their Truth Tables Copyright © 2018 C. P. Rubenstein 10
Questions? Copyright © 2018 C. P. Rubenstein 11
EET 105 Lab Equipment LD-2 Pencilbox: E&L Instruments with AC Adapter: Interplex Electronics Integrated Circuits Parts Kit: Farmingdale Copyright © 2018 C. P. Rubenstein 12
Connecting Leads and Terminals Wire Strippers & Wire Copyright © 2018 C. P. Rubenstein 13
Questions? Copyright © 2018 C. P. Rubenstein 14
Review of Basic Number System Concepts Copyright © 2018 C. P. Rubenstein 15
Digital Number Systems DECIMAL ‘Base 10’ Copyright © 2018 C. P. Rubenstein 16
Decimal Numbers - 1 Decimal numbers are formally called the “Base 10” number system The ONLY unique numbers possible in a decimal numbering system would be the digits: 0, 1, 2, 3, 4, 5 , 6, 7 , 8, and 9 Note that the decimal numbering system has a set of TEN unique numbers or digits – hence, the ‘base’ 10. Copyright © 2018 C. P. Rubenstein 17
Decimal Numbers - 2 Powers of Ten into a ‘real’ number Although we use decimals so often don’t think of it the way it is constructed, we can break a decimal number into its ‘powers of 10’ with coefficients “an”: an x 10 n + an-1 x 10 n-1 + … + a 1 x 101 + a 0 x 100 To convert a number in this decimal notation 4 x 103 + 5 x 102 + 0 x 101 + 7 x 100 into a common ‘number’ we merely write the coefficients. 103 = 102 = 101 = 1000 10 1 4 5 0 7 We include ALL zero ‘place holders’ to yield 4, 507. Note that we use a comma every three places to more easily understand the number: 1, 234, 567 (etc. ). Copyright © 2018 C. P. Rubenstein 18
Questions? Copyright © 2018 C. P. Rubenstein 19
Digital Numbering Systems BINARY ‘Base 2’ Copyright © 2018 C. P. Rubenstein 20
Binary Numbers - 1 Binary numbers are formally called the “Base 2” number system The ONLY unique numbers possible in a binary numbering system would be the digits: 0 and 1 Note that the binary numbering system has a set of TWO unique numbers or digits – hence, the ‘base’ 2. In digital electronics we will use the binary system as we will have many instances where something is: high or low, +5 volts or zero volts, on or off Copyright © 2018 C. P. Rubenstein 21
Binary Numbers - 2 Powers of Two into a ‘real’ number Just as we did with decimals, we can break a binary number into its ‘powers of 2’ with coefficients “an”: an x 2 n + an-1 x 2 n-1 + … + a 1 x 21 + a 0 x 20 To convert a number in this binary notation 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 into a common ‘number’ we merely write the coefficients: 23 = 22 = 21 = 20 = 8 4 2 1 1 1 0 1 Include zero place holders to yield the binary 11012 (=1310) Note that we can readily see that we can create a decimal number from a binary number by adding the individual powers when “ 1” Copyright © 2018 C. P. Rubenstein 22
Binary Counting LSB = Least significant bit MSB = Most significant bit Copyright © 2018 C. P. Rubenstein 23
Binary Numbers - 4 Individual Binary digits are also called BITs. A single bit can represent the decimal numbers 0 and 1. We can construct a chart showing the first eight bits in binary: 27 = 26 = 25 = 24 = 3 2 = 822 = 421 = 220 = 1 128 64 32 16 These 8 Bits are called a BYTE. If we fill all the chart spaces with “ 0” the value of the byte is 0000 = decimal 0 If we fill all the spaces with “ 1”s we get the binary 1111 which, according to the ‘weights’ 27 = 26 = 25 = 24 = 23 = 22 = 4 21 = 20 = 1 128 64 32 16 8 2 on this chart equals: 1 1 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 decimal Thus one byte can represent decimal numbers 0 through 255. Copyright © 2018 C. P. Rubenstein 24
Examples: Decimal to Binary Prove it yourself: And also: It might be helpful to remember: 27 = 26 = 25 = 24 = 3 2 = 822 = 421 = 220 = 1 128 64 32 16 Copyright © 2018 C. P. Rubenstein 25
Adding Binary Numbers - 1 Adding Binary Numbers To represent the decimal number “ 2” we need to add binary 1 to binary 1. NOTE: There is only a 0 or 1 in binary. When your addition exceeds “ 1” you carry in much the same way as when you exceed “ 9” in decimal: 27 = 26 = 25 = 24 = 3 2 = 822 = 421 = 220 = 1 128 64 32 16 0 + 0 = 0 0 0 0 1 0 0 + 1 = 1 (also 1 + 0 = 1) BUT: 1 + 1 = 10 (we carry the “ 1” to the next higher binary number). (we often group the bits into 4 or 8 to make reading them simpler) Likewise: 0111 0000 and 0111 1111 and 0101 + 1000 1111 + 0000 0001 + 0000 1010 Equals: 1111 1000 0000 0101 1111 Copyright © 2018 C. P. Rubenstein 26
Adding Binary Numbers - 2 Binary Math Another way to show this is to expand out the powers of two, Then merely add the coefficients, checking to see if their total exceeds the value ‘ 1’ and if so, carrying the balance on the next HIGHER decade and repeating the action for the next higher decade and so on. Adding 1010 to 0110 becomes: 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 Added to: 0 x 23 + 1 x 22 + 1 x 21 + 0 x 20 Which is: (1+0) x 23 + (0+1) x 22 + (1+1) x 21 + (0+0) x 20 From the right to the left: 0 + 0= 0, no carry; 1+1 = 0, carry 1; 0+1 + 1(carry) = 0 carry 1; and finally 1+0+1(carry) = 0 carry 1 1 x 24 + 0 x 23 + 0 x 22 + 0 x 21 + 0 x 20 or 1 0000 or 1 x 24 = 16 decimal Copyright © 2018 C. P. Rubenstein 27
Questions? Copyright © 2018 C. P. Rubenstein 28
Digital Numbering Systems OCTAL ‘Base 8’ Copyright © 2018 C. P. Rubenstein 29
Octal Numbers Digital Electronics also uses the Octal Numbering System (base 8) to handle longer binary strings. Octal needs only 8 unique digits so we can still use our old friends the ten digit Decimal numbers. As before, the base number is NEVER reached in counting in that number system, thus we use 0 -7: 0, 1, 2, 3, 4, 5, 6, 7 One Octal digit (0 - 78) represents decimal numbers 0 - 7 Two Octal digits (00 - 778) represent decimal 0 - 63 Octal numbers require 3 bits: 1112 = 710 Three Octal digits 0008 - 7778 = 9 binary bits = 0 - 511 Copyright © 2018 C. P. Rubenstein 30
Octal Numbers - 2 ‘Real’ numbers into Powers of Eight To convert an Octal number, say 356, into decimal notation: an x 8 n + an-1 x 8 n-1 + … + a 1 x 81 + a 0 x 80 We recognize that each digit is a coefficient of its appropriate power of eight - with eight an values 83 = 82 = 81 = 80 = 512 64 8 1 We can fill in the ‘chart’ 0 3 5 6 or just put the coefficients “an” into the above formula: 3568 Octal = 3 x 82 + 5 x 81 + 6 x 80 = 3 x 64 + 5 x 8 + 6 x 1 = 192 + 40 + 6 = 238 decimal 3568 Octal = 23810 Decimal REMEMBER: We MUST include ALL zero ‘place holders’ Copyright © 2018 C. P. Rubenstein 31
Octal Numbers - 3 To convert an Octal number, say 2778, into decimal notation: an x 8 n + an-1 x 8 n-1 + … + a 1 x 81 + a 0 x 80 We can fill in the ‘chart’ 83 = 82 = 81 = 80 = 512 64 8 1 0 2 7 7 or just put the coefficients “an” into the above formula: 277 Octal = 2 x 82 + 7 x 81 + 7 x 80 = 2 x 64 + 7 x 8 + 7 x 1 = 128 + 56 + 7 = 191 decimal 277 Octal = 2778 = 191 Decimal For practice, verify that 17568 is equal to 100610 Copyright © 2018 C. P. Rubenstein 32
Converting Binary to Octal Convert from binary to octal is done by grouping bits in three starting with the LSB. Each group is then converted to the octal equivalent. The binary number in groups of three bits is converted to its equivalent octal digit: Example: Convert the ten binary bits 11101001102 to Octal: FIRST add two leading zeros to fill out four groups of 3 bits = 12 bits. Then ‘solve’… 1 6 4 68 83 = 82 = 81 = 80 = 512 64 8 1 1 6 4 6 Thus, 11101001102 = 16468 = 1646 Octal = 936 Decimal For practice, verify that 1010111112 = 5378 = 35110 Copyright © 2018 C. P. Rubenstein 33
Questions? Copyright © 2018 C. P. Rubenstein 34
Digital Numbering Systems HEXADECIMAL = Base 16 “HEX” Copyright © 2018 C. P. Rubenstein 35
Hexadecimal Numbers Digital Electronics also uses the Hexadecimal Numbering System (base 16) to handle long binary strings. But ‘Hex’ needs 16 unique digits. Decimal only covers ten digits, thus HEX uses 0 -9 plus the first six (6) letters of the alphabet (upper or lower case): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F One Hex digit (0 -F) represents decimal numbers 0 - 15 Two Hex digits (00 -FF) represent decimal 0 - 255 This is the same as 8 bits or 1 byte: 1111 = 255 Thus two Hex digits 00 - ff = 8 binary bits or 1 byte Copyright © 2018 C. P. Rubenstein 36
HEX Numbers - 2 ‘Real’ numbers into Powers of Sixteen To convert a Hex number, say 356, into decimal notation: an x 16 n + an-1 x 16 n-1 + … + a 1 x 161 + a 0 x 160 We recognize that each digit is a coefficient of its appropriate power of sixteen - with fifteen an values 163 = 162 = 161 = 160 = 4096 256 16 1 We can fill in the ‘chart’ 0 3 5 6 or just put the coefficients “an” into the above formula: 356 Hex = 3 x 162 + 5 x 161 + 6 x 160 = 3 x 256 + 5 x 16 + 6 x 1 =768 + 80 + 6 = 854 decimal 356 Hex = 854 Decimal REMEMBER: We MUST include ALL zero ‘place holders’ Copyright © 2018 C. P. Rubenstein 37
HEX Numbers - 3 To convert a Hex number, say 2 AF, into decimal notation: an x 16 n + an-1 x 16 n-1 + … + a 1 x 161 + a 0 x 160 We can fill in the ‘chart’ 163 = 162 = 161 = 160 = 4096 256 16 1 0 2 A F or just put the coefficients “an” into the above formula: 2 AF Hex = 2 x 162 + A x 161 + F x 160 We need to remember that “A” = 10 and “F” = 15 in Hex: = 2 x 256 + 10 x 16 + 15 x 1 = 512 + 160 + 15 = 687 decimal 2 AF Hex = 687 Decimal For practice, verify that 1 BC 216 is equal to 710610 Copyright © 2018 C. P. Rubenstein 38
Converting Decimal to Hex We can use the repeated division method for decimal to Hex conversion: Divide the decimal number by 16 The first remainder is the LSB—the last remainder is the MSB Example: Convert 42310 to hex: Copyright © 2018 C. P. Rubenstein 39
Converting Decimal to Hex Using the repeated division method to convert 21410 to hex: Copyright © 2018 C. P. Rubenstein 40
Converting Hex to Binary Note that Hex numbers can be broken down into groups of four (4) binary digits (or bits) = a nibble! Leading zeros can be added to the left of the MSB to fill out the last digits in a group. Example: Convert 9 F 216 to binary: For practice, verify that BA 616 = 1011101001102 Copyright © 2018 C. P. Rubenstein 41
Converting Binary to Hex Convert from binary to hex is done by grouping bits in four starting with the LSB. Each group is then converted to the hex equivalent. The binary number is grouped into groups of four bits and each is converted to its equivalent hex digit: Example: Convert the ten binary bits 11101001102 to Hex: FIRST add two leading zeros to fill out three groups of 4 bits = 12 bits. Then ‘solve’… For practice, verify that 1010111112 = 15 F 16 Copyright © 2018 C. P. Rubenstein 42
Converting Decimal to Hex to Binary Convert decimal 378 to a 16 -bit binary number by first converting it into hexadecimal. Example: Convert 37810 into Hex: Then: Convert 17 A 16 into 16 -bit Binary: 0 1 7 A 16 0000 0001 0111 1010 2 Copyright © 2018 C. P. Rubenstein 43
Hexadecimal, Decimal & Binary Relationships between the various digital number systems Copyright © 2018 C. P. Rubenstein 44
Counting in Hex When we count in Binary we count: 0, 1, 10, 11, 100, 101, 110, 111, 1000… When we count in Octal we count: 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, … When we count in Decimal we count: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, … And, when we count in Hexadecimal we count: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1 A, 1 B, 1 C, 1 D, 1 E, 1 F, 20 Copyright © 2018 C. P. Rubenstein 45
Questions? Copyright © 2018 C. P. Rubenstein 46
Boolean Constants and Variables Copyright © 2018 C. P. Rubenstein 47
Boolean Algebra Boolean algebra allows only two values: 0 and 1 – Logic 0 can be: false, off, low, no, open switch. Logic 0 – Logic 1 can be: true, on, high, yes, closed switch. Logic 1 Copyright © 2018 C. P. Rubenstein 48
Boolean Logic & Truth Tables The three basic Boolean logic operations are: – OR – AND, and AND – NOT A truth table describes the relationship between the input and output of a logic circuit. The number of entries corresponds to the number of inputs: – A 2 -input truth table would have 22 = 4 entries. – A 3 -input truth table would have 23 = 8 entries. Copyright © 2018 C. P. Rubenstein 49
2 -Input Truth Tables A 2 -input table represents the output of an unknown, 2 -input, logic gate Here we see that inputs A and B generate some output X Copyright © 2018 C. P. Rubenstein 50
Multiple-Input Truth Tables 3 -input truth tables: eight (8) output combinations 4 -input truth tables (16 possible outputs) Copyright © 2018 C. P. Rubenstein 51
Questions? Copyright © 2018 C. P. Rubenstein 52
OR Gates Copyright © 2018 C. P. Rubenstein 53
OR Operation with OR Gates The Boolean expression for the OR operation is: OR X = A + B Read this as “X equals A OR B” The + sign does not stand for ordinary addition—it stands for the OR operation OR The OR operation is similar to addition, but when A = 1 OR and B = 1, the OR operation produces: OR 1 + 1 = 1 not 1 + 1 = 1 1 + 1 = 2 In the Boolean expression x = 1 + 1 = 1 x is true (1) when A is true (1) OR B is true (1) OR C is true (1) Copyright © 2018 C. P. Rubenstein 54
2 -input OR Gates An OR gate is a circuit with two or more inputs, whose OR output is equal to the OR combination of the inputs. OR Truth table & circuit symbol for a two-input OR gates: OR Copyright © 2018 C. P. Rubenstein 55
3 -input OR Gates The truth table & circuit symbol for a three-input OR gate: OR Copyright © 2018 C. P. Rubenstein 56
OR Gate Examples Example of the use of an OR gate in an alarm system. OR Note: VTR and VPR are set point voltages. When the VT or VP voltage exceeds those values the comparator turns ‘ON’ Copyright © 2018 C. P. Rubenstein 57
Questions? Copyright © 2018 C. P. Rubenstein 58
AND Gates Copyright © 2018 C. P. Rubenstein 59
AND Operations with AND Gates The AND operation is similar to multiplication: AND X = A • B • C Read as “X equals A AND B AND C” AND The + sign does not stand for ordinary multiplication—it stands for the AND operation. AND x is true (1) when A AND B AND C are true (1) Truth table and 2 -input AND Gate symbol Copyright © 2018 C. P. Rubenstein 60
3 -input AND Gate The truth table & circuit symbol for a three-input AND gate: AND Copyright © 2018 C. P. Rubenstein 61
Review: The AND and the OR The AND symbol on a logic-circuit diagram tells you output will go HIGH only when all inputs are HIGH. The OR symbol means the output will go HIGH when any input is HIGH. Copyright © 2018 C. P. Rubenstein 62
Questions? Copyright © 2018 C. P. Rubenstein 63
NOT Gates: Logic Signal Inverters Copyright © 2018 C. P. Rubenstein 64
NOT (or inverter) Operation The Boolean expression and Truth Table for NOT operation: NOT “X equals NOT A” X = A is read as: “X equals the inverse of A” The overbar represents the NOT operation. NOT “X equals the complement of A” You may also see: X = / A A' = A Another indicator for inversion is the prime symbol ('). NOT Truth Table NOT Copyright © 2018 C. P. Rubenstein 65
NOT Gate or Inverter A NOT circuit is commonly called an INVERTER. NOTE: the presence of a small circle is ALWAYS used to denote that the output is inverted! The NOT circuit always has only a single input, and the output logic level is always opposite to the logic level of this input. Copyright © 2018 C. P. Rubenstein 66
Waveform Signal Inversion The NOT Gate or INVERTER inverts (complements) the input signal at all points on the waveform. Here we see a Rectangular input pulse and the resulting INVERTED Rectangular output pulse… Whenever the input = 0, output = 1, and vice versa. Copyright © 2018 C. P. Rubenstein 67
Typical NOT Gate Operation NOT This circuit provides an expression that is true when the button is not pressed. Copyright © 2018 C. P. Rubenstein 68
Any Questions? Send me an email … c. rubenstein@ieee. org Copyright © 2018 C. P. Rubenstein 69
End Copyright © 2018 C. P. Rubenstein 70
- Slides: 70