Download AND Gate - Share ITS

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
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
• 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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
• “All or Nothing Gate”
• Boolean Expression:
A · B = Y
• Truth Table (See next slide)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Truth Table - AND Gate
B
A
Y
0
0
0
0
1
0
1
0
0
1
1
1
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
What is the output of the AND gate?
L
L
L
H
? Low
?Low
H
H
H
?High
?Low
L
Unique Output: Output HIGH only when all inputs are HIGH.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
• “Any or All Gate”
• Boolean Expression:
A + B = Y
• Truth Table (See next slide)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Truth Table - OR Gate
B
A
Y
0
0
0
0
1
1
1
0
1
1
1
1
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
What is the output of the OR gate?
H
H
?High
?High
H
L
L
L
L
?Low
?High
H
Unique Output: Output LOW only when all inputs are LOW.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
•
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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. 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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
• NOT AND or inverted AND function.
• Boolean Expression:
or
A · B = Y
(A · B)' = Y
• Truth Table (See next slide)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Truth Table - NAND Gate
B
A
AND NAND
0
0
0
1
0
1
0
1
1
0
0
1
1
1
1
0
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
What is the output of the NAND gate?
L
L
?High
?High
L
H
H
H
H
?Low
?High
L
Unique Output: Output LOW only when all inputs are HIGH.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
• NOT OR or Inverted OR
• Boolean Expression: A + B = Y
or (A + B)' = Y
• Truth Table (See next slide)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Truth Table - NOR Gate
B
A
OR
NOR
0
0
0
1
0
1
1
0
1
0
1
0
1
1
1
0
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
What is the output of the NOR gate?
L
L
?High
?Low
L
H
H
H
L
?Low
?Low
H
Unique Output: Output HIGH when all inputs are LOW.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
• Known as “Exclusive OR” Gate
• “Anything but not all” Gate
• Boolean Expression:
A  B=Y
• Truth Table (See next slide)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Truth Table - XOR Gate
B
A
OR
XOR
0
0
0
0
0
1
1
1
1
0
1
1
1
1
1
0
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
What is the output from the XOR gate?
L
L
L
H
H
H
??Low
L
L
H
? High
?High
H
H
L
??Low
XOR output is HIGH only when odd number of inputs are HIGH
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
• Known as the Exclusive NOR Gate
• The Inverted XOR
• Boolean Expression:
A  B=Y
or (A  B)' = Y
• Truth Table (See next slide)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Truth Table - XNOR Gate
B
A
XOR XNOR
0
0
0
1
0
1
1
0
1
0
1
0
1
1
0
1
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
What is the output from this XNOR gate?
L
L
L
H
H
L
?High
L
H
L
?Low
?High
H
H
H
?Low
XNOR output is HIGH only when odd number of inputs are LOW
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
The NAND as a Universal Gate
• “Universal gate” can be used in
combination to create any other logic
function.
Shorting NAND inputs
Yields the NOT logic function
• Example:
A+B
Equal to the
OR logic function
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. NAND gates can be wired together
to convert to other logic functions
(True or False).
2. These two NAND gates wired
together will produce the ______
(AND, XOR) logic function.
True
AND
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Using Inverters to Convert Gates
For example:
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Practical Logic Gates
• ICs - Integrated Circuit Form
• TTL Family of ICs
• CMOS Family of ICs
• TTL = Transistor-Transistor Logic
• CMOS = Complementary Metal Oxide
Semiconductor
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. Practical logic gates (AND-, OR-,
NAND-, NOT-gates) are packaged in
__________ form.
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 __________.
4. In digital electronics, logic gates are
manufactured using either TTL or
__________ technology.
IC
transistor-transistor
logic
CMOS
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. A simple hand-held instrument called a
__________ (logic probe, oscilloscope) can
be used for troubleshooting simple logic
gate circuits.
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.
3. The fourth step in troubleshooting is to use
a logic probe to check the power sources.
(True or False)
logic probe
smell
True
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
IEEE Logic Symbols
• A different set of symbols without unique shapes.
• Not very popular at this time.
Examples:
A
B
A
B
&
Y
1
Y
AND gate
OR gate
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
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.
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
1. 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.
3. A microcontroller is an inexpensive
programmable device that is commonly
embedded in everyday appliances, etc. (True or
False)
PC
True
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
Using the BASIC Stamp® Module
Step 1: Program the BS2 module using in
PBASIC language.
The key line
Step3: Disconnect
PC.of code is:
Y=A&B
which represents AB=Y or input A ANDed
with input B.
Digital Inputs
A
Input
AA==HIGH
Input
LOW
Input
A
=HIGH
HIGH
Input
B
=
Input
B
=
LOW
Input B = LOW
B
Digital Output
Step 2: Download the PBASIC
program
from
the PC
to the
Step
4: Turn
power
OFF
and then ON.
BASIC
Stamp®
module.
The
program
will 2start
at the beginning.
Observe the outputs with different inputs.
Y
HIGH
LOW
LOW
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
PBASIC Code for Logic Functions
Logic Function
PBASIC code for BS2
AND
OR
NOT
NAND
NOR
XOR
XNOR
Y=A& B
Y=A| B
Y = ~A
Y = ~(A & B)
Y = ~(A | B)
Y=A^ B
Y = ~(A ^ B)
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
QUIZ
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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.
REVIEW
• The AND Gate
• 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
©2008 The McGraw-Hill Companies, Inc. All rights reserved.