Principles & Applications

Slides:



Advertisements
Similar presentations
Principles & Applications Seven-Segment Displays
Advertisements

Chapter 20 Digital Circuits. Chapter 20 Digital Circuits.
Introduction Digital Electronics Logic Gates De Morgan’s Theorem
Digital Electronics Logic Families TTL and CMOS.
Chapter 2 Digital Electronic Signals and Switches 1.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Lecture – 7 Basic input and output
TIMERS.
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 5 IC Specifications and.
Principles & Applications
Principles & Applications
3. DIGITAL ELECTRONICS..
Digital Fundamentals Floyd Chapter 1 Tenth Edition
Programmable Logic Controllers
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Electronic Troubleshooting Chapter 10 Digital Circuits.
Digital Electronics. Introduction to Number Systems & Codes Digital & Analog systems, Numerical representation, Digital number systems, Binary to Decimal.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals with PLD Programming.
Chapter 1: Digital Computers and Information Illustration at beginning of each Chapter Base 10 Binary Base 2 Octal Base 8 Hex bas
Electronic. Analog Vs. Digital Analog –Continuous –Can take on any values in a given range –Very susceptible to noise Digital –Discrete –Can only take.
Principles & Applications
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Binary Numbers For digital systems, the.
Digital Electronics Principles & Applications Fifth Edition Chapter 2 Numbers We Use in Digital Electronics ©1999 Glencoe/McGraw-Hill Roger L. Tokheim.
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 4 Using Logic Gates Roger.
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 1 Digital Electronics.
This chapter in the book includes: Objectives Study Guide
Digital Circuits ECGR2181 Chapter 3 Notes Data A-data B-data A B here
EKT124 Digital Electronics 1 Introduction to Digital Electronics
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
Invitation to Computer Science, C++ Version, Fourth Edition
Digital Fundamentals Floyd Chapter 3 Tenth Edition
OVER VOLTAGE OR UNDER VOLTAGE
LOAD CUTOFF SWITCH UPON OVER VOLTAGE OR UNDER VOLTAGE
Lecture No. 4 Number Systems
(EVENING ON TO MORNING OFF)
Digital Fundamentals Floyd Chapter 7 Tenth Edition
Introduction Molecules: made up of atoms of individual elements.
Introduction to Logic Gates
9 LEVEL OVERHEAD WATER TANK NDICATOR
Principles & Applications
Principles & Applications and Simple Interfacing
Principles & Applications
Principles & Applications Seven-Segment Displays
Principles & Applications
This chapter in the book includes: Objectives Study Guide
Advanced Digital design
Invitation to Computer Science, Java Version, Third Edition
ECE 434 Advanced Digital System L03
Digital Fundamentals with PLD Programming Floyd Chapter 10
ECET 105 Innovative Education--snaptutorial.com
ECET 105Competitive Success/snaptutorial.com
Lesson 9: Digital Input-Output Signal Interfacing
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /10/2018.
CPE/EE 422/522 Advanced Logic Design L02
Programmable Logic Devices: CPLDs and FPGAs with VHDL Design
Chapter 4 Gates and Circuits.
Digital Circuits ECGR2181 Chapter 3 Notes Data A-data B-data A B here
Digital Electronics Ms. Deepa Mehta.
Digital Logic & Design Lecture 03.
ECE434a Advanced Digital Systems L02
Digital Electronics Lab 2 Instructor:
EET 1131 Unit 13 Multivibrators and the 555 Timer
Digital Fundamentals Floyd Chapter 3 Tenth Edition
EET 1131 Unit 3 Basic Logic Gates
Digital Fundamentals Floyd Chapter 1 Tenth Edition
Digital Fundamentals Floyd Chapter 4 Tenth Edition
CSC3050 – Computer Architecture
Electricity and Circuits
Principles & Applications
Presentation transcript:

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 1 Digital Electronics ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Analog vs. Digital Why Digital or Analog? Generating a Digital Signal Multivibrators Defining Logic Levels Testing for Digital Signals Using a Logic Probe Mounting ICs

Analog vs. Digital Analog signal- one whose output varies continuously in step with the input. Example: Analog Digital signal- one whose output varies at discrete voltage levels commonly called HIGH or LOW (1 or 0). Example: Digital HIGH or 1 LOW or 0 Time

QUIZ A(n) __________ signal is one whose output varies at discrete voltage levels commonly referred to as HIGH or LOW (1 or 0). digital 2. A(n) __________ signal is one whose output varies continuously in step with the input. analog 3. A sine wave (sinusoidal waveform) is an example of a(n) __________ signal. analog 4. A square wave is an example of a(n) __________ signal. digital

Why Digital? Data can be stored (memory characteristic of digital). Data can be used in calculations. Compatible with display technologies. Compatible with computer technologies. Systems can be programmed. Digital IC families make design easier.

Why Analog? Most “real-world” events are analog in nature. Analog processing is usually simpler. Analog processing is usually faster. Traditional electronic systems were mostly analog in nature.

QUIZ Most “real world” measurements (like temperature, speed, pressure, etc.) are __________ (analog, digital) in nature. analog 2. Electronic circuits that store information and make calculations are probably __________ (analog, digital) in nature. digital 3. Electronic devices that can be programmed and have alphanumeric displays probably contain __________ (analog, digital) circuitry. digital 4. Traditional circuitry (as in TVs) was probably __________ (analog, digital) in nature. analog

Generating a Digital Signal (with Switch) 0 V time HIGH undefined LOW +5 V Note: signal goes H, L, H, UNDEFINED, and finally HIGH. CAUTION: Switch bounce may cause problems. Debounced Switch NOTICE– no switch bounce!! Debouncing Latch time HIGH LOW

Multivibrators One-shot (monostable) - an electronic device that emits a single pulse when triggered. Free-running (astable) - an electronic device that oscillates between two stable states (HIGH and LOW). Commonly called a clock in digital systems. Latch (bistable) - an electronic device that has two stable states (HIGH and LOW) and must be triggered to jump from one to the other. Commonly called a flip-flop. Commonly used as temporary memory.

Producing a Digital Pulse Press input One-shot multivibrator The PULSE WIDTH is determined by the design of the multivibrator and NOT how long the input pushbutton is pressed.

Note: This can also be called a clock. A free-running multivibrator produces a continuous string of digital pulses. Free-running multivibrator Note: This can also be called a clock.

QUIZ 1. A(n) __________ (astable, monostable) multivibrator is an electronic device that generates a continuous string of digital pulses. It may also be called a clock or a free-running MV. astable 2. A(n) __________ (astable, monostable) multivibrator is an electronic device that generates a single digital pulse when triggered. monostable 3. A(n) __________ (bistable, monostable) multivibrator is an electronic device that has two stable states. It is also called a flip-flop and is used as a latch to hold data. bistable 4. A(n) __________ (astable, monostable) multivibrator is an electronic device that is sometimes called a one-shot MV. monostable

Defining Logic Levels CAUTION: Logic devices interpret input voltages as either HIGH or LOW. TTL or CMOS IC families have their unique voltage profiles. Both TTL and CMOS IC input voltage profiles are shown below. TTL Family of ICs CMOS Family of ICs CAUTION: Input voltages in the UNDEFINED region may yield unpredictable results. HIGH HIGH 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% Voltage Undefined Undefined LOW LOW

QUIZ 1. An input voltage of +3.5V to a TTL IC (+5V supply) would be considered a __________ (H, L, undefined) logic level. HIGH 2. An input voltage of +0.5V to a TTL IC (+5V supply) would be considered a __________ (H, L, undefined) logic level. LOW 3. An input voltage of +1V to a CMOS IC (+10V supply) would be considered a __________ (H, L, undefined) logic level. LOW 4. An input voltage of +9V to a CMOS IC (+10V supply) would be considered a __________ (H, L, undefined) logic level. HIGH 5. An input voltage of +1.5V to a TTL IC (+5V supply) would be considered a __________ (H, L, undefined) logic level. undefined

Testing for a Digital Signal LED Output Indicators Logic Probe DMM or VOM Oscilloscope Logic Analyzer

Transistor-Driven LED Output Indicator +5 V 150 W 10 kW +5 V Q1 Activate input Switch (mouse click) Positive voltage at base of transistor Turns on Q1 and LED lights 10 kW +5 V Q1

Logic Probe Behavior Versus Logic Levels TTL CMOS 100% 90% 80% HIGH 70% HIGH 60% 50% 40% 30% 20% 10% LOW LOW 0% The logic LOW indicator lights.

Logic Probe Behavior Versus Logic Levels TTL CMOS 100% 90% HIGH 80% 70% HIGH 60% 50% 40% 30% 20% LOW LOW 10% 0% The logic HIGH indicator lights.

Logic Probe Behavior Versus Logic Levels TTL CMOS 100% 90% HIGH 80% 70% HIGH 60% 50% 40% 30% 20% LOW LOW 10% The FLOATING indicator lights. 0% Note: This response varies with the design of the Logic Probe.

Logic Probe Dynamic Response The probe toggles between HIGH and LOW.

Logic Probe Dynamic Response Probes stretch narrow pulses so they are not missed. The probe toggles between HIGH and LOW.

Logic Probe Dynamic Response Pulse stretching also allows high frequencies to be displayed. The probe toggles between HIGH and LOW.

toggle between HIGH and LOW QUIZ A simple handheld instrument for detecting HIGH, LOW, and Undefined digital logic levels is called a __________ (logic analyzer, logic probe). logic probe 2. In the lab, a simple LED indicator circuit can be built using a __________ (transistor, voltage comparator) to drive the LED. transistor 3. In CMOS (using a 10V power supply), a voltage of 9V would light the __________ (HIGH, LOW, Undefined) indicator on a logic probe. HIGH 4. In TTL (using a 5V power supply), a voltage of 0.2V would light the __________ (HIGH, LOW, Undefined) indicator on a logic probe. LOW 5. If the input to a logic probe is 50Hz square wave, the output would __________ (read HIGH, toggle between HIGH and LOW). toggle between HIGH and LOW

Mounting ICs: Insertion Technology Device leads pass through holes in the circuit board. Solder

Surface Mount Technology Mounting ICs: Surface Mount Technology Solder Devices placed by automatic equipment Circuit boards cost less (fewer holes) Higher connection density Smaller and less expensive products Difficult to repair

REVIEW Analog vs. Digital Why Digital or Analog? Generating a Digital Signal Multivibrators Defining Logic Levels Testing for Digital Signals Using a Logic Probe Mounting ICs

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 2 Numbers We Use in Digital Electronics ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Counting in Decimal and Binary Place Value Binary to Decimal Conversion Decimal to Binary Conversion Electronic Translators Hexadecimal Numbers Octal Numbers Bits, Bytes and Words

Counting in Decimal and Binary Number System - Code using symbols that refer to a number of items. Decimal Number System - Uses ten symbols (base 10 system) Binary System - Uses two symbols (base 2 system)

QUIZ 1. The __________ (binary, octal) number system uses only the symbols 0 and 1 in counting. binary decimal 2. The __________ (decimal, hexadecimal) number system uses the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. 3. The __________ (binary, decimal) number system is also called the base 2 system because it uses only two symbols to represent numbers. binary

Place Value Numeric value of symbols in different positions. Example - Place value in binary system: Place Value 8s 4s 2s 1s Binary Yes Yes No No Number 1 1 RESULT: Binary 1100 = decimal 8 + 4 + 0 + 0 = decimal 12

Binary to Decimal Conversion Convert Binary Number 110011 to a Decimal Number: Binary 1 1 0 0 1 1 Decimal 32 + 16 + 0 + 0 + 2 + 1 = 51

QUIZ 9 Binary 1001 = 15 Binary 1111 = 2 Binary 0010 = Convert the following binary numbers into decimal numbers: 9 Binary 1001 = 15 Binary 1111 = 2 Binary 0010 =

Decimal to Binary Conversion Divide by 2 Process Decimal # 13 ÷ 2 = 6 remainder 1 6 ÷ 2 = 3 remainder 0 3 ÷ 2 = 1 remainder 1 Divide-by-2 Process Stops When Quotient Reaches 0 1 ÷ 2 = 0 remainder 1 1 1 1

QUIZ Convert the following decimal numbers into binary: Decimal 11 = 1011 0100 Decimal 4 = 10001 Decimal 17 =

Electronic Translators Devices that convert from decimal to binary numbers and from binary to decimal numbers. Encoders - translates from decimal to binary Decoders - translates from binary to decimal

Electronic Encoder – Decimal to Binary Binary output Decimal input 0 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 Decimal to Binary Encoder 3 7 5 Encoders are available in IC form. This encoder translates from decimal input to binary (BCD) output.

Electronic Decoding – Binary to Decimal Binary input Decimal output 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 Binary-to- 7-Segment Decoder/ Driver Electronic decoders are available in IC form. This decoder translates from binary to decimal. Decimals are shown on an 7-segment LED display. This decoder also drives the 7-segment display.

QUIZ 1. The general name for an electronic device that translates from binary to decimal is a(n) __________. decoder 2. The general name for an electronic device that translates from decimal to binary is a(n) __________. encoder 3. An electronic device called a(n) __________ (decoder, encoder) would probably be located between the keypad of a calculator and its processing circuitry to translate from decimal to machine language (binary). encoder

Hexadecimal Number System Uses 16 symbols - Base 16 System 0-9, A, B, C, D, E, F Decimal 1 9 10 15 16 Binary 0001 1001 1010 1111 10000 Hexadecimal 1 9 A F 10

Hexadecimal and Binary Conversions Hexadecimal to Binary Conversion Hexadecimal C 3 Binary 1100 0011 Binary to Hexadecimal Conversion Binary 1110 1010 Hexadecimal E A

Decimal to Hexadecimal Conversion Divide by 16 Process Decimal # 47 ÷ 16 = 2 remainder 15 Divide-by-2 Process Stops When Quotient Reaches 0 2 ÷ 16 = 0 remainder 2 2 F

Hexadecimal to Decimal Conversion Convert hexadecimal number 2DB to a decimal number 256s 16s 1s Place Value 2 D B Hexadecimal (256 x 2) (16 x 13) (1 x 11) 512 + 208 + 11 = 731 Decimal

QUIZ Convert Hexadecimal number A6 to Binary A6 = Convert Hexadecimal number 16 to Decimal 16 = 22 (Decimal) Convert Decimal 63 to Hexadecimal 63 = 3F (Hexadecimal)

Uses 8 symbols - Base 8 System Octal Numbers Uses 8 symbols - Base 8 System 0, 1, 2, 3, 4, 5, 6, 7 Decimal 1 6 7 8 9 Binary 001 110 111 001 000 001 001 Octal 1 6 7 10 11

QUIZ The octal number 7 equals ______ in binary. 111 2. The octal number 11 equals ______ in binary. 001 001 3. The decimal number 23 equals ______ in binary. 010 111 4. The decimal number 23 equals ______ in octal. 27 5. The octal number 37 equals ______ in binary. 011 111 6. The octal number 37 equals ______ in decimal. 31

Practical Suggestion on Number System Conversions Use a scientific calculator Most scientific calculators have DEC, BIN, OCT, and HEX modes and can either convert between codes or perform arithmetic in different number systems. Most scientific calculators also have other functions that are valuable in digital electronics such as AND, OR, NOT, XOR, and XNOR logic functions.

Groupings of Binary Digits Bit 1-bit (0 or 1) Nibble 4-bits (such as 1101) Byte 8-bits (such as 1100 0111) Word 16-bits (common definition) Double-word 32-bits Quad-word 64-bits

QUIZ A 4-bit grouping of binary digits is called a _____ (byte, nibble). nibble 2. An byte refers to an a(n) _____ (8, 64)-bit group of binary digits. 8 3. A single binary digit (such as a 0 or 1) is called a _____ (bit, nibble). bit 4. A common definition for a word in computer jargon is a _____ (1, 16)-bit group of binary digits. 16

REVIEW Counting in Decimal and Binary Place Value Binary to Decimal Conversion Decimal to Binary Conversion Electronic Translators Hexadecimal Numbers Octal Numbers Bits, Bytes and Words

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 3 Logic Gates ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION The AND Gate Gates with More Than Two Inputs The OR Gate The Inverter The NAND Gate The NOR Gate The XOR Gate The XNOR Gate NAND as Universal Gate Gates with More Than Two Inputs Using Inverters to Convert Gates TTL & CMOS Gates Troubleshooting Gating Circuits IEEE Logic Symbols Logic Functions using Software

“All or Nothing Gate” Boolean Expression: A · B = Y Truth Table (See next slide) The AND Gate

Truth Table - AND Gate

What is the output of the AND gate? QUIZ What is the output of the AND gate? L ? H ? Low High L H ? ? H L Low Low Unique Output: Output HIGH only when all inputs are HIGH.

The OR Gate “Any or All Gate” Boolean Expression: A + B = Y Truth Table (See next slide) The OR Gate

Truth Table - OR Gate

What is the output of the OR gate? QUIZ What is the output of the OR gate? ? ? H H L High High ? ? L L H Low High Unique Output: Output LOW only when all inputs are LOW.

The Inverter NOT Circuit Gives output that is not the same as the input. Boolean Expression: Y = A or Y = A‘ Double inverting: A = A NOT gate inverts, or complements, or negates The Inverter

QUIZ If the input to an inverter is LOW, the output will be __________. HIGH 2. If the input to an inverter is HIGH, the output will be __________. LOW 3. A NOT gate is said to invert, to negate or to complement the input. (True or False) True 4. A NOT gate is also called commonly called a(n) __________ (AND gate, inverter). inverter

The NAND Gate NOT AND or inverted AND function. Boolean Expression: A · B = Y or (A · B)' = Y Truth Table (See next slide) The NAND Gate

Truth Table - NAND Gate

What is the output of the NAND gate? QUIZ What is the output of the NAND gate? ? ? L L H High High ? ? H L H Low High Unique Output: Output LOW only when all inputs are HIGH.

NOT OR or Inverted OR Boolean Expression: A + B = Y or (A + B)' = Y Truth Table (See next slide) The NOR Gate

Truth Table - NOR Gate

QUIZ What is the output of the NOR gate? ? ? ? ? L L H High Low H L H Unique Output: Output HIGH when all inputs are LOW.

Known as “Exclusive OR” Gate “Anything but not all” Gate Boolean Expression: A  B = Y Truth Table (See next slide) The XOR Gate

Truth Table - XOR Gate

What is the output from the XOR gate? QUIZ What is the output from the XOR gate? L ? ? L H ? Low High ? H ? H L High ? Low XOR output is HIGH only when odd number of inputs are HIGH

The XNOR Gate Known as the Exclusive NOR Gate The Inverted XOR Boolean Expression: A  B = Y or (A  B)' = Y Truth Table (See next slide) The XNOR Gate

Truth Table - XNOR Gate

QUIZ What is the output from this XNOR gate? ? ? ? High Low High Low ? XNOR output is HIGH only when odd number of inputs are LOW

The NAND as a Universal Gate “Universal gate” can be used in combination to create any other logic function. Example: Shorting NAND inputs Yields the NOT logic function Equal to the OR logic function A + B

QUIZ 1. NAND gates can be wired together to convert to other logic functions (True or False). True 2. These two NAND gates wired together will produce the ______ (AND, XOR) logic function. AND

Using Inverters to Convert Gates For example:

QUIZ 1. This combination of gates will generate the ______ (NAND, OR) logic function. NAND 2. This combination of gates will generate the ______ (AND, OR) logic function. AND

Practical Logic Gates ICs - Integrated Circuit Form TTL Family of ICs CMOS Family of ICs TTL = Transistor-Transistor Logic CMOS = Complementary Metal Oxide Semiconductor

transistor-transistor logic QUIZ 1. Practical logic gates (AND-, OR-, NAND-, NOT-gates) are packaged in __________ form. IC 2. Two popular families of ICs used to manufacture logic gate ICs are __________. TTL and CMOS 3. In digital electronics, TTL commonly refers to a family of ICs. TTL stands for __________. transistor-transistor logic 4. In digital electronics, logic gates are manufactured using either TTL or __________ technology. CMOS

Troubleshooting Simple Gate Circuits Logic probe - equipment used to test circuits Feel top of IC to determine if it is hot Look for broken connections, signs of excessive heat Smell for overheating Check power source Trace path of logic through circuit

QUIZ 1. A simple hand-held instrument called a __________ (logic probe, oscilloscope) can be used for troubleshooting simple logic gate circuits. logic probe 2. The first three steps in troubleshooting are to use your senses to (1) feel the top of the ICs for overheating, (2) look for broken connections, and (3) __________ for signs of overheating. smell 3. The fourth step in troubleshooting is to use a logic probe to check the power sources. (True or False) True

1 IEEE Logic Symbols A different set of symbols without unique shapes. Not very popular at this time. Examples: & A B Y AND gate A B Y 1 OR gate

Programming Logic Functions using the BASIC Stamp® Module One trend in electronics is the development of programmable ICs. A second trend in electronics is the use a billions of inexpensive embedded devices called microcontrollers. A popular microcontroller used extensively by schools is the BASIC Stamp® module by Parallax, Inc. BASIC Stamp® modules are programmed using a student-friendly version of B.A.S.I.C. Programming of the BASIC Stamp® is done on a PC. The program is downloaded into the BASIC Stamp®. The downloaded programmed is then held in the BASIC Stamp® module’s memory. The program starts at the beginning each time power to the module is turned on.

QUIZ microcontroller PC True The BASIC Stamp® module contains a programmable device called a _____. microcontroller 2. Programming for the BASIC Stamp® is done on a _____ (cell phone, PC) and then downloaded into the module’s memory. PC 3. A microcontroller is an inexpensive programmable device that is commonly embedded in everyday appliances, etc. (True or False) True

Using the BASIC Stamp® Module Step 1: Program the BS2 module using in PBASIC language. The key line of code is: Y = A & B which represents AB=Y or input A ANDed with input B. Digital Inputs Input A = HIGH Input B = HIGH Step3: Disconnect PC. Input A = LOW Input B = LOW A Input A = HIGH Input B = LOW B Step 4: Turn power OFF and then ON. The program will start at the beginning. Observe the outputs with different inputs. Step 2: Download the PBASIC program from the PC to the BASIC Stamp® 2 module. Digital Output HIGH LOW LOW Y

PBASIC Code for Logic Functions Logic Function PBASIC code for BS2 AND Y = A & B OR Y = A | B NOT Y = ~A NAND Y = ~(A & B) NOR Y = ~(A | B) XOR Y = A ^ B XNOR Y = ~(A ^ B)

QUIZ Y = A | B Y = ~(A & B) Y = A ^ B 1. What is the PBASIC code used when programming the BASIC Stamp® module for the 2-input OR logic function? Y = A | B 2. What is the PBASIC code used when programming the BASIC Stamp® module for the 2-input NAND logic function? Y = ~(A & B) 3. What is the PBASIC code used when programming the BASIC Stamp® module for the 2-input XOR logic function? Y = A ^ B

REVIEW The AND Gate Gates with More Than Two Inputs The OR Gate The Inverter The NAND Gate The NOR Gate The XOR Gate The XNOR Gate NAND as Universal Gate Gates with More Than Two Inputs Using Inverters to Convert Gates TTL & CMOS Gates Troubleshooting Gating Circuits IEEE Logic Symbols Logic Functions using Software

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 4 Using Logic Gates ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Logic Circuit from a Boolean expression Minterm and maxterm Boolean expressions Boolean expression from a truth table Truth table from a Boolean expression Simplifying Boolean expressions Karnaugh mapping NAND logic

INTRODUCTION (continued) Data selectors and their use Solving logic problems with data selectors Using computer simulations Variations in Boolean expressions DeMorgan’s theorem PLDs (programmable logic devices) BASIC Stamp® modules

“Tools of the Trade” for Solving Logic Problems Gate symbols Truth tables Boolean expressions Combinational logic circuits: AND-OR pattern of gates from Sum-of-products Boolean expression such as: AB + CD = Y AND-OR pattern of gates OR-AND pattern of gates from Product-of-sums Boolean expression such as: (A+B) (C+D) = Y OR-AND pattern of gates

Logic Circuit From Boolean Expression Example: Draw the AND-OR logic diagram for the Boolean expression: AB + CD = Y Step 1: OR AB with CD Step 2: Add top AND gate Step 3: Add bottom AND gate ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ Draw the OR-AND logic diagram for the Boolean expression: (A+B) • (C+D) = Y Step 1: Step 2: Step 3:

Boolean Expressions Sum-of-products form: Product-of-sums form: A • B + C • D = Y Also called the minterm form Product-of-sums form: (A + B) • (C + D) = Y Also called the maxterm form

QUIZ 1. The Boolean expression AB + BC = Y is in __________ (product-of-sums, sum-of-products) form. sum-of-products 2. The Boolean expression (A+B) (B+C) + Y is in __________ (product-of-sums, sum-of-products) form. product-of-sums 3. The Boolean expression (A+B) (B+C) = Y is in __________ (maxterm, minterm) form. maxterm 4. The Boolean expression AB + BC = Y is in __________ (maxterm, minterm) form. minterm

Boolean Expression from Truth Table Write the Boolean expression that describes the logic in this truth table. Truth Table Input Output ABC Y 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 Step 1: Focus only on the truth table lines with outputs of 1. Step 2: AND the inputs for these two lines and logically OR the ANDed groups. A • B • C A • B • C = Y + Minterm Boolean expression: A B C A B C = Y +

QUIZ Truth Table Input Output ABC Y 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 Write the Boolean expression that describes the logic in this truth table. A • B • C A • B • C = Y + Minterm Boolean expression: A B C A B C = Y +

QUIZ Truth Table Input Output ABC Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1. Write the sum-of-products Boolean expression for this truth table. ______________________________ A’BC + ABC = Y 1 2. Write the minterm Boolean expression for this truth table. ______________________________ A’BC + ABC = Y

Truth Table From Boolean Expressions Fill in a truth table from a minterm Boolean Expression. Minterm Boolean expression: A•B•C = Y + Truth Table Input Output ABC Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Step 1: Place three 1s in output column. 1 Step 2: Place five 0s in blanks in output column of truth table. 1 1

Truth Table from Boolean Expressions Fill in a truth table from a minterm Boolean Expression. Minterm Boolean expression: = Y A • B A • B • C + Truth Table Input Output ABC Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Step 1: Place single 1 output column for term with three variables. 1 Step 2: Place two 1s in output column for term with two variables. Step 3: Fill in 0s. 1

QUIZ 1. Fill in the output column of the truth table for the Boolean expression A’B’C’ + ABC’ = Y. Truth Table Input Output ABC Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1

QUIZ 1. Fill in the output column of the truth table for the Boolean expression A’B’ + AB’C = Y. Truth Table Input Output ABC Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1

Simplifying Boolean Expressions Truth Table Input Output ABC Y 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Unsimplified Boolean Expression A•B•C = Y + 1 This line is not to be considered in the loop. This line is not to be considered in the loop. This line is not to be considered in the loop. This line is not to be considered in the loop. Simplified Expression: A•B A•C = Y + RULE: Eliminate term within loop that contains a term and its complement.

Simplify Boolean Expression (Karnaugh map method) Unsimplified Boolean expression (3 variables): A•B•C = Y + _ C C Step 1: Plot 1s C _ _ A B 1 1 Step 2: Loop groups _ A B Step 3: Eliminate variables 1 Step 4: Form simplified minterm expression A B _ A B 1 B C B C A C + A B = Y Simplified Expression:

Simplify Boolean Expression QUIZ Simplify Boolean Expression (Karnaugh map method) Unsimplified Boolean expression (4 variables): ABCD = Y + Step 1: Plot 1s _ _ _ C D C D _ C D C D Step 2: Loop groups _ _ A B 1 1 Step 3: Eliminate variables _ A B Step 4: Form simplified minterm expression A B 1 _ A B 1 B D B D ABC ACD Simplified Expression: + = Y

Developing a NAND Logic Diagram Minterm expression: AB + AB = Y Step 1: Draw AND-OR logic diagram from minterm expression. Step 2: Substitute NAND gates for each inverter, AND, and OR gate. NOTE: Both logic diagrams will generate the same truth table.

1-OF-8 Data Selector Logic Symbol: Data Inputs Data Selector 1 2 3 4 5 1 2 3 4 5 6 7 C B A W Data Inputs Output Data Select Inputs

QUIZ ? What is the output from the data selector? 1-of-8 Data Selector 1 2 Data Inputs 1 3 LOW HIGH LOW HIGHH 4 W ? 1 5 1 6 7 C B A Data Select Inputs: 1 1 1 1 0 1 0 0 1 0 0 0

QUIZ Use the data selector to perform the logic described in the truth table Truth Table C B A Y 1-of-8 Data Selector 0 0 0 1 1 0 0 1 0 1 0 1 0 0 2 0 1 1 1 1 3 HIGH HIGH LOW 1 0 0 0 4 W ? 1 0 1 1 1 5 1 1 0 1 1 6 1 1 1 0 7 C B A 1 1 0 0 0 1 0 1 1

Converts back and forth from Circuit Simulation - Using the Logic Converter Conversion options Truth table area Converts back and forth from Boolean expression, truth table, and logic diagram Boolean expression area Screen from Electronics Workbench® or MultiSIM® ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

Truth Table to Boolean Expression Step1: Click number of variables. Step2: Fill in truth table. Step3: Click truth table to Boolean expression conversion option. Unsimplified Boolean Expression appears here A’B’C+A’BC+AB’C’+AB’C+ABC

Simplifying the Boolean Expression Step1: Click number of variables. Step2: Fill in truth table. Step3: Click truth table to simplified Boolean expression conversion option. Simplified Boolean Expression appears here AB’ + C

into this AND-OR logic diagram by the simulation software Boolean Expression to Logic Diagram Step1: Type the Boolean expression. Step2: Click Boolean expression to logic diagram conversion option. Step3: Close Logic Converter window. AB’+C=Y is converted into this AND-OR logic diagram by the simulation software AB’ + C

QUIZ 1. A circuit simulator such as Electronic Workbench® or MultiSIM® contain a useful instrument called a __________ (logic converter, logic probe) used to convert back and forth from truth table to Boolean expression. logic converter 2. The logic converter instrument from Electronic Workbench® or MultiSIM® can convert back and forth from logic diagram to Boolean expression. (True or False) True

Variations in Boolean Expressions Boolean expression (textbook style): A B + C D = Y A + B = Y A B = Y Boolean expression (keyboard style): A’B + CD’ = Y (A + B)’ = Y A’ B’ = Y

QUIZ 1. The Boolean expression A B + C D = Y is written as _______ in keyboard style. A B’ + C’D = Y 2. The Boolean expression A+B+C = Y is written as _______ in keyboard style. (A+B+C)’ = Y 3. The Boolean expression A B C = Y is written as _______ in keyboard style. A’ B’ C’ = Y

DeMorgan’s Theorems First theorem: Second theorem: A + B = A B Both used to eliminate long overbars Second theorem: A B = A + B

DeMorgan’s Theorems First theorem: Second theorem: A + B = A B

FINISHED (alternative NAND expression) DeMorgan’s Theorems A B = Y START > A B = Y Step 1: Change all ORs to ANDs and all ANDs to ORs. A + B = Y Step 2: Complement each individual variable (short overbar). A + B = Y Step 3: Complement the entire function (long overbar). FINISHED (alternative NAND expression) Step 4: Eliminate all groups of double overbars. A + B = Y (click to see final Boolean expression)

QUIZ The statement A B = A + B is DeMorgan’s __________ (first, second) theorem and suggests converting from a NAND to an OR situation. second 2. The statement A + B = A B is DeMorgan’s __________ (first, second) theorem and suggests converting from a NOR to an AND situation. first

PLDs Programmable Logic Device (PLD) - The generic name for an IC that can be programmed by the user to execute a complex logic function. PLDs have many inputs and outputs. PLDs can be used to implement minterm Boolean expressions using AND-OR logic. More complex PLDs have latches and other memory devices. PLDs have several advantages. PLDs are inexpensive, can be programmed by the user, and very reliable.

PLDs (continued) PLD is generic for a programmable logic device, but are also known by many other names including: PAL - programmable array logic GAL - generic array logic FPL - fuse-programmable logic PLA - programmable logic array PEEL - programmable electrically erasable logic FPGA - field programmable gate array CPLD - complex programmable logic device

QUIZ 1. PLD is the generic name for a __________ (peripheral logic driver, programmable logic device) which is an IC that can solve logic problems. programmable logic device 2. PLDs commonly have many inputs but always have only one output. (True or False) False 3. PLDs have several advantages including they can be programmed in the local lab or school, are very reliable, and inexpensive. (True or False) True 4. Various manufacturers might refer to PLDs by acronyms like TTLs, CMOSs, PALs, ASCIIs, ASVABs, CPLSs, FPGAs, PEELs, or GALs. (True or False) False

Programming Logic Functions using the BASIC Stamp® Module One trend in electronics is the development of programmable ICs. A second trend in electronics is the use of billions of inexpensive imbedded devices called microcontrollers. A popular microcontroller used by schools is the BASIC Stamp® module, by Parallax, Inc. BASIC Stamp® modules are programmable using a student-friendly version of B.A.S.I.C. Solving a logic problem using a microcontroller (BASIC Stamp® 2 module) is detailed on the next slide.

Using the BASIC Stamp® Module INPUTS A B C 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 RED Y1 1 GREEN Y2 YELLOW Y3 Truth Table Digital Inputs A B Y1 Digital Outputs C Y2 Y3 Step 3: Disconnect PC from BS2 module Input A = LOW Input B = LOW Input C = LOW Step 1: Write program on PC in PBASIC. Key lines of code are: Y1=(A&B&C)|(~A&~B&~C) Y2=(~A&~B)|(A&C) Y3=(~A)|(~B&C) Input A = LOW Input B = LOW Input C = HIGH Input A = HIGH Input B = LOW Input C = LOW Logic Expressions in PBASIC: Y1= (A&B&C)|(~A&~B&~C) Y2= (~A&~B)|(A&C) Y3= (~A)|(~B&C) HIGH LOW LOW Step 2: Download program from PC to BS2 module. Step 4: Power OFF and ON (BS2 module). Manipulate inputs and observe outputs. HIGH HIGH LOW HIGH HIGH LOW

QUIZ 1. The BASIC Stamp® module contains an inexpensive programmable IC called a _____. microcontroller 2. The BASIC Stamp® module is programmed using a version of B.A.S.I.C. on a _____ (modem, PC) and then downloaded into the BS2 module. PC (Personal Computer) 3. A BASIC Stamp® (such as the BS2 module) will always have many inputs but only one output. (True or False) False 4. Programming the BASIC Stamp® module is done using an easy-to-use language called _____ (PBASIC, MICRO). PBASIC

REVIEW Logic Circuit from a Boolean expression Minterm and maxterm Boolean expressions Boolean expression from a truth table Truth table from a Boolean expression Simplifying Boolean expressions Karnaugh mapping NAND logic

REVIEW (continued) Data selectors and their use Solving logic problems with data selectors Using computer simulations Variations in Boolean expressions DeMorgan’s theorem PLDs (programmable logic devices) BASIC Stamp® modules

Principles & Applications and Simple Interfacing Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 5 IC Specifications and Simple Interfacing ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Logic Levels/Noise Margin Interfacing Families of ICs Other Specifications MOS and CMOS ICs Interfacing with Switches Interfacing with LEDs Interfacing with Buzzers, Relays, Motors and Solenoids

INTRODUCTION (Continued) Interfacing Using an Optoisolator Current Sourcing and Sinking Using a Stepper Motor Using a Servo Motor Hall-effect Sensor/Switch Using the Hall-effect Switch BASIC Stamp® Driving a Servo

Logic Levels / Noise Margin Voltage characteristic - defines logical 0 (LOW) or logical 1 (HIGH) Noise immunity (noise margin)- logic circuit’s insensitivity or resistance to undesired voltages called “noise.” TTL Voltage Profiles Chart Input Output 2.0 - 5.5V LOW GND - 0.8V HIGH 2.4 - 5.5V (3.5V typical) GND - 0.4V (0.1V typical)

QUIZ 1. An input voltage of 0.4V to a TTL IC (5V power supply) would be interpreted as a logical __________ (0 or LOW, 1 or HIGH). 0 or LOW 2. An input voltage of 3V to a TTL IC (5V power supply) would be interpreted as a logical __________ (0 or LOW, 1 or HIGH). 1 or HIGH 3. A typical HIGH output from a TTL IC (5V power supply) would be about __________ (0.1V, 3.5V). 3.5V 4. A logic circuit’s insensitivity or resistance to undesired voltages (called noise) is __________ (noise margin, noise clutter). noise margin

Input Voltage Profiles – Output V profile differs TTL and 4000 Series CMOS Input Voltage Profiles TTL CMOS 100% +5V +10V 90% 80% HIGH 70% HIGH 60% 50% CAUTION Output V profile differs Other families V profile differs HIGH +7V to +10V - CMOS +2V to +5V - TTL Undefined logic probe reading may vary depending on manufacturer Undefined +3 to +7V for CMOS +0.8V to +2.0V for TTL LOW 0 to +3V for CMOS 0 to +0.8V in TTL 40% 30% 20% 10% LOW LOW 0% GND

QUIZ 1. An inexpensive hand-held instrument called a __________ (logic probe, oscilloscope) is commonly used to check logic levels in TTL or CMOS circuits. logic probe 2. An input voltage of 1V to a CMOS IC (10V power supply) would be interpreted as a(n) __________ (HIGH, LOW, undefined) input. LOW 3. An input voltage of 5V to a CMOS IC (10V power supply) would be interpreted as a(n) __________ (HIGH, LOW, undefined) input. undefined 4. An input voltage of 9V to a CMOS IC (10V power supply) would be interpreted as a(n) __________ (HIGH, LOW, undefined) input. HIGH

QUIZ TTL Voltage Profiles H H ? ? ? HIGH LOW HIGH ? ? Undefined Low INPUT OUTPUT H Low +5V +2V +0.8V GND +5V +2.4V +0.4V GND H Low Input = +0.3V Output = ? Input = +4V Output = ? ? Input = +1.2V Output = ? ? Input = +2.2V Output = ? ? HIGH Undefined LOW HIGH ? ?

TTL-to-CMOS Interfacing Interfacing is the design of circuitry between devices. Interface circuitry shifts levels of voltage & current for compatibility. TTL and CMOS HIGH and LOW voltage profiles are different. Current requirements for TTL and CMOS are different. Example: Pull up resistor Design Notes: 1. Output current of TTL OK to drive CMOS device. 2. Output voltage profile does NOT fit CMOS input voltage profile. 3. Use pull up resistor as interface device to adjust voltage profiles. Standard TTL CMOS

QUIZ 1. The design of circuitry that translates voltages and currents between devices (such as between TTL and CMOS) is called __________ (boundary scanning, interfacing). interfacing 2. Interface circuitry shifts levels of __________ (current and voltage, time and temperature) for compatibility between two devices or circuits. current and voltage 3. In TTL-to-CMOS interfacing, a __________ (pull-up, temperature-sensitive) resistor is used to shift voltage levels. pull-up 4. The voltage profiles for TTL and CMOS are __________ (different, the same). different

CMOS-to-TTL Interfacing Interfacing is the design of circuitry between devices. Interface circuitry shifts levels of current & voltage for compatibility. CMOS and TTL voltage profiles are different. Current requirements for CMOS and TTL are different. Example: Design Notes: 1. Output voltage profile of CMOS is OK to drive TTL inputs. 2. Output current from CMOS is NOT enough to drive standard TTL. 3. Use special purpose CMOS buffer IC to adjust the current levels. CMOS buffer (like 4050 IC) CMOS Standard TTL

QUIZ 1. The design of circuitry to make TTL-to-CMOS or CMOS-to-TTL connections is called __________. interfacing 2. TTL and CMOS voltage profiles are __________ (different, the same). different 3. TTL and CMOS current input requirements and output drive capabilities are __________ (different, the same). different 4. Interfacing standard TTL-to-CMOS involves using a(n) __________ (buffer, pull-up resistor) between the input TTL and CMOS devices. pull-up resistor

Other Digital IC Specifications Drive Capabilities - sometimes referred to as fan-in or fan-out. Fan Out - number of inputs of a logic family that can be driven by a single output. The drive capability of outputs. Fan In - the load an input places on an output. Propagation Delay - has to do with the “speed” of the logic element. Lower propagation delays mean higher speed which is a desirable characteristic. Power Dissipation - generally, as propagation delays decrease, power consumption and heat generation increase. CMOS is noted for low power consumption.

QUIZ fan out 1. The __________ (fan out, quantum equivalence) refers to the drive capability of the outputs of a digital IC. 2. Faster digital ICs (a desirable characteristic) have __________ (higher, lower) propagation delays. lower 3. The __________ (CMOS, TTL) family of digital ICs is known for its very low power consumption and is commonly used in battery powered products. CMOS

QUIZ fan out low high low 1. The drive capability of logic device outputs is sometimes called __________ (fan in, fan out). It is the number of inputs of a logic family that can be driven by a single output. fan out 2. CMOS devices are noted for their extremely __________ (high, low) power consumption. low 3. A logic device with a low propagation delay would be considered to be a __________ (high, low) speed device. high 4. Several desirable characteristics of logic devices are good drive capabilities, low power consumption, and __________ (high, low) propagation delays. low

MOS and CMOS ICs MOS stands for Metal-Oxide Semiconductor. PMOS, NMOS, and CMOS are three technologies used to manufacture ICs. TTL is another very fast technology. NMOS stands for Negative-channel Metal-Oxide Semiconductor. NMOS ICs are faster than PMOS. PMOS stands for Positive-channel Metal-Oxide Semiconductor. CMOS stands for Complementary Metal-Oxide Semiconductor. Both PMOS and NMOS devices are used it its manufacture. CMOS ICs are noted for exceptionally low power consumption. CMOS ICs were slower than bipolar digital ICs (such as TTL devices). Transmission gates or bilateral switches are unique digital devices created using CMOS technology.

QUIZ 1. The MOS part of CMOS stands for metal-oxide semiconductor which is a technology used in producing ICs with __________ (high, low) power requirements. low 2. PMOS, NMOS and CMOS are three technologies that use field-effect transistors to fabricate modern digital ICs. (True or False) True 3. CMOS stands for negative-channel metal-oxide semiconductor and is a type of extremely high-speed high-power consumption digital IC. (True or False) False

Interfacing with Switches Switch-to-TTL interfaces +5V Pull up resistor Pull up resistor Pull up resistor HIGH LOW HIGH LOW Pull down resistor Pull down resistor Pull down resistor INPUT pulled HIGH by pull up resistor INPUT pulled HIGH by pull up resistor INPUT pulled HIGH by switch INPUT pulled LOW by pull down resistor INPUT pulled LOW by pull down resistor INPUT pulled LOW by switch INPUT pulled HIGH by switch INPUT pulled LOW by switch Switch-to-CMOS interfaces With pull up resistor With pull down resistor

QUIZ 1. The component labeled A in the interfacing circuit is called a __________ (pull-down, pull-up) resistor and is holding the input to the inverter HIGH. A pull-up 2. The component labeled B in the interfacing circuit is called a __________ (pull-down, pull-up) resistor and is holding the input to the inverter LOW. pull-down B C 3. The output at point C is currently __________ (HIGH, LOW) because the pull-down resistor is holding the inverter’s input LOW. HIGH

Switch Debouncing Mechanical switches that serve as inputs for some digital circuits (like counters) may need switch debouncing. A Low-to-High switch transition can result in H-L-H bounces. A demonstration of a debouncing circuit in action. Notice No switch bounce! Debouncing Latch time HIGH LOW

QUIZ 1. The output waveform at A going L-H-L-H is referred to as a(n) __________ (analog, digital) signal. digital 2. The block labeled B is a switch __________ latch. debouncing 3. The L-H-L-H output of the SPDT switch on the left is debounced by the electronic device labeled B. (True or False) True A B HIGH LOW time

Interfacing TTL or CMOS to LEDs +5 V Either TTL or CMOS ICs can drive an LED using a transistor. 150 W Left arrow key on keyboard to erase and see action again. HIGH LOW Transistor ON LOW TTL or CMOS HIGH Off 33 kW

QUIZ 1. If point A goes HIGH point B will go LOW and the transistor will turn off causing the LED to __________ (turn off, turn on). turn off 2. If point B goes HIGH and the transistor will turn on causing the LED to __________ (turn off, turn on). turn on +5V A B LED 3. The inverter can be from either the TTL or CMOS family of ICs and be able to drive the indicator LED. (True or False) True

Interfacing with Buzzers, Relays, Motors & Solenoids Piezo buzzer - a signaling device drawing less current than older buzzers and bells. DC or AC motors - produce continuous rotary motion. (Motor voltages and current not compatible with logic circuits.) Solenoid - a device that can produce linear motion. Relay - a device to isolate logic device from high-voltage/current circuit. Optoisolator - a device to isolate logic device from high-voltage/current circuit.

Interfacing with a Piezo Buzzer Left arrow on keyboard to erase and see action again. No sound Buzzer sounds Transistor OFF LOW Transistor ON HIGH Goes HIGH Goes LOW

QUIZ 1. When the input to the inverter goes LOW, the buzzer __________ (does not sound, sounds). sounds 2. When the input to the inverter goes HIGH, the input to the transistor goes LOW which turns __________ (OFF, ON) both the transistor and the buzzer. OFF

Isolation-Logic to High Voltage/Current Electromechanical Relays - older method of isolation. Relays are expensive, heavy, and produce “noise.” Optoisolator (Optocoupler) - light weight alternative to electromagnetic relay when interfacing with logic circuits. Solid State Relay - a heavy-duty version of an optoisolator.

Interfacing Using a Relay N.O. relay contacts Electromechanical Relay Driver Transistor Left arrow key on keyboard to erase and view again. High Voltage (12V) Side of circuit DC Motor (12 Volt) Low Voltage (+5V) Side of circuit

N.O. contacts remain open N.O. contacts snap closed Interfacing Using a Relay to Control a DC Motor Coil not energized N.O. contacts remain open DC motor does not run Coil energized N.O. contacts snap closed DC motor runs HIGH LOW LOW Transistor Off HIGH Transistor ON (Left arrow key on keyboard to erase and view again)

QUIZ 1. If the input to the inverter is LOW, the transistor will turn ON and the relay coil will be energized. (True or False) True 2. If the input to the inverter is LOW, the transistor will turn ON, the relay coil will be energized, the N.O. relay contacts close, and the motor will run. (True or False) True 3. If the input to the inverter is HIGH, the DC motor __________ (will, will not) run. will not ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

Optical Isolation 120 VAC 5 VDC Load ground Logic ground Solid state relay or optoisolator 5 VDC Load ground (Left click for L-to-H input signal) Logic ground

Interfacing Using on Optoisolator Left arrow key on keyboard to erase and view again) Buzzer sounds No Sound HIGH LOW LOW at pin 2 of IC LED lights ICs transistor ON HIGH at pin 2 of IC LED does not light Transistor OFF (Left click for action)

ON and the buzzer sounds QUIZ 1. If the input to the inverter is HIGH, the LED inside the optoisolator lights, the transistor turns __________ (ON and the buzzer sounds, OFF and the buzzer is silent). ON and the buzzer sounds 2. The optoisolator IC isolates the lower voltage (5V) input from the higher voltage (12V) output. (True or False) True 3. There is a low resistance electrical connection between the input logic circuits and the output buzzer circuit because of the optoisolator IC. (True or False) False

(conventional current flow) (conventional current flow) ICs Sourcing and Sinking Current An example of the IC Sourcing Current To drive the output LED (conventional current flow) Notice the IC has Active-HIGH output Active-HIGH output An example of the IC Sinking Current To drive the output LED (conventional current flow) Notice the IC has Active-LOW output Active-LOW output

Stepper- and Servo-Motors Stepper motor - a motor that rotates a fixed angle (in discrete steps) for each input pulse. The logic levels applied to each field coil are defined in the control sequence for the stepper motor. Can reverse direction by progressing either up or down the control sequence. Servo motor (hobby-type servo) - a motor widely used in radio-control vehicles that rotates to an angle defined by the pulse width of the input signal. It is driven by pulse-width modulation. The pulse widths for hobby servos motors range from about 1- to 2-msec. Hobby servos have a limited range of rotation such as 180 degrees.

Stepper Motor Operation Sequence Chart Step L1 L1 L2 L2 1 1 0 1 0 2 0 1 1 0 3 0 1 0 1 4 1 0 0 1 L1 L1 L2 Note: Use --> key for CW, then <-- key for CCW rotation) L2

Servo Motor Input= Input= +5V Input= 1.5 msec 1 msec 2 msec positive pulse 50Hz Output=centered Input= 1 msec positive pulse 50Hz Output=CW Input= 2 msec positive pulse 50Hz Output=CCW +5V Input Left arrow on keyboard to erase and see action again. End of output shaft

QUIZ 1. The angular position of a servo motor’s shaft can be modified by varying the pulse voltage entering the input to the device. (True or False) False 2. Stepping upward or downward through a control sequence results in the stepping action (in small discrete steps) of a stepper motor. (True or False) True 3. If sequencing downward through the control sequence of a stepper motor causes CCW rotation, then reversing and going upwards though the control sequence will cause __________ (CW, no) rotation of the output shaft. CW or clockwise

Hall-Effect Switch IC Bipolar Hall-effect Switch IC Output pin of IC Schmitt trigger (digitizes output) Output NPN transistor GND pin Hall-effect sensor Vcc (+5V) (Left arrow on keyboard to erase and view again)

Using the Hall-Effect Switch IC (Left arrow on keyboard to erase and view again) Transistor OFF Pin 3 goes HIGH LED is OFF Transistor ON Pin 3 goes LOW LED lights S pole approaching Hall-effect sensor Turns ON transistor N pole approaching Hall-effect sensor Turns OFF transistor South pole North pole South pole North pole (Left click for action)

QUIZ 1. If the S pole of a magnet approaches the Hall-effect sensor of this IC the transistor will turn __________ (OFF and the LED will not light, ON and the LED will light). ON and the LED will light 2. If the N pole of a magnet approaches the Hall-effect sensor of this IC the transistor will turn OFF and the LED will not light. (True or False) True 3. The output of the Hall-effect sensor is analog in nature but the device called a(n) __________ (NPN transistor, Schmitt trigger) changes this to a digital output. Schmitt trigger

BASIC Stamp® Module Driving a Servo Motor PBASIC Code Step 3: Disconnect PC from BS2 module PBASIC Code Step 1: Write program on PC in PBASIC Key lines of code are: FOR C = 1 to 25 ‘Begin counting loop PULSOUT 14, 1000 ‘Emits 2ms pulses—CCW rotation PAUSE 20 ‘Pause 20ms NEXT ‘Repeat if C<25 PULSOUT 14, 500 ‘Emits 1ms pulses—CW rotation FOR C= 1 to 25 PULSOUT 14, 1000 ‘CCW rotation PAUSE 20 NEXT Step 2: Download program from PC to BS2 module Step 4: Power OFF and ON (BS2 module). Observe motor shaft rotation as program runs. FOR C= 1 to 25 PULSOUT 14, 500 ‘CW rotation PAUSE 20 NEXT Hobby Servo Motor Output- pin 14 Left arrow on keyboard to erase and view again

PBASIC code (BS2 module) QUIZ 1. The PULSOUT 14, 1000 line of code will cause the BASIC Stamp® to output a _____ (HIGH, LOW) pulse for 2ms (1000 x 2usec= 2ms) at pin 14 of the BS2 module. HIGH 2. The PAUSE 20 line of code will cause the BASIC Stamp® to output a LOW for 20ms. (True or False) True 3. The FOR-NEXT loop will be repeated _____ (20, 1000) times. 20 PBASIC code (BS2 module) 4. The 2ms positive output pulse generated by BS2 module can be used to rotate a hobby _____(servo, ac) motor in the CCW direction. FOR C= 1 to 20 PULSOUT 14, 1000 PAUSE 20 NEXT servo

REVIEW Logic Levels/Noise Margin Interfacing Families of ICs Other Specifications MOS and CMOS ICs Interfacing with Switches Interfacing with LEDs Interfacing with Buzzers, Relays, Motors and Solenoids

REVIEW (Continued) Interfacing Using an Optoisolator Current Sourcing and Sinking Using a Stepper Motor Using a Servo Motor Hall-effect Sensor/Switch Using the Hall-effect Switch BASIC Stamp® Driving a Servo

Principles & Applications Seven-Segment Displays Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 6 Encoding, Decoding, and Seven-Segment Displays ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION The BCD Code The Excess-3 Code The Gray Code The ASCII Code Encoders Seven-segment Displays Seven-segment LED Displays Decoders BCD-to-Seven-Segment Decoder/ Driver Liquid Crystal Displays Vacuum Fluorescent Displays

The 8421 BCD Code Decimal number 4926 4 9 2 6 BCD stands for Binary-Coded Decimal. A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. Example: Decimal number 4926 4 9 2 6 8421 BCD coded number 0100 1001 0010 0110

Convert the BCD coded number QUIZ Convert the BCD coded number 1000 0111 0001 into decimal. BCD Coded Number 1000 0111 0001 Decimal Number 8 7 1

Convert the decimal number 350 to its BCD equivalent. QUIZ Convert the decimal number 350 to its BCD equivalent. Decimal Number 3 5 0 BCD Coded Number 0011 0101 0000

The Excess-3 Code Add 3 to each digit of decimal and convert to 4-bit binary form A BCD code (not 8421 BCD) Decimal Binary +3 Excess-3 0 0000 0011 0011 1 0001 0011 0100 2 0010 0011 0101 3 0011 0011 0110 4 0100 0011 0111 5 0101 0011 1000 6 0110 0011 1001 7 0111 0011 1010 8 1000 0011 1011 9 1001 0011 1100 Sample Problem: Decimal 3 5 9 Excess-3 0110 1000 1100

QUIZ 1. To form an excess-3 coded number, decimal 3 is added to the decimal number and this is converted to its 4-bit binary code. (True or False) True 2. The excess-3 BCD number 1010 0100 equals __________ in decimal. 71 3. The decimal number 428 equals what excess-3 number. 0111 0101 1011

The Gray Code The Gray code’s most important characteristic is that only one digit changes as you increment or decrement the count. The Gray code is commonly associated with input/output devices such as an optical encoder of a shaft’s angular position. The Gray code is NOT a BCD code. Decimal Gray code 0 00000 1 00001 2 00011 3 00010 4 00110 5 00111 6 00101 7 00100 8 01100 9 01101 10 01111 11 01110 12 01010 13 01011 14 01001 15 01000 16 11000

QUIZ 1. The Gray code is not a type of BCD code. (True or False) True 2. The most important characteristic of the ____________ (BCD, Gray code) is that only one digit changes state as you increment or decrement the count. Gray code 3. The Gray code is commonly associated with input/output devices such as an optical encoder of a shaft’s angular position. (True or False) True

The ASCII Code ASCII is an acronym for American Standard Code for Information Interchange Represents numbers, letters, punctuation marks and control characters Standard ASCII is a 7-bit code (127 characters) Extended ASCII (IBM ASCII), an 8-bit code, is also very popular Extended ASCII adds graphics and math symbols to code (total of 256 symbols)

American Standard Code for Information Interchange QUIZ 1. A common 7-bit code used to represent numbers, letters, punctuation marks, and control characters is known by the acronym __________. ASCII 2. The acronym ASCII stands for __________________________. American Standard Code for Information Interchange 3. Extended ASCII code is a(n) __________ (8-bit, 10-bit) code which adds graphic and math symbols to ASCII for a total of 256 symbols. 8-bit

Electronic Encoder - Decimal to BCD BCD output Decimal input 0 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 Decimal to BCD Encoder 3 7 5 Encoders are available in IC form. This encoder translates from decimal input to BCD output.

Seven Segment Displays LED (light emitting diode) display High power consumption Viewing best under low light conditions Commonly red but available in other colors LCD (liquid crystal display) Commonly dark characters on a silvery background Very low power consumption Viewing only OK in good light Backlighted displays can be viewed in low light VF (vacuum fluorescent) display Commonly blue-green display (without filters) Medium power consumption Viewing good from dark to lighter conditions Based on vacuum tube triode technology

QUIZ 1. The type of 7-segment display based on vacuum tube technology which usually has blue-green characters and can be viewed in dark to lighter conditions is the vacuum fluorescent display (VF). (True or False) True 2. The type of 7-segment display that shows dark characters on a silvery background, uses very little power, and is good for viewing in bright light is called the liquid crystal display (LCD). (True or False) True 3. The seven-segment LED display is best viewed in very bright sunlight. (True or False) False

7-Segment LED Display Operation Inputs 7-segment code +5V a g Note that inputs are “active-LOW” 7-segment display reads decimal 1 (segments b & c are lit) b & c inputs active therefore segments b & c light on display H L b L c Limiting resistors Common anode Cathode terminals (a thru g) 7-segment LED display (common anode)

QUIZ H L b L c L f L g L a L b L c H L a L b L c L d L e L f L g L a H Q #3- What is the decimal output on the display for the new set of inputs? Q #4- What is the decimal output on the display for the new set of inputs? Q #2- What is the decimal output on the display for the new set of inputs? Q #1- What will be the decimal output on the 7-segment LED display? +5V a g Inputs 7-segment code H L b L c L f L g L a L b L c H L a L b L c L d L e L f L g L a H L c L d L f L g

7-Segment Decoder/Driver Decoders: BCD to 7-Segment Decoder/Driver BCD input Decimal output LED 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 BCD-to- 7-Segment Decoder/ Driver Electronic decoders are available in IC form. This decoder translates from BCD to decimal. Decimals are shown on an 7-segment LED display. This IC also drives the 7-segment LED display.

? QUIZ Answer: 9 Answer: 7 Answer: 6 Answer: 0 Answer: 3 0 1 1 1 Q #1- What is the decimal output from the decoder that appears on the 7-segment display? Q #4- What is the decimal output from the decoder that appears on the 7-segment display? Q #3- What is the decimal output from the decoder that appears on the 7-segment display? Q #5- What is the decimal output from the decoder that appears on the 7-segment display? Q #2- What is the decimal output from the decoder that appears on the 7-segment display? Answer: 9 Answer: 7 Answer: 6 Answer: 0 Answer: 3 BCD input Decimal output 0 1 1 1 1 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 BCD-to- 7-Segment Decoder/ Driver ?

Liquid Crystal Displays LCDs control available light (do not generate light) Nematic fluid (also called liquid crystal fluid) is sandwiched between two glass plates Monochrome twisted-nematic field-effect LCDs display dark figures on a silvery background. LCDs are commonly used on watches, calculators, and laptops. LCD monitors and TVs are becoming common. Color LCDs use either passive-matrix or active-matrix technology. Active-matrix color LCD screens are more expensive. Active-matrix color LCD screens use thin-film transistors (TFT) and red, green, blue, and white filters. Most laptop screens are backlighted for brightness.

Liquid Crystal Display Metalized segments Polarizer Conductive pattern on glass Contacts Liquid crystal Metalized layer Glass backplane Polarizer 100 Hz out-of-phase signal activates segment

QUIZ 1. While VF and LED displays emit light, LCDs __________ (control available, sublimate red) light. control available 2. The nematic fluid sandwiched between the glass plates of a LCD is also called _______ _______ (green phosphor, liquid crystal). liquid crystal 3. Monochrome twisted-nematic field-effect LCDs display __________ (dark, white) figures on a silvery background. dark 4. Liquid crystal displays are difficult to read under low light conditions however most laptop computer flat screens are backlighted to add brightness. (True or False) True

with out-of-phase signals Driving an LCD Display BCD Input 0 1 1 1 a b c LCD driver d e f g Phase Common The LCD segments with out-of-phase signals are active (a, b, & c are active) 100 Hz Clock

? QUIZ Q#1: What is the output on the LCD display? ANS: 2 ANS: 0 ANS: 5 BCD Input A B C D E F G ? LCD Driver LCD Common 100 Hz Clock

Vacuum Fluorescent Displays VF displays are commonly used in automobiles because they operate at the proper voltages, have a pleasing blue-green color, are easy to see even when viewed under lower light conditions, and will operate at wide extremes of temperature. VF displays are based on an older triode vacuum tube technology. VF displays are also commonly used in point-of-sale terminals and some desktop calculators.

QUIZ 1. A vacuum fluorescent display is based on an older vacuum tube technology and is commonly referred to as a _____ _________ (TFT display, VF display). VF display 2. One of the most common applications of VF displays is in _________________ (flat-screen laptop computer screens, automobiles). automobiles 3. The VF display has the advantage of being easily readable in either light or dark conditions. (True or False) True

Vacuum Fluorescent Display Cathodes (heaters) Grid Plates Glass back K G f a e g d c b K

QUIZ Q#1- The thin wires at A are called heaters or ___. Q#2- The segments at B are called ___. Q#3- The screen like section at C is called the ___. ANS: Cathodes ANS: Plates ANS: Grid A C B

Operating a VF 7-Segment Display Plates Plates Plates Plates Pa Pb Pc Pd Pe Pf Pg +12 V Grid Grid Grid Grid Cathodes (heaters) Cathodes (heaters) Cathodes (heaters) Cathodes (heaters) To light a segment: 1. Heaters must be hot 2. Grid must be at +12V 3. Plate must be at +12V

QUIZ C A B Q#1- Part A is the ___. Q#2- Part B points at the heaters or ___. Q#3- Parts C are the ___. Q#4- The grid is normally at +12V. (T or F) ANS: grid Q#5- To light a plate it must be grounded. (T or F) ANS: cathodes Q#6- To light a plate it must be at +12V. (T or F) ANS: plates ANS: True ANS: False ANS: True C A B Schematic diagram of VF display with heaters connected to battery.

REVIEW The BCD Code The Excess-3 Code The Gray Code The ASCII Code Encoders Seven-segment Displays Seven-segment LED Displays Decoders BCD-to-Seven-Segment Decoder/ Driver Liquid Crystal Displays Vacuum Fluorescent Displays

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 7 Flip-Flops ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Combinational vs. Sequential Logic Circuits R-S Flip-flop Clocked R-S Flip-flop D Flip-flop J-K Flip-flop Latches (simple memory devices) Triggering of flip-flops Schmitt triggered device

Logic Circuits Logic circuits are classified into two groups: Combinational Logic Circuits Basic building blocks include: Sequential Logic Circuits Basic building blocks include FLIP-FLOPS:

QUIZ 1. Basic building blocks for __________ (combinational, sequential) logic circuits include logic gates (such as NOT, AND, and OR). combinational 2. Basic building blocks for sequential logic circuits include various flip-flops. (True or False) True 3. A flip-flop is an example of a device used in __________ (combinational, sequential) logic circuits. sequential

R-S Flip-Flop Symbols: Truth Table: Mode of Operation Inputs Outputs Set Reset S R Q Normal Comple-mentary FF Truth Table: Mode of Operation Inputs Outputs S R Q Q’ Prohibited 0 0 1 1 Set 0 1 1 0 Reset 1 0 0 1 Hold 1 1 Q Q’ NOTE: Active-LOW inputs

QUIZ What is the mode of operation of the R-S flip-flop (set, reset or hold)? What is the output at Q from the R-S flip-flop (active LOW inputs)? Mode of operation = ? ? L H High Set Mode of operation = ? ? H High Hold Mode of operation = ? ? H L Low Reset

Clocked R-S Flip-Flop Symbols: Truth Table: Set Reset S R Q Normal Comple-mentary FF Clock CLK Truth Table: Mode of operation Inputs Outputs Clk S R Q Q’ Hold + pulse 0 0 no change Reset + pulse 0 1 0 1 Set + pulse 1 0 1 0 Prohibited 1 1 1 1 NOTE: Active-High inputs

QUIZ High Set High Hold Low Reset What is the mode of operation of the clocked R-S flip-flop (set, reset, hold)? What is the output at Q from the clocked R-S flip-flop (active HIGH inputs)? H ^ L Mode of operation = ? ? High Set L ^ Mode of operation = ? ? High Hold L ^ H Mode of operation = ? ? Low Reset

D Flip-Flop Symbol: Truth Table: (with asynchronous PS & CLR) Mode of Operation Inputs Outputs PS CLR CLK D Q Q’ Asynchronous set 0 1 X X 1 0 Asynchronous reset 1 0 X X 0 1 --------------------------------------------------------------------- Prohibited 1 1 X X 1 1 Set 1 1 ^ 1 1 0 Reset 1 1 ^ 0 0 1 X = irrelevant ^ = L-to-H transition of the clock pulse

QUIZ What is the mode of operation of the D flip-flop? What is the output at Q from the D flip-flop? L H ^ ? Mode of operation = ? High Asynchronous Set H L ^ ? Mode of operation = ? Low Reset H ^ ? Mode of operation = ? High Set

J-K Flip-Flop Symbol: Truth Table: Mode of Operation Inputs Outputs PS Clr Clk J K Q Q’ Asynchronous set 0 1 x x x 1 0 Asynchronous reset 1 0 x x x 0 1 Prohibited 0 0 x x x 1 1 ------------------------------------------------------------------------- Hold 1 1 ^ 0 0 no change Reset 1 1 ^ 0 1 0 1 Set 1 1 ^ 1 0 1 0 Toggle 1 1 ^ 1 1 opposite x = Irrelevant ^ = H-to-L transition of clock pulse

QUIZ What is the mode of operation of the J-K flip-flop? What is the output at Q from the J-K flip-flop? L ^ H Mode of operation = ? ? H ^ Mode of operation = ? ? High High Preset Toggle H ^ Mode of operation = ? ? Mode of operation = ? H ^ ? Low Low Toggle Toggle Mode of operation = ? H L ^ ? H ^ L Mode of operation = ? ? Low Low Reset Clear

Latch A fundamental digital storage device The act of storing data for a time, such as “to latch” An R-S flip-flop is an example of a latch A D flip-flop can perform as a latch In IC form (examples: 4-bit, 8-bit, 9-bit, 10 bit) Is commonly imbedded in complex ICs

QUIZ 1. A fundamental digital storage device is sometime called a(n) ___ (gate, latch). latch 2. The job of a latch can be performed by a(n) ___ (gate, D-flip-flop). D-flip-flop 3. We say that “to latch” is the act of storing data for a time. (True or False) True 4. Latches are commonly imbedded in more complex ICs and serve as temporary memory devices. (True or False) True

Triggering of Flip-Flops Level-triggering is the transfer of data from input to output of a flip-flop anytime the clock pulse is HIGH. Edge-triggering is the transfer of data from input to output of a flip-flop on the rising edge (L-to-H) or falling edge (H-to-L) of the clock pulse. Edge triggering may be either positive-edge (L-to-H) or negative-edge (H-to-L). Master-slave triggering is an older technique using the whole clock pulse but think of a master-slave flip-flop as having negative-edge triggering. Negative-edge triggering Positive-edge triggering H L time Level triggering

QUIZ 1. If a flip-flop triggers on the L-to-H transition of the clock pulse (see A) it is called a __________ (level, positive-edge) triggered device. positive-edge 2. If a flip-flop triggers on the H-to-L transition of the clock pulse (see B) it is called a __________ (level, negative-edge) triggered device. negative-edge 3. If a flip-flop triggers while the clock pulse is HIGH (see C) it is called a __________ (level, positive-edge) triggered device. level C B A H L time

Schmitt Trigger Operation Positive-going threshold Negative-going threshold Output Input Schmitt trigger device “squares” up input

QUIZ 1. The symbol at the lower right is that of a __________ (magneto-optical, Schmitt trigger) inverter. Schmitt trigger 2. If the input signal to the Schmitt trigger inverter is a sine wave the output will be a __________ (square-wave, triangular-wave). square wave 3. A Schmitt-trigger device will “digitize” or square up input signals with slow rise times and slow fall times. (True or False) True

REVIEW Combinational vs. Sequential Logic Circuits R-S Flip-flop Clocked R-S Flip-flop D Flip-flop J-K Flip-flop Latches (simple memory devices) Triggering of flip-flops Schmitt triggered device

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 8 Counters ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Overview of Counters Characteristics of Counters Ripple Up Counter Ripple Counter with Waveforms Ripple Down Counter Self-stopping Counter Frequency Division using Counters Using Counter ICs Magnitude Comparators Troubleshooting Hints

Overview of Counters Counter-by definition One input (clock) Outputs follow defined sequence Common tasks of counter Count up or down Increment or decrement count Sequence events Divide frequency Address memory As temporary memory

QUIZ 1. A digital counter has a single clock input with many outputs and the counter follows defined sequence such as 000, 001, 010, 011, 100, 101, 110, 111, 000, etc. (True or False) True Several common tasks of a counter are to count up or down, divide frequency, or as temporary memory. (True or False) True

Characteristics of Counters Number of bits (4-bit, 8-bit, etc.) Maximum count 4 bit = 24 = 0000 to 1111 in binary 8 bit = 28 = 0000 0000 to 1111 1111 in binary Modulus of counter-number of states Decade counter 4-bit 8-bit Up or down counter Asynchronous or synchronous counter Presettable counter Self-stopping counter

QUIZ 1. A 4-bit counter will count from binary 0000 to __________. 1111 2. The modulus of a counter is the number of states it will cycle through such as a decade counter has a modulus of __________. 10 3. Counters can be designed to count up or downward or devised to be self-stopping. (True or False) True 4. A 4-bit counter would have modulus of 4 (mod-4 counter) because it is constructed using four flip-flops. (True or False) False

Ripple Counter Binary Output Clock Input 1 0 0 0 0 1 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 Pulse 5 Pulse 6 Pulse 8 Pulse 4 Pulse 7 Pulse 1 Pulse 2 Pulse 3 This 4-bit counter has 16 states and will count from binary 0000 through 1111 and then reset back to 0000. The counter has a modulus of 16. On the next clock pulse (8) all FFs will toggle because each will receive a H-to-L pulse- one after another. Watch the count ripple thru the counter. All J-K flip-flops in the TOGGLE MODE PS and CLR inputs are INACTIVE

Ripple Counter With Waveforms Binary Output Clock Input 0 1 0 0 0 0 1 1 0 1 0 1 0 0 1 0 0 0 0 1 0 0 0 0 Pulse 5 Pulse 4 Pulse 2 Pulse 3 Pulse 1 Clock input 1s output 2s output 4s output FFs triggered on H-to-L pulse. CLK toggles 1s FF. 1s FF toggles 2s FF. 2s FF toggles 4s FF.

QUIZ Q#1- After pulse 1 the output of the mod-16 counter will be binary ___. Q#2- After pulse 2 the output of the mod-16 counter will be binary ___. Q#3- After pulse 8 the output of the mod-16 counter will be binary ___. Q#4- After pulse 15 the output of the mod-16 counter will be binary ___. 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 Pulse 15 Pulse 8 Pulse 2 Pulse 1 Input Pulses

Decade Counter All J & K inputs = 1 All PR inputs = 1 0 0 0 1 0 0 0 0 Initial count at 0111 Binary Output Clock Input 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 0 1 1 Pulse 8 Pulse 2 Pulse 1 Pulse 4 Pulse 3 Pulse 7 Pulse 6 Pulse 5 To clear input of each FF Short negative pulse All J & K inputs = 1 All PR inputs = 1 Count is at 1001. Next clock pulse will increment counter for a short time to 1010 which will activate the NAND gate and reset the counter to 0000. To change mod-16 counter to decade counter: Reset count to 0000 after 1001 (9) count. When count hits 1010 reset to 0000. See added 2-input NAND gate that clears all JK FFs to 0 when count hits 1010.

QUIZ 0 1 1 0 Q#1- This is a ___ (mod-10, mod-16) up counter. Q#2- This circuit can be described as a ___ (decade, 4-bit) up counter. Q#3- The ___ gate generates a very short LOW pulse when the count reaches 1010 and resets to counter to 0000. Q#4- After 0110, the counting sequence would be 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 0000, etc. (T or F) ANS: mod-10 ANS: decade ANS: NAND ANS: False 0 1 1 0 Input pulses To clear input of each FF

Down Counter Initial count set at binary 111 0 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 1 1 Pulse 2 Pulse 5 Pulse 4 Pulse 1 Pulse 3 Changes from Ripple Up Counter are wiring from Q’ outputs (instead of Q outputs) to the CLK input of the next FF.

QUIZ 1 1 1 Q#1- This circuit can be described as a 3-bit ripple ___ (down-counter, up-counter). Q#2- This circuit is a self-stopping 3-bit ripple down counter. (T or F) Q#3- The counting sequence of this circuit is 111, 110, 101, 100, 011, 010, 001, 000, 111, 110, 101, 100, etc. (T or F) ANS: down-counter ANS: False ANS: True 1 1 1 Input pulses

Self-Stopping Down Counter Watch count on Pulse 8. The count remained at binary 000. 0 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 Pulse 8 Pulse 1 Pulse 7 Pulse 2 Pulse 6 Pulse 5 Pulse 4 Pulse 3 This is a 3-bit down counter. The 1s FF is in TOGGLE mode when counting (J & K = 1). The 1s FF switches to HOLD mode when the J and K inputs are forced LOW by the OR gate when the count decrements to 000. The count stops at 000.

QUIZ 1 1 1 Q#1- This circuit could be described as a 3-bit ___ (decade, self-stopping) ripple counter. Q#2- The 3-input OR gate generates a ___ (HIGH, LOW) when the count decreases to 000 which stops the count at 000. Q#3- With the count at 111, the OR gate outputs a HIGH which places the left FF in the toggle mode. (T or F) ANS: self-stopping ANS: LOW ANS: True 1 1 1 Input pulses

Counter Used for Frequency Division  4 200 Hz  8 400 Hz 100 Hz 50 Hz  2  16 Clock Input 800 Hz

QUIZ Frequency? Frequency? Frequency? Frequency? Frequency? 3200 Hz Q#1- What is the output frequency from the 1s J-K flip-flop with an input frequency of 3200 Hz? Q#2- What is the output frequency from the 2s J-K flip-flop with an input frequency of 3200 Hz? Q#3- What is the output frequency from the 4s J-K flip-flop with an input frequency of 3200 Hz? Q#4- What is the output frequency from the 8s J-K flip-flop with an input frequency of 3200 Hz? Q#5- The 8s output from the 4-bit counter is referred to as the ___ (divide-by-4, divide-by-16) output. ANS: 1600 ANS: 800 ANS: 400 ANS: 200 ANS: divide-by-16 Frequency? Frequency? Frequency? Frequency? Frequency? Clock Input 3200 Hz

Using the 7493 Counter IC Counters are available in IC form. Either ripple (7493 IC) or synchronous (74192 IC) counters are available. ? Hz 400 Hz 100 Hz ? Hz ? Hz 800 Hz 1600 Hz 7493 Counter IC wired as a 4-bit binary counter

Magnitude Comparator A magnitude comparator is a combinational logic device that compares the value of two binary numbers and responds with one of three outputs (A=B or A>B or A<B). 74HC85 Magnitude Comparator A = B A < B A > B A(0) A(1) A(2) A(3) B(0) B(1) B(2) B(3) Input binary 0111 Input binary 1111 Input binary 0001 HIGH HIGH Input binary 0110 Input binary 0111 Input binary 1100 HIGH

QUIZ Q#1- The 74HC85 Comparator IC compares two 4-bit ___ (binary, decimal) numbers (A and B) and generates one of three outputs including (1) A = B, (2) A > B, or (3) A < B. Q#2- Which output of the comparator IC will be activated with these two 4-bit binary numbers as inputs? Q#3- Which output of the comparator IC will be activated with these two 4-bit binary numbers as inputs? Q#4- Which output of the comparator IC will be activated with these two 4-bit binary numbers as inputs? ANS: binary ANS: A = B ANS: A < B ANS: A > B 74HC85 Magnitude Comparator A = B A < B A > B A(0) A(1) A(2) A(3) B(0) B(1) B(2) B(3) 0101 0101 1101 ? 0101 1011 1010

Simple Troubleshooting Hints Feel top of IC to determine if it is hot Look for broken connections, signs of excessive heat Smell for overheating Check power source Trace path of logic through circuit Know the normal operation of the circuit

QUIZ 1. The first three steps in troubleshooting are the use of your senses to (1) feel the top of the ICs for overheating, (2) to __________ for broken connections, and (3) to smell for signs of overheating. look 2. The forth step in troubleshooting is to use a simple handheld instrument called a __________ to check the power sources at each IC. logic probe 3. Your knowledge of the normal operation of the circuit and equipment is very important in troubleshooting. (True or False) True

REVIEW Overview of Counters Characteristics of Counters Ripple Up Counter Ripple Counter with Waveforms Ripple Down Counter Self-stopping Counter Frequency Division using Counters Using Counter ICs Magnitude Comparators Troubleshooting Hints

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 9 Shift Registers ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Overview of Shift Registers Characteristics of Shift Registers Serial/Parallel Data Conversion Serial Load Shift Register Parallel Load Shift Register Recirculating Shift Register Using the 74194 Shift Register IC Digital Roulette Game Troubleshooting Hints

Overview of Shift Registers A shift register is a sequential logic device made up of flip-flops that allows parallel or serial loading and serial or parallel outputs as well as shifting bit by bit. Common tasks of shift registers: Serial/parallel data conversion UART (an example) Time delay Ring counter Twisted-ring counter or Johnson counter Memory device

Characteristics of Shift Registers Number of bits (4-bit, 8-bit, etc.) Loading Serial Parallel (asynchronous or synchronous) Common modes of operation. Parallel load Shift right-serial load Shift left-serial load Hold Clear Recirculating or non-recirculating

Serial/Parallel Data Conversion Shift registers can be used to convert from serial-to-parallel or the reverse from parallel-to-serial. 1 0 1 0 1 1 1 1 Parallel in Parallel out 1 0 1 0 1 1 1 1 Serial in Parallel out 1 0 1 0 1 1 1 1 Serial out Parallel in 1 0 1 0 1 1 1 1 Serial in Serial out

QUIZ Q#1- This represents a ___ register. a. Parallel-in, parallel-out b. Serial-in, parallel-out Q#2- This represents a ___ register. a. Parallel-in, parallel-out b. Serial-in, serial-out Q#3- This represents a ___ register. a. Parallel-in, serial out b. Serial-in, parallel-out Q#4- This represents a ___ register. a. Parallel-in, serial out b. Parallel-in, parallel-out ANS: serial-in parallel-out ANS: serial-in serial-out ANS: parallel-in serial-out ANS: parallel-in parallel-out

Serial Load Shift Register Parallel outputs here. Order= A B C D 1 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 Clock Pulse 6 Clear = 1 Data = 0 Clock Pulse 7 Clear = 1 Data = 1 Clock Pulse 8 Clear = 1 Data = 0 Clock Pulse 2 Clear = 1 Data = 1 Clock Pulse 5 Clear = 1 Data = 0 Clock Pulse 1 Clear = 0 Data = 1 Clock Pulse 4 Clear = 1 Data = 0 Clock Pulse 3 Clear = 1 Data = 1 Inputs here: (1) Data (2) Clock (3) Clear 4-bit serial-in parallel out shift right shift register Clock input: Positive-edge triggering Clear input: Active = 0 Deactivated = 1 Note the use of D FFs. Clock (CLK) inputs wired in parallel. Clear (CLR) inputs can be activated with LOW or disabled with HIGH. Preset (PS) inputs deactivated.

QUIZ A: Serial-in, parallel-out A: 1001 A: 0010 A: 0100 A: 1100 QUESTION #5 What is the 4-bit output (bit A on left, D on right) after pulse 4? QUESTION #2 What is the 4-bit output (bit A on left, D on right) after pulse 1? QUESTION #1 This is a ___ type shift register. A. Serial-in, parallel out B. Parallel-in, serial-out QUESTION #7 What is the 4-bit output (bit A on left, D on right) after pulse 6? QUESTION #4 What is the 4-bit output (bit A on left, D on right) after pulse 3? QUESTION #6 What is the 4-bit output (bit A on left, D on right) after pulse 5? QUESTION #3 What is the 4-bit output (bit A on left, D on right) after pulse 2? A: Serial-in, parallel-out A: 1001 A: 0010 A: 0100 A: 1100 A: 1000 A: 0000 Clock Pulse 6 Clear = 1 Data = 1 Clock Pulse 4 Clear = 1 Data = 0 Clock Pulse 5 Clear = 1 Data = 1 Clock Pulse 1 Clear = 0 Data = 1 Clock Pulse 2 Clear = 1 Data = 1 Clock Pulse 3 Clear = 1 Data = 0

Parallel Load Shift Register Outputs here. Order= A B C D Parallel data inputs (Active LOW) Recirculating lines: Pass data from FFD to FFA on each clock pulse. Clock input- H-to-L Note the recirculating lines. Clear input- Active LOW Note the use of J-K FFs. Clock (CLK) inputs wired in parallel. Clear (CLR) input activated with LOW. Parallel load inputs (A,B,C,D) are active LOW.

Recirculating Shift Register 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 Clock pulse 8 Clear input= 1 Parallel data inputs= only B active Clock pulse 7 Clear input= 0 Parallel data inputs= all inactive Clock pulse 1 Clear input= 0 Parallel data inputs= only D activated Clock pulse 6 Clear input= 1 Parallel data inputs= all inactive Clock pulse 3 Clear input= 1 Parallel data inputs= all inactive Clock pulse 5 Clear input= 1 Parallel data inputs= all inactive Clock pulse 2 Clear input= 1 Parallel data inputs= C & D activated Clock pulse 4 Clear input= 1 Parallel data inputs= all inactive

QUIZ Q#1- After clock pulse 1, the output from the shift register will be ___. Q#2- After clock pulse 2, the output from the shift register will be ___. Q#3- After clock pulse 3, the output from the shift register will be ___. Q#4- After clock pulse 4, the output from the shift register will be ___. Q#5- After clock pulse 5, the output from the shift register will be ___. Q#6- After clock pulse 6, the output from the shift register will be ___. 0 1 1 0 1 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 0 0 0 0 Clock pulse 6 Clear input= 1 Parallel data inputs= none active Clock pulse 1 Clear input= 0 Parallel data inputs= none active Clock pulse 5 Clear input= 1 Parallel data inputs= none active Clock pulse 3 Clear input= 1 Parallel data inputs= none active Clock pulse 4 Clear input= 1 Parallel data inputs= none active Clock pulse 2 Clear input= 1 Parallel data inputs= B and C active

Universal Shift Register IC Outputs here Clear input active LOW Serial data Right input used during Serial Load Right mode of operation Parallel data inputs Order: A, B, C, D during Parallel loading Serial data Left input used during Serial Load Left mode of operation Clock input L-to-H triggering Mode Controls: Hold Parallel load Shift right Shift left 74194 Universal 4-bit Shift Register IC. Modes of operation: Hold, Parallel load, Shift right & Shift left. An active LOW Clear (CLR) input overrides all others.

Using the 74194 Shift Register IC 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1 CLR = 1 Serial R = X Parallel Load= 0 1 0 0 Serial L = X Clock pulse 6 (L-to-H) S0= 1 S1= 1 CLR = 1 Serial R = X Parallel Load= 0 1 0 0 Serial L = 1 Clock pulse 7 (L-to-H) S0= 0 S1= 1 CLR = 1 Serial R = X Parallel Load= 0 1 0 0 Serial L = 0 Clock pulse 8 (L-to-H) S0= 0 S1= 1 CLR = 1 Serial R = 0 Parallel Load= 0 1 0 0 Serial L = X Clock pulse 4 (L-to-H) S0= 0 S1= 0 CLR = 1 Serial R = X Parallel Load= 0 1 1 0 Serial L = X Clock pulse 1 (L-to-H) S0= 1 S1= 1 CLR = 0 Serial R = 0 Parallel Load= 0 1 0 0 Serial L = X Clock pulse 5 (L-to-H) S0= 1 S1= 1 CLR = 1 Serial R = 0 Parallel Load= 0 1 1 0 Serial L = X Clock pulse 2 (L-to-H) S0= 1 S1= 0 CLR = 1 Serial R = 0 Parallel Load= 0 1 0 0 Serial L = X Clock pulse 3 (L-to-H) S0= 1 S1= 0 X = Irrelevant

QUIZ ? ? ? ? A: Universal A: Clear, 0 0 0 0 A: Parallel load, 0 1 0 0 QUESTION #1 The 74194 IC could be described as a 4-bit (shift right, universal) shift register. QUESTION #3 What is the mode of operation during and the output of the shift register after pulse 2? QUESTION #2 What is the mode of operation during and the output of the shift register after pulse 1? QUESTION #4- What is the mode of operation during and the output of the shift register after pulse 3? QUESTION #5 What is the mode of operation during and the output of the shift register after pulse 4? QUESTION #7 What is the mode of operation during and the output of the shift register after pulse 6? QUESTION #6 What is the mode of operation during and the output of the shift register after pulse 5? A: Universal A: Clear, 0 0 0 0 A: Parallel load, 0 1 0 0 A: Shift right, 0 0 1 0 A: Shift left, 0 1 0 1 A: Hold, 0 0 1 0 A: Shift left, 1 0 1 1 ? ? ? ? CLR = 1 Serial R = 0 Parallel Load= 0 1 0 0 Serial L = X Clock pulse 2 (L-to-H) S0= 1 S1= 1 CLR = 1 Serial R = X Parallel Load= 0 1 0 0 Serial L = 1 Clock pulse 6 (L-to-H) S0= 0 S1= 1 CLR = 1 Serial R = 0 Parallel Load= 0 1 0 0 Serial L = X Clock pulse 4 (L-to-H) S0= 0 S1= 0 CLR = 1 Serial R = X Parallel Load= 0 1 0 0 Serial L = 1 Clock pulse 5 (L-to-H) S0= 0 S1= 1 CLR = 0 Serial R = X Parallel Load= 0 1 0 0 Serial L = X Clock pulse 1 (L-to-H) S0= 1 S1= 1 CLR = 1 Serial R = 0 Parallel Load= 0 1 0 0 Serial L = X Clock pulse 3 (L-to-H) S0= 1 S1= 0

Digital Roulette Game 1 1 1 1 1 Spin Wheel 1 input 1 1 +5V Audio Amplifier 1 1 1 1 1 1 1 1 Power-up Initializing Circuit Spin Wheel input +5V Voltage Controlled Oscillator (VCO) 8-bit Ring Counter (shift register) Simulated Roulette Display

ANS: voltage-controlled oscillator (VCO) QUIZ Q#1- The block at A in the digital roulette game contains a(n) ___ circuit. Q#2- The block at B in the digital roulette game contains a(n) ___ circuit. Q#3- The block at C in the digital roulette game contains a(n) ___ circuit which is a type of 8-bit shift register. ANS: voltage-controlled oscillator (VCO) ANS: audio amplifier ANS: ring counter B C A

Simple Troubleshooting Hints Feel top of IC to determine if it is hot Look for broken connections, signs of excessive heat Smell for overheating Check power source Trace path of logic through circuit Know the normal operation of the circuit

QUIZ The most important factor in successful troubleshooting is a good knowledge of the circuit’s normal operation. (True or False) True 2. The first three steps in troubleshooting are to use your senses to (1) __________ the top of the ICs for overheating, (2) look for broken connections, and (3) smell for signs of overheating. feel 3. The fourth step in troubleshooting is to use a(n) __________ (logic probe, tachometer) to check the power sources to the IC. logic probe 4. The fifth step in troubleshooting is to trace the path of logic through the circuit. (True or False) True

REVIEW Overview of Shift Registers Characteristics of Shift Registers Serial/Parallel Data Conversion Serial Load Shift Register Parallel Load Shift Register Recirculating Shift Register Using the 74194 Shift Register IC Digital Roulette Game Troubleshooting Hints

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 10 Arithmetic Circuits ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Binary Addition Half & Full Adders Binary Subtraction Half & Full Subtractors Parallel Adders and Subtractors Using Adders for Subtraction Binary Multiplication Binary Multipliers 2s Complement Notation 2s Complement Adding/Subtracting

Binary Addition Conceptually similar to decimal addition Example: Add the binary numbers 1010 and 11 (carry) 1 1 0 1 0 + 1 1 1 1 1

QUIZ 1 1 0 1 0 + 1 1 0 0 1 1 1 Add the Binary numbers 11010 and 1100 1 (carry) 1 (carry) 1 1 1 0 1 0 + 1 1 0 0 1 1 1

Half Adder Logic device that adds two binary numbers Only adds Least Significant Digit (LSD) column (1s column) in binary addition A B  (sum) C0 (carry out) Half Adder Input Output Logic Symbol: Logic Diagram:

QUIZ ? Q#1- This circuit is called a ___. Q#2- What are the sum and carry out outputs from the half adder circuit? Q#3- What are the sum and carry out outputs from the half adder circuit? Q#4- What are the sum and carry out outputs from the half adder circuit? Q#5- What are the sum and carry out outputs from the half adder circuit? ANS: Half-adder ANS: Sum=0, Carry out=0 ANS: Sum=1, Carry out=0 ANS: Sum=0, Carry out=1 ANS: Sum=1, Carry out=0 A = 0 B = 0 A = 0 B = 1 A = 1 B = 1 A = 1 B = 0 ?

Full Adder Used for adding binary place values other than the 1s place  (sum) C0 (carry out) Full Adder Input Output Cin Logic Symbol: Logic Diagram:

QUIZ ? Q#1- This combinational logic circuit is described as a(n) ___. Q#2- What are the sum and carry out outputs of this full-adder circuit? Q#3- What are the sum and carry out outputs of this full-adder circuit? Q#4- What are the sum and carry out outputs of this full-adder circuit? Q#5- What are the sum and carry out outputs of this full-adder circuit? Q#6- What are the sum and carry out outputs of this full-adder circuit? ANS: full-adder ANS: Sum=0, Carry out=0 ANS: Sum=1, Carry out=0 ANS: Sum=0, Carry out=1 ANS: Sum=1, Carry out=1 ANS: Sum=0, Carry out=1 Cin = 0 A = 0 B = 0 Cin = 0 A = 0 B = 1 Cin = 1 A = 0 B = 1 Cin = 1 A = 1 B = 1 ? Cin = 0 A = 1 B = 1

Binary Subtraction 1 0 1 1 - 1 0 1 1 1 Example: Subtract binary number 101 from 1011 (borrow) 1 1 0 1 1 - 1 0 1 1 1

QUIZ Subtract binary number 11 from 1010 01 10 1 1 1 0 1 0 - 1 1 1 1 1

Subtracts LSD column in binary subtraction Half Subtractor Subtracts LSD column in binary subtraction Input Output Logic Symbol: A Di (difference) Half Subtractor B B0 (borrow out) Logic Diagram:

QUIZ ? Q#1- What is the difference and borrow outputs from This half-subtractor circuit? Q#2- What is the difference and borrow outputs from this half-subtractor circuit? Q#3- What is the difference and borrow outputs from this half-subtractor circuit? Q#4- What is the difference and borrow outputs from this half-subtractor circuit? ANS: Di= 0, Bo= 0 ANS: Di= 1, Bo= 0 ANS: Di= 0, Bo= 0 ANS: Di= 1, Bo= 1 (A – B) A = 0 B = 0 (A – B) A = 1 B = 0 (A – B) A = 1 B = 1 (A – B) A = 0 B = 1 ?

Used for subtracting binary place values other than the 1s place Full Subtractor Used for subtracting binary place values other than the 1s place A B Di (difference) B0 (borrow out) Full Subtractor Input Output Bin Logic Symbol: Logic Diagram: A B Di B0 H. S. Bin

HINT: truth table from textbook (Fig. 10-10) is helpful QUIZ Q#1- What are the Difference and Borrow out output from this full-subtractor circuit? Q#2- What are the Difference and Borrow out output from this full-subtractor circuit? Q#3- What are the Difference and Borrow out output from this full-subtractor circuit? Q#4- What are the Difference and Borrow out output from this full-subtractor circuit? Q#5- What are the Difference and Borrow out output from this full-subtractor circuit? Q#6- What are the Difference and Borrow out output from this full-subtractor circuit? HINT: truth table from textbook (Fig. 10-10) is helpful ANSWER: Di = 0, Bo = 0 ANSWER: Di = 1, Bo = 1 ANSWER: Di = 1, Bo = 1 ANSWER: Di = 0, Bo = 1 ANSWER: Di = 1, Bo = 0 ANSWER: Di = 0, Bo = 0 (A – B - Bin) Bin = 0 A = 0 B = 0 (A – B - Bin) Bin = 1 A = 0 B = 0 ? (A – B - Bin) Bin = 1 A = 1 B = 1 (A – B - Bin) Bin = 1 A = 0 B = 1 (A – B - Bin) Bin = 0 A = 1 B = 0 (A – B - Bin) Bin = 0 A = 1 B = 1

Parallel Adding Use half adder for LSD Use full adder for other digits A2 A1 A0 + B2 B1 B0

1s place uses half-adder 2s, 4s, 8s places use full adders Enter binary numbers to be added here Parallel Adder 1 1 1 0 + 0 1 1 0 1 1 0 0 + 1 1 1 1 0 0 1 1 + 1 0 0 0 1 0 1 0 0 1 1 0 1 1 0 1 0 1 1 SUM appears here 1s place uses half-adder 2s, 4s, 8s places use full adders Parallel adders are available in IC form. ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

QUIZ Q#1- With the top full adder’s Cin input LOW, this operates as a half-adder while the bottom three are full adders. (T or F) Q#2- When the 4-bit parallel adder adds binary 1100 and 0011 the sum appearing at the lower right will be ___. Q#3- When the 4-bit parallel adder adds binary 0111 and 1001 the sum appearing at the lower right will be ___. Q#4- When the 4-bit parallel adder adds binary 1101 and 1001 the sum appearing at the lower right will be ___. Q#5- When the 4-bit parallel adder adds binary 0011 and 0110 the sum appearing at the lower right will be ___. Q#6- When the 4-bit parallel adder adds binary 1111 and 1111 the sum appearing at the lower right will be ___. Q#7- When the 4-bit parallel adder adds binary 1010 and 1001 the sum appearing at the lower right will be ___. 4-bit number ANS: True ANS: 01111 ANS: 10000 ANS: 10110 ANS: 01001 ANS: 11110 ANS: 10011

Parallel Subtractor Using Full Adders HIGH at Carry in input acts like adding +1 to a 1s C number to form the 2s complement. 1sC is formed by four inverters. HIGH at Carry in input makes this perform as a full adder circuit Binary numbers to be subtracted are input here 1 1 1 1 - 0 0 1 1 1 0 0 1 - 0 1 1 1 1 1 0 0 Note the use of four full adder circuits Also notice the addition of four inverters on the B inputs to the FAs The result (difference) of the subtraction problem will appear here. 0 0 1 0 Inverters

Binary Multiplication Example: Multiply the binary numbers 111 and 101. 1 1 1 x 1 0 1 Multiplicand Multiplier 1 1 1 1st partial product 2nd partial product 1 1 1 3rd partial product 1 1 1 Product 111 x 101 can also be calculated: 111 + 111 + 111 + 111 + 111

QUIZ Multiply the binary numbers 101 and 100. 1 0 1 x 1 0 0 1 1 1 1

Binary Multipliers Binary multiplier circuits – utilize repeated addition. Block Diagram: Multiplicand register Multiplier down counter Product Adder

2s Complement Notation 2s complement representation - widely used in microprocessors. Represents sign and magnitude MSB LSB Sign bit (0 = + ; 1 = -) Decimal: +7 +4 +1 0 -1 -4 -7 2s Complement: 0111 0100 0001 0000 1111 1100 1001

Decimal to 2s Complement 2s Complement - Conversions Converting positive numbers to 2s complement: Same as converting to binary Converting negative numbers to 2s complement: Decimal to 2s Complement 2s Complement to Binary - 4 (decimal) 1 1 0 0 (2s C) Convert decimal to binary 1s complement 0 1 0 0 1s complement 0 0 1 1 1 0 1 1 Add 1 Add 1 0 1 0 0 (Binary) - 4 = 1 1 0 0 (2s Complement)

QUIZ Q#1- Convert the decimal number –4 to 2s complement. Step 1: convert decimal to binary Step 2: convert to 1s complement Step 3: add +1 equaling 2s complement 0100 0111 0001 0110 1000 1011 1000 1110 Not needed 0111 1100 2s C 1001 2s C 1111 2s C Not needed 1000 2sC ANS: -4 = 1100 2sC ANS: -7 = 1001 2sC ANS: -1 = 1111 2sC ANS: +6 = 0110 2sC ANS: -8 = 1000 2sC

QUIZ Q#1- Convert the 2s complement number 1110 to decimal. Not needed 1001 1111 Step 1: convert to 1s complement Step 2: Add +1 Step 3: convert binary to decimal 0001 Not needed 0110 0000 0010 binary 0101 binary 0111 binary 0001 binary 2 decimal 5 decimal 7 decimal 1 decimal ANS: 1110 2sC = -2 decimal ANS: 0101 2sC = +5 decimal ANS: 1001 2sC = -7 decimal ANS: 1111 2sC = -1 decimal

Adding/Subtracting in 2s Complement 2s complement notation makes it possible to add and subtract signed numbers (Decimal) 2s Complement (- 1) + (- 2) 1 1 1 1 + 1 1 1 0 (- 3) Discard 1 1 1 1 2s complement (+1) + (- 3) 0 0 0 1 + 1 1 0 1 (- 2) 1 1 1 2s complement

QUIZ Add the following 2s complement numbers: (+5) + (- 4) 0 1 0 1 + 1 1 0 0 (+1) 1 1 Discard

Practical Suggestion for Binary Math Use a scientific calculator. Most scientific calculators have DEC, BIN, OCT, and HEX modes and can either convert between codes or perform arithmetic in different number systems. Most scientific calculators also have other functions that are valuable in digital electronics such as AND, OR, NOT, XOR, and XNOR logic functions.

REVIEW Binary Addition Half & Full Adders Binary Subtraction Half & Full Subtractors Parallel Adders and Subtractors Using Adders for Subtraction Binary Multiplication Binary Multipliers 2s Complement Notation 2s Complement Adding/Subtracting

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 11 Memories ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Overview of Memory Random Access Memory (RAM) Read Only Memory (ROM) Programmable ROM (PROM) Nonvolatile Read/Write Memory Memory Packaging Computer Bulk Storage Devices Digital Potentiometer with NV EEPROM

Overview of Memory Three Important Characteristics of Semiconductor Memory: Density - Amount of data that the memory can store (Non-) Volatility - Data storage capability if power is disconnected Read/write capability - Capability to update memory

QUIZ 1. Three important characteristics of semiconductor memory are (1) density, (2) non-volatility, and (3) a read/write capability. (True or False) True 2. High density (small memory cell size) is a desirable characteristic of modern semiconductor memories. (True or False) True 3. Generally, if a semiconductor memory is nonvolatile this is a desirable characteristic. (True or False) True 4. A semiconductor memory that can be updated is referred to as a(n) __________ (read-only, read/write) memory. read/write

Overview of Memory (Continued) Categories of Semiconductor Storage Cells: DRAM (Dynamic Random-Access Memory) SRAM (Static Random-Access Memory) ROM (Read-Only Memory) EPROM (Electrically Programmable ROM) EEPROM (Electrically Erasable PROM) Flash Memory FRAM (Ferroelectric RAM) MRAM (Magnetoresistive RAM) See future slides for characteristics of each category of memory.

QUIZ Static Random-Access Memory SRAM is an acronym for _______. ROM is an acronym for _______. Read-Only Memory Dynamic Random-Access Memory DRAM is an acronym for ______. Electrically Erasable PROM EEPROM is an acronym for _______. PROM is an acronym for _______. Programmable ROM

Overview of Memory (Continued) Important Semiconductor Memory Characteristics: High Density Non Volatile Electrically Updatable EPROM ROM DRAM Flash MRAM EEPROM SRAM + Battery FRAM

QUIZ True can Flash True True 1. Both a ROM and EPROM are nonvolatile and have high density but cannot be electrically updated. (True or False) True 2. The DRAM is a high density semiconductor memory that __________ (can, cannot) be electrically updated. can 3. The __________ (Flash, PROM) is a modern memory that exhibits high density, is nonvolatile, and can be updated electrically. Flash 4. SRAM with a battery backup (as in modern PCs) is nonvolatile, and can be updated electrically. (True or False) True FRAM and MRAM are both non-volatile RAMs using newer technologies. (True or False) True

Random-Access Memory (RAM) Characteristics of RAM: Data can be “written” to RAM Stored data can be “read” at any time Volatile - cannot be used for permanent memory Access to any memory location (address) at any moment Types of RAM: SRAM (Static RAM) - stores data in flip-flop-like cells. Holds 0 or 1 as long as IC has power (volatile). DRAM (Dynamic RAM) - memory cells need refreshing many times per second. Also volatile.

QUIZ 1. Two types of RAM semiconductor memories are the DRAM and __________. SRAM 2. The RAM is a __________ (non-volatile, volatile) semiconductor memory. volatile 3. Modern computers contain both SRAM and DRAM types of semiconductor memories. (True or False) True 4. Both SRAM and DRAM are types of read-only semiconductor memories. (True or False) False 5. RAM semiconductor memory has exactly the same characteristics as Flash memory because they are non-volatile, can be updated electrically, and have high density. (True or False) False

Read-Only Memory (ROM) Characteristics of ROM: Non-volatile - memory is not lost when power is turned off Data is stored permanently Data stored in ROM can be “read” at any time ROM cannot be reprogrammed High density

QUIZ 1. ROM stands for __________. Read-Only Memory 2. ROM is a semiconductor memory that can be updated electrically and is volatile. (True or False) False 3. ROM is a high density semiconductor memory that __________ (can, cannot) be reprogrammed. cannot 4. Data is stored permanently in a ROM semiconductor memory. (True or False) True

Programmable Read-Only Memory (PROM) Data can be programmed or “burned” into a PROM. Mask-Programmable ROM (usually simply called ROM) Field-Programmable ROM (PROM) Erasable Programmable ROM (EPROM) Electrically Erasable PROM (EEPROM or E2PROM) Flash EEPROM Types of PROM:

Programmable Read-Only Memory QUIZ Programmable Read-Only Memory PROM stands for __________. 2. A mask-programmable ROM can only be programmed once and is generally known as a ROM. (True or False) True 3. An EEPROM is an electrically erasable PROM that is non-volatile and can be updated electrically. (True or False) True 4. A Flash memory is an electrically erasable PROM that has high density, is volatile, and cannot be updated electrically. (True or False) False

Nonvolatile Read/Write Memory Nonvolatile memory - memory that can retain stored information when power is turned off. SRAM with battery backup - Typically a long-life lithium battery Flash Memory - Nonvolatile - In-system rewritable (read/write) - Highly reliable - Low power consumption - High density NVSRAM (Non-Volatile Static RAM) - Better access speed and overall life than SRAM with battery backup

QUIZ Memory that retains its stored information even when power is turned off is referred to as __________ (volatile, nonvolatile). nonvolatile 2. SRAM is a __________ (volatile, nonvolatile) type of semiconductor memory. volatile 3. SRAM with battery backup as used in modern PCs is a _________ (volatile, nonvolatile) type of semiconductor memory. nonvolatile 4. Flash memory features high density, is reliable, can be electrically updated and is __________ (volatile, nonvolatile). nonvolatile

(Using newer technologies) Other Nonvolatile RAM (Using newer technologies) FRAM (ferroelectric RAM) -Nonvolatile RAM -In-circuit programmable -Good access speed -Low density -High cost -Ferroelectric capacitor and MOS transistor memory cell MRAM (magnetoresistive RAM) -Nonvolatile RAM -In-circuit programmable -Excellent access speed -High density -Nanotechnology used in fabrication

Common Methods of Packaging Semiconductor Memory DIP (Dual In-line Package) SIP (Single In-line Package) ZIP (Zig-zag In-line Package) SIMM (Single In-line Memory Module) DIMM (Dual-In-line Memory Module) RIMM (like DIMM by Rambus, Inc.) Memory card (like Flash memory card)

Computer Bulk Storage Devices Primary storage - computer’s internal storage Secondary storage - external storage Types of secondary storage devices: Mechanical Devices - Punched paper card - Punched or perforated paper tape Magnetic Devices - Magnetic tape (sequential-access device) - Magnetic drum - Hard disk - Floppy disk

Computer Storage Devices Types of Secondary Storage Devices (cont’d.): Optical Devices - CD-ROM (Read-only) - CD-R (recordable) - CD-RW (rewritable) - WORM (Write-once Read-many - DVD (Digital versatile disc or digital video disc) - Magneto-optical disc- part optical/part magnetic Semiconductor Devices - Flash EEPROM semiconductor memory

QUIZ 1. A 3.5 inch floppy disk is an example of a __________ (primary, secondary) storage device. secondary 2. The SRAM in your PC is an example of a __________ (primary, secondary) storage device. primary 3. The CD-R optical disc is __________ (recordable, rewritable). recordable 4. The CD-RW optical disc is _________ (recordable, rewritable). rewritable

Sets position of wiper stored in EEPROM 6K ohms Digital Potentiometer Digital potentiometer is an electronic device comparable to a traditional potentiometer with resistance outputs variable in discrete steps. The wiper position is stored in EEPROM when the power is turned off. Digital input pulses control the movement of the wiper. Also referred to as a solid-state potentiometer or non-volatile (NV) digital potentiometer. +5V Power ON H HIGH=Up LOW=Down U / D 5K ohm 50% 5K ohm 50% 6K ohm 60% 4K ohm 40% Control Logic Sets position of wiper stored in EEPROM 6K ohms Negative pulse 3 Negative pulse 1 Negative pulse 2 Negative pulse 4 Resistance (10kΩ- 10 Steps) INC EEPROM L

QUIZ 1. The electronic equivalent of a potentiometer is called a solid-state potentiometer or __________. Digital potentiometer 2. The digital potentiometer contains a __________ (EEPROM, ROM) section to store the wiper position on power down and recall the wiper position on power up. EEPROM 3. A single negative pulse will cause the wiper of a digital potentiometer to move one discrete step up or down depending on the condition of the U/D’ control input. (True or False) True

REVIEW Overview of Memory Random Access Memory (RAM) Read Only Memory (ROM) Programmable ROM (PROM) Nonvolatile Read/Write Memory Memory Packaging Computer Bulk Storage Devices Digital Potentiometer with NV EEPROM

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 12 Digital Systems ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Elements of a System Complexity of ICs Digital Games Digital Clock Multiplexing Displays Simplified Frequency Counter Digital Timer JTAG/Boundary Scan Technology

Elements of a System Control Input Storage Processing Output

A System- Classical Computer Organization Memory Output Input Arithmetic and Logic Control

QUIZ Q#1- In classical computer organization, the block labeled A would be the ___ section. Q#2- In classical computer organization, the block labeled B would be the ___ section. Q#3- In classical computer organization, the block labeled C would be the ___ section. ANS: control ANS: memory ANS: ALU B Output Input C A

Complexity of ICs The complexity of integrated circuits suggests an evolution in the design and manufacturing of ICs starting in the 1960s. SSI- small-scale integration- up to 12 transistors- early 1960s MSI- medium-scale integration- 12-99 transistors, late 1960s LSI- large-scale integration- 100-9,999 transistors, mid 1970s VLSI- very large-scale integration- over 10,000 transistors, 1980s and beyond

Digital Dice Games Roll Dice Clock Counter Mod-6 Decoder/ Driver +5V Logic Block +5V

Digital Roulette Game Audio Power-up Initializing Circuit Spin Wheel Amplifier Power-up Initializing Circuit Spin Wheel input +5V Voltage Controlled Oscillator (VCO) Ring Counter (shift register) Simulated Roulette Display

DIGITAL CLOCK Hours Minutes Seconds Decoder/driver Decoder/driver 1 pph 1 ppm Mod 12 counter Mod 60 counter Mod 60 counter 1 Hz 1 pps DIGITAL CLOCK 60 Hz  60

QUIZ A digital clock consists of many counters used to divide frequency and to serve as a temporary memory to hold the last count at the inputs of the decoder/drivers. (True or False) True 2. A digital clock uses many shift registers to convert from the BCD output of the counters to seven-segment code and to drive the displays. (True or False) False 3. The primary input to a digital clock is a(n) ________ (known, unknown) frequency which is divided into seconds, minutes, and hours using counters. known

Multiplexed Displays a 8 b BCD- 4 c 7-seg driver 2 d e 1 f g Digit drivers

11 cycles are counted (fX = 11 Hz) A Basic Digital Frequency Counter Start/stop Counters/decoders/drivers fX fX Start/stop 1 second { 11 cycles are counted (fX = 11 Hz)

QUIZ In driving displays, to turn on and then off one of several displays each for a short time in turn at a high enough frequency so they appear to be lit continuously is called _______________ (function polling, multiplexing). multiplexing 2. A circuit who counts the number of pulses from an unknown frequency source in a given time then stops, decodes the accumulated count, and displays the count in hertz is called a _________ (decade counter, frequency counter). frequency counter

Digital Timer Clock (time base) Input controls Self-stopping Down counter Latch/Decoder Driver Magnitude comparator Alarm

QUIZ Q#1- In this digital timer circuit, the block labeled A is a(n) ___ (self-stopping down counter, serial-load shift register). Q#2- In this digital timer circuit, the block labeled B is a(n) ___ (latch/decoder/driver, shift register). Q#3- In this digital timer circuit, the block labeled C is a(n) ___ (magnitude comparator, op amp). ANS: self-stopping down counter ANS: latch/decoder/driver ANS: magnitude comparator Clock (time base) Input controls A B C Alarm

JTAG / Boundary Scan JTAG: Provides simple test access to ICs and circuit boards Is extendible - custom test needs can be met Allows quick and easy test generation and application Is NOT limited by IC complexity nor board density JTAG/Boundary Scan circuits can test: the internal logic of each IC the interconnections (nets) between ICs the logic of ICs that are NOT JTAG compliant JTAG/Boundary Scan can be used to: test and debug circuit designs find faulty circuit boards in manufacturing Troubleshoot previously working JTAG circuits

An Example JTAG Test 1. Test data is shifted in at TDI & latched in the input BSCs TDO TAP Controller TDI TMS TCK IC C o r e 2. The latched data is used as input data to the chip logic 3. Output from the chip logic is captured in the output BSCs 1011 0100 The captured test data is shifted out through TDO

QUIZ Boundary scan testing of complex circuit boards is commonly know by what four letters that represent the name of the original group that worked on this method. JTAG 2. JTAG provides simple test access to ICs and circuit boards. (True or False) True 3. JTAG which is also called boundary scan is the name for a security technique used to guard government buildings and military bases. (True or False) False 4. JTAG compliant pc boards are soaked in a special varnish to make them resistance to chemical vapors, moisture and radiation. (True or False) False

REVIEW Elements of a System Complexity of ICs Digital Games Digital Clock Multiplexing Displays Simplified Frequency Counter Digital Timer JTAG/Boundary Scan Technology

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 13 Computer Systems ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Elements of a System Computer Organization Computer Peripheral Devices MPU Based System Serial/Parallel Data Transmission Programmable Logic Controller Microcontrollers Digital Signal Processing

Elements of a System (Review) Control Input Storage Processing Output

Computer Organization - Classical Memory Output Input Arithmetic and Logic Control

QUIZ Q#1- In classical computer organization, the block labeled A would be the ___ section. Q#2- In classical computer organization, the block labeled B would be the ___ section. Q#3- In classical computer organization, the block labeled C would be the ___ section. ANS: control ANS: memory ANS: ALU B Output Input C A

Computer Peripheral Devices Internet, network, wireless or modem Fax Keyboard Mouse Joystick Paddles Graphics tablet Microphone Light pen Scanner Bar code reader Strip reader Various Sensors Digital Camera CPU and Internal Memory Output Input Input/Output Storage Monitor (CRT or LCD) Television Printer Speaker Plotter Floppy disk drive Hard disk drive Optical disc drive Tape unit Flash memory device

QUIZ Both CRT and thin-screen (LCD) monitors are classified as __________ (output, storage) peripheral devices in a computer system. output 2. Both hard and floppy disk drives and well as CD-ROM drives are classified as __________ (output, storage) peripheral devices in a computer system. storage 3. Both the keyboard and a mouse are classified as __________ (input, output) peripheral devices in a computer system. input 4. A modem is classified as an storage peripheral device in a computer system. (True or False) False

Microcomputer System Block Diagram Input ports The input ports connect to devices such as keyboards The address bus is unidirectional The data bus is bidirectional MPU The MPU is the heart of the system ROM The ROM contains programs and permanent data The control bus is unidirectional RAM The RAM contains temporary data (and programs) Output ports The output ports connect to devices such as printers

(microprocessor unit) QUIZ 1. In a microcomputer system, the ____ (MPU, RAM) is considered to be the center of operations directing the other sections. MPU (microprocessor unit) 2. In a microcomputer system, the ________ (data bus, address bus) is bidirectional so information can pass to and from the MPU. data bus In a microcomputer system, both the address bus and the control bus are unidirectional paths for the MPU to direct memory, input ports, and output ports. (True or False) True

signal on the control bus 3. The addressed port puts IN Reading input data Input ports 2. The MPU asserts a READ signal on the control bus 1. The MPU places an input address on the bus 3. The addressed port puts its data on the bus 4. The data is stored in the MPU MPU MPU ROM RAM Output ports

signal on the control bus 1. The MPU places an output Writing output data Input ports 2. The MPU asserts a WRITE signal on the control bus 1. The MPU places an output address on the bus 3. The MPU places the data on the bus MPU ROM 4. The data is written to the output port Output ports RAM Output ports OUT

Serial/Parallel Data Conversion Shift registers can be used to convert from serial-to-parallel or the reverse from parallel-to-serial. 1 0 1 0 1 1 1 1 Serial in Parallel out 1 0 1 0 1 1 1 1 Parallel in Parallel out 1 0 1 0 1 1 1 1 Serial in Serial out 1 0 1 0 1 1 1 1 Serial out Parallel in

Serial data transmission A UART receives bytes from the data bus and transmits them one bit at a time. UART Receiver RS232 Driver Start bit Stop Bit Bit 6 Bit 4 Bit 1 Bit 2 Bit 3 Bit 7 Bit 5 Bit 0 To modem Transmitter Serial data transmission is relatively slow! Control

Parallel data transmission is relatively fast! Here, the UART assembles bits from the serial port and places them on the data bus one byte at a time. UART RS232 to Logic Level Receiver 01101110 Transmitter From modem Parallel data transmission is relatively fast! Control

QUIZ The transfer of data over a single path, one bit after the other, is called __________ (serial, single-channel codec) transmission. serial 2. The transfer of data over multiple paths, many bits at once, is called __________ (multipactor, parallel) transmission. parallel 3. A(n) __________ (AND gate, UART) IC can send and receive serial and parallel data. UART 4. Generally, serial transfer of data is faster than parallel data transmission. (True or False) False

Programmable Logic Controllers PLCs are heavy-duty computer systems used for machine control. PLCs must be rugged to withstand the rigors of a chemical, warehouse/storage, or assembly line environment. PLCs use MODULAR organization. Power Supply Programming Module Memory Processing Module CPU Output Input Input Sensors - pressure - mechanical - optical -magnetic A/D converters Motors Solenoids Pneumatic devices D/A converters

QUIZ PLC (programmable logic controller) 1. A(n) __________ (MCU, PLC) is a heavy duty computer system used for machine control. 2. Programmable logic controllers (PLCs) must be rugged to withstand the rigors of a chemical, warehouse, or assembly line environment. (True or False) True 3. The typical input device to a PLC system might be an A/D converter or pressure/optical/magnetic sensor instead of a keyboard and mouse. (True or False) True 4. The typical output device from a PLC system might be a monitor or printer and not a D/A converter, motor or solenoid. (True or False) False

Microcontrollers A microcontroller is considered a “computer on a chip.” A microcontroller IC contains a CPU, RAM, ROM or EEPROM, a clock, and input/output capabilities. Microcontrollers are: Very inexpensive Commonly preprogrammed and embedded in products Commonly used to perform control functions Manufactured in huge quantities NOT used as the CPU in general purpose computers Microcontroller-based systems have much less semiconductor memory (RAM, EEPROM), cost less, use less printed circuit board space, and perform fewer commands than microprocessor based systems.

QUIZ 1. A __________ (microcontroller, PLD) IC is considered close to a “computer on a chip.” microcontroller 2. A microcontroller IC is an expensive unit used in only the highest priced computer workstations. (True or False) False 3. Microcontrollers are manufactured in huge quantities and are very inexpensive. (True or False) True 4. A microcontroller contains a CPU, RAM, ROM or EEPROM, a clock, and some input/output capabilities. (True or False) True 5. Inexpensive microcontrollers are commonly embedded in products to perform control functions. (True or False) True

Digital Signal Processing System Block Diagram A/D Mem-mory DSP D/A A/D Mem-mory DSP D/A x 2 7 14 10 20 7 14 -7 -14 -10 -20 -7 -14

QUIZ Q#1- The digital signal processor (DSP) is a microprocessor-like IC that can be programmed to condition or enhance signals. (T or F) Q#2- The block labeled A in the DSP system is a(n) ___ (A/D, D/A) converter. Q#3- The block labeled B in the DSP system is a ___ (memory, microprocessor) device. Q#4- The block labeled C in the DSP system is a ___ (D/A converter, printer interface device). ANS: True ANS: A/D ANS: memory ANS: D/A converter DSP A B C

Digital Signal Processing Digital Signal Processors are used in many electronic devices today, such as: MP3 players, DVD players, modems, cellular phones, and digital cameras. Digital Signal Processors: Are designed to quickly perform many multiplications and additions per second Are used to consistently and reliably change the characteristics of a digital signal Can process signals in real-time or ‘off-line’ Are NOT used as the CPU in general purpose computers

REVIEW Elements of a System Computer Organization Computer Peripheral Devices MPU Based System Serial/Parallel Data Transmission Programmable Logic Controller Microcontrollers Digital Signal Processing

Principles & Applications Digital Electronics Principles & Applications Seventh Edition Roger L. Tokheim Chapter 14 Connecting with Analog Devices ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION Hybrid System (analog-to-digital-to-analog) A/D and D/A Converters (block diagrams) Simple 4-bit D/A Converter Simple D/A Converter Operation Counter-ramp-type A/D Converter Ramp-type A/D Converter Successive-approximation A/D Converter Flowcharting- Successive Approximation A/D Converter Specifications Digital Light Meter Digitizing temperature

Hybrid System (Both Analog and Digital) input Encoder A/D Converter Digital Processing Unit Decoder D/A Converter Analog output Converts from analog input to digital output Converts from digital input to analog output

QUIZ A B 1. The encoder in block A is a(n) __________. A/D converter 2. The decoder in block B is a(n) __________. D/A converter Analog input Digital Processing Unit output A B Hybrid System- both Analog and Digital Components

A/D and D/A Converters Digital-to-analog converter Processing Unit Decoder D/A Converter Encoder A/D Analog output input Digital-to-analog converter A/D Analog-to-digital converter 0 1 1 0 0 1 1 0 Resistor Network Summing Amplifier Analog Voltage INPUT

Simple D/A Converter 2N = 16 Vreference 150 k 75 k 37.5 k 18.7 k Binary inputs N = 4 3 V Feedback resistor Vreference 10 k 2N = 16 37.5 k 75 k 150 k Summing amplifier (inverting) Input resistors This circuit can produce 16 different analog output voltages.

D/A Converter Operation Binary input = 0000 0001 3 V 10 k = 0.2 V = 0 V 18.7 k 37.5 k 150 k 75 k Vout = x 3 V = 0.2 V 10 k 150 k The smallest step size for this circuit is 0.2 V.

4-Bit D/A Converter As the binary input steps from 0000 to 1111 Vout(max) = (2N - 1) x 0.2 V = 3 V 3 V Vout steps from 0 V to 3 V 0 V 3 V 10 k The total span for this circuit is from 0 to 3 V.

QUIZ Q#1- If the binary input to the D/A converter is 0000, then the output voltage will be ___. Q#2- If the binary input to the D/A converter is 0001, then the output voltage will be ___. Q#3- If the binary input to the D/A converter is 1111, then the output voltage will be ___. Q#4- If the binary input to the D/A converter is 0111, then the output voltage will be ___. Q#5- The main active component in the summing amplifier is a(n) ___ (audio, operational) amplifier. ANS: 0V ANS: 0.2V ANS: 3V ANS: 1.4V ANS: operational 0 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 Summing Amplifier Resistor network D/A converter- (output steps by 0.2V per binary count) 0V V 0.2V 3V 1.4V

Counter-Ramp Type A/D Converter Binary output Vin Clock ramp Counter Comparator HIGH LOW D/A Converter Vin When the ramp exceeds Vin the comparator output goes LOW and the clock is disabled. ramp

ANS: voltage comparator QUIZ Q#1- The block labeled A is a(n) ___ (4-bit counter, op amp). Q#2- The block labeled C is a(n) ___ (D/A converter, A/D converter). Q#3- The block labeled B is a(n) ___ (serial-load shift register, voltage comparator). ANS: 4-bit counter ANS: D/A converter ANS: voltage comparator A Clock Binary output Vin B C ramp Counter-ramp type A/D converter (0.2V per step of ramp voltage)

Ramp-type A/D Converter 0 1 0 1 Vin Clock Counter Comparator Ramp Generator Binary output LOW Vin = + 5 V Comparator output Clock pulses to counter

ANS: voltage comparator QUIZ Q#1- The block labeled A in the A/D converter is a(n) ___ (binary counter, op amp). Q#2- The block labeled B in the A/D converter is a(n) ___ (ramp generator, shift register). Q#3- The block labeled C in the A/D converter is a(n) ___ (decade counter, voltage comparator). ANS: binary counter ANS: ramp generator ANS: voltage comparator Vin Clock A C B Binary output Ramp-type A/D Converter

Successive-approximation type A/D Converter Logic Voltage Comparator D/A Converter Clock Binary output 7V input 0 1 1 1 Vin

Flowcharting Successive Approximation Assume an input of 7V to a 4-bit binary output A/D converter using successive approximation Start 7 V input Set MSB to 1 Is 0100 high or low? HIGH LOW Set 2s place to 1 Is 1000 high or low? LOW HIGH Is 0110 high or low? HIGH LOW Clear 8s. Set 4s to 1. Set 1s place to 1 STOP Final result= 0111

ANS: successive-approximation logic ANS: voltage comparator QUIZ Q#1- The block labeled A contains the ___ (shift register, successive-approximation logic) unit. Q#2- The block labeled B contains the ___ (D/A converter, successive-approximation logic) unit. Q#3- The block labeled C contains the ___ (ramp generator, voltage comparator) unit. ANS: successive-approximation logic ANS: D/A converter ANS: voltage comparator A C B Clock Binary output 7V input 0 1 1 1 Successive-approximation type A/D converter

A/D Converter Specifications Type of output Binary (microprocessor-type) Decimal (digital meter type) Resolution Binary output- number of bits (such as 4, 6, 8, 12, 14 or 16) Decimal output- number of digits on display (such as 3 1/2 or 4 1/2) Accuracy Binary output- (ranges from +/- 1/2 LSB to about +/- 2 LSB) Decimal output- (ranges from about 0.01 to 0.05 percent) Conversion time is the time it takes for the IC to convert the analog input voltage to digital output. Binary output A/D converters commonly have faster conversion times than decimal output types.

QUIZ One classification of commercial A/D converters is by the type of output which include either __________ (analog-, binary-) or decimal-type outputs. binary- 2. The resolution of a commercial A/D converter with microprocessor-type output (binary output) would be the number of bits in the output (such as 8-bits for the ADC0804 IC). (True or False) True 3. The time required for a commercial A/D converter to transform the analog input to a digital output is a characteristic called __________ (access time, conversion time). conversion time 4. Generally, decimal output commercial A/D converters have faster conversion times than binary output types. (True or False) False

Digital Light Meter Photocell (photoresistive cell) More I = More Vin = Higher binary output Increase light Lower R Decrease light Less I = Less Vin = Lower binary output Higher R Increase I Higher Vin Lower I Decrease Vin Higher binary output Lower binary output

QUIZ Q#1- Increasing the light striking the photocell will cause a(n) ___ (decrease, increase) in its resistance. Q#2- Increasing the light striking the photocell will cause a(n) ___ (decrease, increase) in current (I) flowing through resistor R2. Q#3- Increasing the light striking the photocell will cause a(n) ___ (decrease, increase) in voltage across resistor R2 (Vin). Q#4- Increasing the light striking the photocell will cause a(n) ___ (decrease, increase) in the binary value at the outputs of the ADC. Q#5- Decreasing the light striking the photocell will cause a(n) ___ (decrease, increase) in the binary value at the outputs of the ADC. ANS: decrease ANS: increase ANS: increase ANS: increase ANS: decrease Decrease light Increase light ©2008 The McGraw-Hill Companies, Inc. All rights reserved.

Digitizing Temperature Increase in temperature Decrease in temperature using a Thermistor Thermistor- Temperature-sensitive Resistor As temperature inceases the resistance of the thermistor decreases Digital Output Increase in temperature causes decreased resistance Decrease in temperature causes increased resistance Low output High Output Causing increase in I & increase in Vin Causing decrease in I & decrease in Vin Analog Input (Vin)

QUIZ Q#1- Component R3 is a temperature transducer called a _____ (Hall-effect resistor, thermistor). Q#2- The Schmitt-trigger inverter converts an analog input voltage to a digital (HIGH or LOW) output. (True or False) Q#3- Decreasing the temperature of thermistor R3 will cause its resistance to _____ (decrease, increase). Q#4- Decreasing the temperature of thermistor will cause Vin to decrease and the output of the inverter will go _____ (HIGH, LOW). Q#5- Increasing the temperature of thermistor will cause its resistance to decrease and Vin to _____ (decrease, increase). Q#6- Increasing the temperature of thermistor will cause its resistance to decrease, Vin to increase and the output to go _____ (HIGH, LOW). ANS: thermistor ANS: True ANS: increase ANS: HIGH ANS: increase ANS: LOW Output Vin

REVIEW Hybrid System (analog-to-digital-to-analog) A/D and D/A Converters (block diagrams) Simple 4-bit D/A Converter Simple D/A Converter Operation Counter-ramp-type A/D Converter Ramp-type A/D Converter Successive-approximation A/D Converter Flowcharting- Successive Approximation A/D Converter Specifications Digital Light Meter Digitizing temperature