ece2030 introduction to computer engineering lecture 9: combinational logic, mixed logic prof....
TRANSCRIPT
![Page 1: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/1.jpg)
ECE2030 Introduction to Computer Engineering
Lecture 9: Combinational Logic, Mixed Logic
Prof. Hsien-Hsin Sean LeeProf. Hsien-Hsin Sean Lee
School of Electrical and Computer EngineeringSchool of Electrical and Computer Engineering
Georgia TechGeorgia Tech
![Page 2: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/2.jpg)
2
Logic Design• Logic circuits
– Combinational
– Sequential
Combinationalcircuits
Ninputs
Moutputs
Combinationalcircuits
inputs outputs
StorageElement
delaydelay
![Page 3: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/3.jpg)
3
Combinational Logic
• Outputs, “at any time”, are determined by the input combination
• When input changed, output changed immediately– Note that real circuits are imperfect and have “propagation
delay”
• A combinational circuit – Performs logic operations that can be specified by a set of
Boolean expressions– Can be built hierarchically
Combinationalcircuits
Ninputs
Moutputs
![Page 4: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/4.jpg)
4
Design Hierarchy Example
9-inputOdd Function
X0X1X2X3X4X5X6X7X8
Z
A0A1A2
3-inputOdd Function
ZA0A1A2
3-inputOdd Function
X3X4X5
A0A1A2
3-inputOdd Function
X6X7X8
B0
B0
A0A1A2
3-inputOdd Function
X0X1X2
B0
9-input Odd Function
How to design a 3-input Odd Function?
Function Specification:To detect odd numberof “1” inputs, i.e. Z=1 when there is an odd number of “1” present in the inputs
![Page 5: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/5.jpg)
5
Derive Truth Table for Desired Functionality
A B C F
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
00 01 11 10
0 0 1 0 1
1 1 0 1 0
ABC
CBA
C)(BA
)CBA(C)(BA
BC)CBA()CBCB(A
ABCCBACBACBAF
![Page 6: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/6.jpg)
6
Design Hierarchy Example
9-inputOdd Function
X0X1X2X3X4X5X6X7X8
Z
A0A1A2
3-inputOdd Function
ZA0A1A2
3-inputOdd Function
X3X4X5
A0A1A2
3-inputOdd Function
X6X7X8
B0
B0
A0A1A2
3-inputOdd Function
X0X1X2
B0
9-input Odd Function
3-input Odd function:B0=A0A1A2
A0
A1A2
B0
![Page 7: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/7.jpg)
7
Combinational Logic Design Example
DA BC D)C,B,F(A,
B
C
D
A
F
![Page 8: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/8.jpg)
8
Mixed Logic• Enable component reuse
• Allow a digital logic circuit designer to implement a combinational logic with– Only NAND gates– Only NOR gates– Only NAND and NOR gates
![Page 9: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/9.jpg)
9
DeMorgan’s Law
![Page 10: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/10.jpg)
10
Mixed Logic (1)• Implement all ORs in the Boolean
function• Implement all ANDs in the Boolean
function• Forget all the inversion at this
moment
![Page 11: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/11.jpg)
11
Example: Mixed Logic (1)
DA BC D)C,B,F(A,
B
C
D
A
![Page 12: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/12.jpg)
12
Mixed Logic (2)• Draw “Vertical Bars” in the circuits
where all complements in the Boolean equation occur
• Draw a bubble on each Vertical Bar
![Page 13: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/13.jpg)
13
Example: Mixed Logic (2)
DA BC D)C,B,F(A,
B
C
D
A
![Page 14: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/14.jpg)
14
Mixed Logic (3)• Convert each gate to the desired gate
– If only NAND gate is available, insert a bubble in front of the AND gate
– If only OR gate is available, insert a bubble in front of the OR gate
• Using DeMorgan’s Law in the process– OR NAND: by adding 2 bubbles on the
inputs side of OR– AND NOR: by adding 2 bubbles on the
inputs side of the AND
![Page 15: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/15.jpg)
15
Example: Mixed Logic (3)
DA BC D)C,B,F(A,
B
C
D
A
Assume this design uses Assume this design uses NANDNAND gatesgates only only
==
![Page 16: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/16.jpg)
16
Mixed Logic (4)• Balance the bubbles on each wire, i.e.
even out the number of bubbles on every wire
• If there is odd number of bubbles on a wire, add an inverter (i.e. a bubble)
• And remove those “vertical bars with bubbles” which are used to help only, not in the circuits
![Page 17: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/17.jpg)
17
Example: Mixed Logic (4)
DA BC D)C,B,F(A,
B
C
D
A
Assume this design uses Assume this design uses NANDNAND gatesgates only only
![Page 18: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/18.jpg)
18
How about Inverters?• Inverters can be implemented by either a
NAND or a NOR gate– Wiring the inputs together
![Page 19: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/19.jpg)
19
Example: Mixed Logic (Final)
DA BC D)C,B,F(A,
B
C
D
A
Assume this design uses Assume this design uses NANDNAND gatesgates only only
![Page 20: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/20.jpg)
20
Example: Mixed Logic (Final)
DA BC D)C,B,F(A,
B
C
D
A
Assume this design uses Assume this design uses NANDNAND gatesgates only only
6 NAND gates are used6 NAND gates are used
![Page 21: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/21.jpg)
21
Mixed Logic• How about build the prior circuits with
only NOR gates?
![Page 22: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/22.jpg)
22
Example: Mixed Logic (1)
DA BC D)C,B,F(A,
B
C
D
A
![Page 23: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/23.jpg)
23
Example: Mixed Logic (2)
DA BC D)C,B,F(A,
B
C
D
A
Add vertical bar forAdd vertical bar foreach inversioneach inversion
![Page 24: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/24.jpg)
24
Example: Mixed Logic (3)
DA BC D)C,B,F(A,
B
C
D
A
Assume this design uses Assume this design uses NOR gatesNOR gates only only
==Convert each gate Convert each gate to a NORto a NOR
![Page 25: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/25.jpg)
25
Example: Mixed Logic (4)
DA BC D)C,B,F(A,
B
C
D
A
Assume this design uses Assume this design uses NOR gatesNOR gates only only
Balance number ofBalance number ofBubbles on each wire Bubbles on each wire
![Page 26: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/26.jpg)
26
Example: Mixed Logic (4)
DA BC D)C,B,F(A,
Assume this design uses Assume this design uses NOR gatesNOR gates only only
Balance number ofBalance number ofbubbles on each wire bubbles on each wire and substitute all gates and substitute all gates to NOR to NOR
B
C
D
A
![Page 27: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/27.jpg)
27
Example: Mixed Logic (Final)
DA BC D)C,B,F(A,
Assume this design uses Assume this design uses NOR gatesNOR gates only only
B
C
D
A
7 NOR gates are used7 NOR gates are used
![Page 28: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/28.jpg)
28
Mixed Logic Example II (1)
))DC (B AC BAF
C
D
A
B
Implement the logic circuits by ignoring all inversionsImplement the logic circuits by ignoring all inversions
![Page 29: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/29.jpg)
29
Mixed Logic Example II (2)
))DC (B AC BAF
C
D
A
B
Add vertical bar/bubble for each inversionAdd vertical bar/bubble for each inversion
![Page 30: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/30.jpg)
30
Mixed Logic Example II (3)
))DC (B AC BAF
C
D
A
B
Assume this design uses Assume this design uses NANDNAND gatesgates only only
![Page 31: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/31.jpg)
31
Mixed Logic Example II (4)
))DC (B AC BAF
C
D
A
B
Balance the bubbles for each wire w/ invertersBalance the bubbles for each wire w/ inverters
![Page 32: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/32.jpg)
32
Mixed Logic Example II (5)
))DC (B AC BAF
C
D
A
B
Remove the vertical bars/bubblesRemove the vertical bars/bubbles
![Page 33: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/33.jpg)
33
Mixed Logic Example II (6)
))DC (B AC BAF
C
D
A
B
Replace all the gates to Replace all the gates to NAND gatesNAND gates
![Page 34: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/34.jpg)
34
Mixed Logic Example II (7)
))DC (B AC BAF
C
D
A
B
Final mixed logic uses 11 NAND gates Final mixed logic uses 11 NAND gates (one of them is a triple-input NAND gate)(one of them is a triple-input NAND gate)
![Page 35: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/35.jpg)
35
Mixed Logic Example III (1)
DB AC AF B
D
A
C
Implement the logic circuits by ignoring all inversionsImplement the logic circuits by ignoring all inversions
![Page 36: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/36.jpg)
36
Mixed Logic Example III (2)
DB AC AF B
D
A
C
Add vertical bar/bubble for each inversionAdd vertical bar/bubble for each inversion
![Page 37: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/37.jpg)
37
Mixed Logic Example III (3)
DB AC AF B
D
A
C
Assume this design uses Assume this design uses NOR gatesNOR gates only only
![Page 38: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/38.jpg)
38
Mixed Logic Example III (4)
DB AC AF B
D
A
C
Balance the bubbles for each wire w/ invertersBalance the bubbles for each wire w/ inverters
![Page 39: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/39.jpg)
39
Mixed Logic Example III (5)
DB AC AF B
D
A
C
Remove the vertical bars/bubblesRemove the vertical bars/bubbles
![Page 40: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/40.jpg)
40
Mixed Logic Example III (6)
DB AC AF B
D
A
C
Replace all the gates to Replace all the gates to NOR gatesNOR gates
![Page 41: ECE2030 Introduction to Computer Engineering Lecture 9: Combinational Logic, Mixed Logic Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering](https://reader035.vdocuments.mx/reader035/viewer/2022062313/56649ce45503460f949b1646/html5/thumbnails/41.jpg)
41
Mixed Logic Example III (7)
DB AC AF B
D
A
C
Final mixed logic uses 9 NOR gates Final mixed logic uses 9 NOR gates