Download b/w

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

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

Document related concepts
no text concepts found
Transcript
Prof.AnneBracy
CS3410
ComputerScience
CornellUniversity
The slides are the product of many rounds of teaching CS 3410 by
Professors Weatherspoon, Bala, Bracy, and Sirer.
See:P&HAppendix B.2andB.3(Also,seeB.1)
1
FromSwitchestoLogicGatestoLogicCircuits
Transistors(electronicswitch)
LogicGates
• TruthTables
LogicCircuits
• IdentityLaws
• FromTruthTablestoCircuits(SumofProducts)
LogicCircuitMinimization
• AlgebraicManipulations
• Karnaugh Maps
2
Transistors:
• Youtube videofromlastweek
https://www.youtube.com/watch?v=IcrBqCFLHIY
3
Source
Gate
Insulator
Drain
Source
Gate
Drain
—
Insulator
- + + + +
+ + + + - + + + - - - + + + P-type
P-type
N-type
- - - - - - - - - -
+ + channelcreated
+ + + + + + P-type
- + +
+ - +- - +
++
P-type
P-type
N-type
- - - - - - - - - -
Off
On
-
N-TypeSilicon:negativefree-carriers(electrons)
P-TypeSilicon:positivefree-carriers(holes)
P-Transistor:negativechargeongategenerateselectricfieldthat
createsa(+charged)p-channelconnectingsource&drain
N-Transistor:workstheoppositeway
Metal-OxideSemiconductor(Gate-Insulator-Silicon)
ComplementaryMOS=CMOStechnologyusesbothp- &n-type
transistors
4
N-type
Off/Open
0
gate
P-type
Off/Open
gate
1
On/Closed
1
On/Closed
0
Gate input controls whether current can flow
between the other two terminals or not.
Hint: the “o” bubble of the p-type tells you that
this gate wants a 0 to be turned on
5
Logicgatesareconstructedbycombiningtransistorsin
complementaryarrangements
Combinep&n transistorstomakeaNOTgate:
CMOS Inverter :
power source (1)
power source (1)
—
p-gate
input
output
n-gate
ground (0)
power source (1)
+
p-gate
closes
0
1
n-gate
stays open
—
ground (0)
6
p-gate
stays open
0
1
+
n-gate
closes
ground (0)
Vsupply (akalogic1)
in
out
• Function: NOT
• Symbol:
out
in
• Truth Table:
(ground islogic0)
In
0
1
Out
1
0
7
Vsupply
A
Vsupply
B
B
A
out
• Function:
• Symbol:
a
b
out
• Truth Table:
A
0
1
0
1
B out
0
0
1
1
8
Vsupply
• Function: NOR
• Symbol:
A
B
out
A
B
a
b
out
• Truth Table:
A B out
0 0
1
1 0
0
0 1
0
1 1
0
NANDandNORareuniversal
• Canimplementany functionwithNANDorjustNORgates
• usefulformanufacturing
NOT:
a
AND:
a
b
OR:
a
b
11
Hidecomplexitythroughsimpleabstractions
• Simplicity
– Boxdiagramrepresentsinputsandoutputs
• Complexity
– HidesunderlyingNMOS- andPMOS-transistorsandatomic
interactions
Vdd
in
a
out
out
b
Vss
in
d
out
a
d
b
out
12
FromSwitchestoLogicGatestoLogicCircuits
Transistors(electronicswitch)
LogicGates
• TruthTables
LogicCircuits
• IdentityLaws
• FromTruthTablestoCircuits(SumofProducts)
LogicCircuitMinimization
• AlgebraicManipulations
• Karnaugh Maps
13
• Digitalcircuitthateitherallows
signaltopassthroughitornot
• Usedtobuildlogicfunctions
• Sevenbasiclogicgates:
AND,
OR,
NOT,
George Boole,(1815-1864)
NAND (notAND),
NOR (notOR),
Didyouknow?
XOR
GeorgeBooleInventoroftheidea
XNOR (notXOR)
oflogicgates.Hewasbornin
Lincoln,Englandandhewastheson
ofashoemakerinalowclassfamily.
14
NOT:
A
A
Out
0
1
1
0
A B Out
AND:
OR:
XOR:.
A
B
A
B
A
B
A B Out
NAND: A
B
0 0
1
0 1
1
0
1 0
1
1
1 1
0
0 0
0
0 1
0
1 0
1 1
A
B Out
0
0
1
0
1
0
1
1
0
0
1
1
1
0
A
B Out
0
0
0
0
1
1
1
0
1
1
A B Out
NOR:
A
B
A B Out
XNOR: A
B
0 0
1
0 1
0
1
1 0
0
0
1 1
1
0 0
0
0 1
1
1 0
1 1
Fillinthetruthtable,giventhefollowingLogic
CircuitmadefromLogicAND,OR,andNOTgates.
Whatdoesthelogiccircuitdo?
a
b
Out
a
b
Out
16
Fillinthetruthtable,giventhefollowingLogic
CircuitmadefromLogicAND,OR,andNOTgates.
Whatdoesthelogiccircuitdo?
a
b
d
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
Out
a
d
Out
b
19
FromSwitchestoLogicGatestoLogicCircuits
Transistors(electronicswitch)
LogicGates
• TruthTables
LogicCircuits
• FromTruthTablestoCircuits(SumofProducts)
• IdentityLaws
LogicCircuitMinimization
• AlgebraicManipulations
• Karnaugh Maps
21
GivenaLogicfunctionà createaLogicCircuitthat
implementstheLogicFunction…
22
Howtoimplementadesiredlogicfunction?
a
0
0
0
0
1
1
1
1
b
0
0
1
1
0
0
1
1
c out minterm 1) Write minterms
0 0
abc 2) Write sumofproducts:
ORofallmintermswhereout=1
1 1
abc
out=abc +abc +abc
0 0
abc
1 1
abc
a
b
0 0
abc
c
out
1 1
abc
0 0
abc
1 0
abc
Any combinationalcircuitcanbe implementedin
twolevelsoflogic(ignoringinverters)
23
NOT: =ā
=!a=¬a
AND: =a·b=a&b=a∧ b
NAND:
OR:
NOR:
=a+b=a|b=a∨ b
XOR: =a⊕ b=ab+āb
(a • b) =!(a&b)=¬ (a∧ b)
(a + b) =!(a|b)=¬ (a∨ b)
XNOR:
(a
b)
=ab +ab
LogicEquations
• Constants:true=1,false=0
• Variables:a,b,out,…
• Operators(above):AND,OR,NOT,etc.
24
Identitiesusefulformanipulatinglogicequations
• Foroptimization&easeofimplementation
a+0= a
a+1= 1
a+ā= 1
a·0= 0
a·1= a
a·ā= 0
25
Identitiesusefulformanipulatinglogicequations
• Foroptimization&easeofimplementation
A
(a + b) = a • b
(ab) = a + b
B
A
B
↔
↔
A
B
A
B
a+ab=a
a(b+c)=ab +ac
a(b + c) = a + b • c
26
FromSwitchestoLogicGatestoLogicCircuits
Transistors(electronicswitch)
LogicGates
• TruthTables
LogicCircuits
• IdentityLaws
• FromTruthTablestoCircuits(SumofProducts)
LogicCircuitMinimization
• AlgebraicManipulations
• Karnaugh Maps
27
ImplementtheLogicFunction…
withtheminimumnumberoflogicgates
Fewergates:Acheaper($$$)circuit!
Howtostandardizethisminimizing?
28
a+0=a
a+1=1
a+ā =1
a·0=0
a·1=a
a·ā =0
Minimizethislogicequation:
(a+b)(a+c) =
a+ab=a
a(b+c)=ab +ac
(a + b) = a • b
(ab) = a + b
a(b + c) = a + b • c
29
circuits↔truthtables↔equations
• Example:(a+b)(a+c)=a+bc
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
31
Howdoesonefindthemostefficientequation?
– Manipulatealgebraicallyuntil…?
– UseKarnaugh Maps (optimizevisually)
– Useasoftwareoptimizer
Forlargecircuits
– Decomposition&reuseofbuildingblocks
33
c
a b
c
out
0 0
0
0
0 0
1
1
0 1
0
0
0 1
1
1
1 0
0
1
1 0
1
1
1 1
0
0
1 1
1
0
out =
abc + abc + abc + abc
ab
00 011110
0 0 0 0 1
1 1
1
0
Sum of minterms yields
K-maps identify which inputs
are relevant to the output
1
34
c
ab
00 011110
0 0 0 0 1
1 1
1
0
1
(1) Circle the 1’s (see below)
(2) Each circle is a logical
component of the final equation
= ab" + a"c
Rules:
• Usefewestcirclesnecessarytocoverall1’s
• Circlesmustcoveronly1’s
• Circlesspanrectanglesofsizepowerof2(1,2,4,8…)
• Circlesshouldbeaslargeaspossible(allcirclesof1?)
• CirclesmaywraparoundedgesofK-Map
• 1maybecircledmultipletimesifthatmeansfewer
circles
35
c
c
ab
00 01 1110
0
0
1
1
1
1
0
0
1
0
Minterms can overlap
out = bc" + ac" + ab
ab
00 01 1110
0
1
1
1
1
1
0
0
1
0
Minterms can span 2, 4, 8 or
more cells
out = c" + ab
36
ab
cd
00 01 1110
00
0
0
0
0
01
1
0
0
1
11
1
0
0
1
10
0
0
0
0
Themapwrapsaround
out=b"d
ab
cd
00 011110
00
1
0
0
1
01
0
0
0
0
11
0
0
0
0
10
1
0
0
1
out=b" d"
37
ab
cd
00 011110
00
0
0
0
0
01
1
x
x
x
11
1
x
x
1
10
0
0
0
0
ab
“Don’tcare”valuescanbe
interpretedindividuallyin
whateverwayisconvenient
• assumeallx’s=1
à out=d
00
1
0
0
x
01
0
x
x
0
• assumemiddlex’s=0
(ignorethem)
• assume4th columnx=1
11
0
x
x
0
10
1
0
0
1
" d"
à out=b
cd
00 011110
38
• Binary—twosymbols:true andfalse—isthebasis
ofLogicDesign
• MorethanoneLogicCircuitcanimplementsame
Logicfunction.UseAlgebra(Identities)orTruth
Tablestoshowequivalence.
• Anylogicfunctioncanbeimplementedas“sumof
products”.Karnaugh Mapsminimizenumberof
gates.
39
Mostmoderndevicesmadeofbillionsoftransistors
• Youwillbuildaprocessorinthiscourse!
• Moderntransistorsmadefromsemiconductormaterials
• Transistorsusedtomakelogicgatesandlogiccircuits
Wecannowimplementanylogiccircuit
• UseP- &N-transistorstoimplementNAND/NORgates
• UseNANDorNORgatestoimplementthelogiccircuit
• Efficiently: useK-mapstofindrequiredminimalterms
40