XOR, XNOR, and Binary Adders © 2014 Project Lead The Way, Inc.Digital Electronics.
Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.
-
Upload
elisha-finer -
Category
Documents
-
view
245 -
download
2
Transcript of Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.
![Page 1: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/1.jpg)
Lecture 6
More Logic Functions: NAND, NOR, XOR and XNOR
![Page 2: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/2.jpg)
Overview
° More 2-input logic gates (NAND, NOR, XOR)
° Extensions to 3-input gates
° Converting between sum-of-products and NANDs• SOP to NANDs
• NANDs to SOP
° Converting between sum-of-products and NORs• SOP to NORs
• NORs to SOP
° Positive and negative logic• We use primarily positive logic in this course.
![Page 3: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/3.jpg)
Logic functions of N variables
° Each truth table represents one possible function (e.g. AND, OR)
° If there are N inputs, there are 22N
° For example, is N is 2 then there are 16 possible truth tables.
° So far, we have defined 2 of these functions• 14 more are possible.
° Why consider new functions?• Cheaper hardware, more flexibility.
x0011
y0101
G0001
![Page 4: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/4.jpg)
Logic functions of 2 variables
Truth table - Wikipedia,
![Page 5: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/5.jpg)
The NAND Gate
° This is a NAND gate. It is a combination of an AND gate followed by an inverter. Its truth table shows this…
° NAND gates have several interesting properties…• NAND(a,a)=(aa)’ = a’ = NOT(a)
• NAND’(a,b)=(ab)’’ = ab = AND(a,b)
• NAND(a’,b’)=(a’b’)’ = a+b = OR(a,b)A B Y
0 0 1
0 1 1
1 0 1
1 1 0
AB
Y
![Page 6: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/6.jpg)
The NAND Gate
° These three properties show that a NAND gate with both of its inputs driven by the same signal is equivalent to a NOT gate
° A NAND gate whose output is complemented is equivalent to an AND gate, and a NAND gate with complemented inputs acts as an OR gate.
° Therefore, we can use a NAND gate to implement all three of the elementary operators (AND,OR,NOT).
° Therefore, ANY switching function can be constructed using only NAND gates. Such a gate is said to be primitive or functionally complete.
![Page 7: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/7.jpg)
AY
A
B
Y
YAB
NOT GateAND Gate
OR Gate
NAND Gates into Other Gates
(what are these circuits?)
![Page 8: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/8.jpg)
Cascaded NAND Gates
3-input NAND gate
![Page 9: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/9.jpg)
NAND Gate and Laws
![Page 10: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/10.jpg)
The NOR Gate
° This is a NOR gate. It is a combination of an OR gate followed by an inverter. It’s truth table shows this…
° NOR gates also have several
interesting properties…• NOR(a,a)=(a+a)’ = a’ = NOT(a)
• NOR’(a,b)=(a+b)’’ = a+b = OR(a,b)
• NOR(a’,b’)=(a’+b’)’ = ab = AND(a,b)
A B Y
0 0 1
0 1 0
1 0 0
1 1 0
AB
Y
![Page 11: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/11.jpg)
Functionally Complete Gates
° Just like the NAND gate, the NOR gate is functionally complete…any logic function can be implemented using just NOR gates.
° Both NAND and NOR gates are very valuable as any design can be realized using either one.
° It is easier to build an IC chip using all NAND or NOR gates than to combine AND,OR, and NOT gates.
° NAND/NOR gates are typically faster at switching and cheaper to produce.
![Page 12: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/12.jpg)
NOT Gate
OR Gate
AND Gate
NOR Gates into Other Gates
(what are these circuits?)A
Y
YAB
A
B
Y
![Page 13: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/13.jpg)
NOR Gate and Laws
![Page 14: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/14.jpg)
The XOR Gate (Exclusive-OR)
° This is a XOR gate.
° XOR gates assert their output
when exactly one of the inputs
is asserted, hence the name.
° The switching algebra symbol
for this operation is , i.e.
1 1 = 0 and 1 0 = 1.
° Output is high when either A or B is high but not the both
A B Y
0 0 0
0 1 1
1 0 1
1 1 0
AB
Y
![Page 15: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/15.jpg)
The XNOR Gate
° This is a XNOR gate.
° This functions as an
exclusive-NOR gate, or
simply the complement of
the XOR gate.
° The switching algebra symbol
for this operation is , i.e.
1 1 = 1 and 1 0 = 0.
A B Y
0 0 1
0 1 0
1 0 0
1 1 1
AB
Y
![Page 16: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/16.jpg)
XOR Implementation by NAND
NAND Implementation
XOR Expression
![Page 17: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/17.jpg)
XNOR Implementation by NAND
Bubbles cancels each others out
NOT gate acting as bubble
![Page 18: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/18.jpg)
NOR Gate Equivalence
° NOR Symbol, Equivalent Circuit, Truth Table
![Page 19: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/19.jpg)
DeMorgan’s Theorem
° A key theorem in simplifying Boolean algebra expression is DeMorgan’s Theorem. It states:
(a + b)’ = a’b’ (ab)’ = a’ + b’
° Complement the expression
a(b + z(x + a’)) and simplify.
(a(b+z(x + a’)))’ = a’ + (b + z(x + a’))’= a’ + b’(z(x + a’))’= a’ + b’(z’ + (x + a’)’)= a’ + b’(z’ + x’a’’)= a’ + b’(z’ + x’a)
![Page 20: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/20.jpg)
Example° Determine the output expression for the below circuit and simplify it using DeMorgan’s Theorem
![Page 21: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/21.jpg)
Combinational Logic Using Universal Gates
X = ( (AB)’(CD)’ )’
= ( (A’ + B’) (C’ + D’) )’= (A’ + B’)’ + (C’ + D’)’
= A’’ B’’ + C’’ D’’ = AB + CD
![Page 22: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/22.jpg)
Universality of NAND and NOR gates
![Page 23: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/23.jpg)
Universality of NOR gate
° Equivalent representations of the AND, OR, and NOT gates
![Page 24: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/24.jpg)
Example
![Page 25: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/25.jpg)
Interpretation of the two NAND gate symbols
° Determine the output expression for circuit via DeMorgan’s Theorem
![Page 26: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/26.jpg)
Interpretation of the two OR gate symbols° Determine the output expression for circuit via DeMorgan’s Theorem
![Page 27: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/27.jpg)
Alternate Logic-Gate Representations
Standard and alternate symbols for various logic gates and inverter.
Invert each input and output of the standard symbol, This is done by adding bubbles(small circles) on input and output lines that do not have bubbles and by removing bubbles that are already there.Change the operation symbol from AND to OR, or from OR to AND.(In the special case of the INVERTER, the operation symbol is not changed)
![Page 28: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/28.jpg)
Positive Logic and Negative Logic
We will be emphasizing primarily on positive logic in this course
![Page 29: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/29.jpg)
Axioms and Graphical representation of DeMorgan's Law
Y X Y X 14B)
Y X YX 14A)
YXYXX 13D)
YXYXX 13C)
YXXYX 13B)
YXYXX 13A)
YZYWXZXWZWYX 12B)
XZXYZYX 12A)
ZYXZY X 11B)
ZXYYZX 11A)
X Y Y X 10B)
X Y Y X 10A)
Commutative
Law
Associative Law
Distributive Law
Consensus Theorem
![Page 30: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/30.jpg)
![Page 31: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/31.jpg)
![Page 32: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/32.jpg)
NOR Gate and Laws
![Page 33: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/33.jpg)
NAND Gate and Laws
![Page 34: Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR.](https://reader035.fdocuments.in/reader035/viewer/2022062216/56649c4d5503460f948f2e71/html5/thumbnails/34.jpg)
Summary
° Basic logic functions can be made from NAND, and NOR functions
° The behavior of digital circuits can be represented with waveforms, truth tables, or symbols
° Primitive gates can be combined to form larger circuits
° Boolean algebra defines how binary variables with NAND, NOR can be combined
° DeMorgan’s rules are important. • Allow conversion to NAND/NOR representations