Beruflich Dokumente
Kultur Dokumente
FirstSemester2013
DepartmentofComputerScience
FacultyofScience
ChiangMaiUniversity
Outline
LogicGates
BooleanAlgebra
Boolean Algebra
MapSimplification
204231:ComputerOrganizationandArchitecture
Logic Gates
LogicGates
Themanipulationofbinaryinformationis
y g
g
donebylogiccircuitscalledgates.
Eachgatehasadistinctgraphicsymbolandits
operation can be described by means of an
operationcanbedescribedbymeansofan
algebraicexpression.
Theinputoutputrelationshipofthebinary
variables for each gate can be represented in
variablesforeachgatecanberepresentedin
tabularformbyatruthtable.
204231:ComputerOrganizationand
Architecture
Logic Gates
LogicGates
Eachgatehasoneortwobinaryinputvariables
designatedbyAandBandonebinaryoutput
variabledesignatedbyx.
TheANDgate
The AND gate producestheANDlogicfunction:
produces the AND logic function:
thatis,theoutputis1ifinputAandinputBare
both equal to 1; otherwise the output is 0
bothequalto1;otherwise,theoutputis0.
ThealgebraicoperationsymboloftheAND
f
functionisthesameasthemultiplicationsymbol
i i h
h
l i li i
b l
ofordinaryarithmetic.
204231:ComputerOrganizationand
Architecture
Logic Gates
LogicGates
TheORgate producestheinclusiveOR
p
p
function;thatis,theoutputis1ifinputAor
inputBorbothinputsare1;otherwise,the
output is 0
outputis0.
ThealgebraicsymboloftheORfunctionis+,
similartoarithmeticaddition.
i il t
ith ti dditi
204231:ComputerOrganizationand
Architecture
Logic Gates
LogicGates
Theinvertercircuit invertsthelogicsenseofa
y g
binarysignal.
ItproducestheNOT,orcomplement,function.
Thesmallcircleintheoutputofthegraphic
Th
ll i l i h
f h
hi
symbolofaninverterdesignatesalogic
complement.
Atrianglesymbolbyitselfdesignatesabuffer
A triangle symbol by itself designates a buffer
circuit.
204231:ComputerOrganizationand
Architecture
Logic Gates
LogicGates
TheNAND(NOTAND) functionisthe
p
complementoftheANDfunction,asindicated
bythegraphicsymbol,whichconsistsofan
AND graphic symbol followed by a small circle
ANDgraphicsymbolfollowedbyasmallcircle.
TheNORgate isthecomplementoftheOR
gateandusesanORgraphicsymbolfollowed
h
b l f ll
byasmallcircle.
204231:ComputerOrganizationand
Architecture
Logic Gates
LogicGates
TheexclusiveOR gatehasagraphicsymbol
g
p
similartotheORgateexceptforthe
additionalcurvedlineontheinputside.
Theoutputofthisgateis1ifanyinputis1but
The output of this gate is 1 if any input is 1 but
excludesthecombinationwhenbothinputs
are1.
Amorefittingnamefortheexclusive
A more fitting name for the exclusiveOR
OR
operationwouldbeanoddfunction.
204231:ComputerOrganizationand
Architecture
Logic Gates
LogicGates
TheexclusiveNOR isthecomplementofthe
exclusiveOR.
Theoutputofthisgateis1onlyifbothinputs
are equal to 1 or both inputs are equal to 0
areequalto1orbothinputsareequalto0.
204231:ComputerOrganizationand
Architecture
Boolean Algebra
BooleanAlgebra
Booleanalgebraisanalgebrathatdealswith
y
g p
binaryvariablesandlogicoperations.
ABooleanfunctioncanbeexpressed
algebraically with binary variables the logic
algebraicallywithbinaryvariables,thelogic
operationsymbols,parentheses,andequal
sign.
Foragivenvalueofthevariables,theBoolean
For a given value of the variables, the Boolean
functioncanbeeither1or0.
204231:ComputerOrganizationand
Architecture
10
Boolean Algebra
BooleanAlgebra
C
Consider,forexample,theBooleanfunction
id f
l th B l
f ti
F=x+yz
ThefunctionFisequalto1ifxis1orifbothy
andzareequalto1;Fisequalto0otherwise.
Therelationshipbetweenafunctionandits
Th
l i hi b
f
i
di
binaryvariablescanberepresentedinatruth
table.
table
Torepresentafunctioninatruthtableweneeda
list of the 2n combinationsofthenbinary
listofthe2
combinations of the n binary
variables.
204231:ComputerOrganizationand
Architecture
11
Truthtableandlogicdiagramfor
F=x+yz.
204231:ComputerOrganizationandArchitecture
12
Boolean Expression
BooleanExpression
BymanipulatingaBooleanexpression
i l i
l
i
accordingtoBooleanalgebrarules,onemay
obtainasimplerexpressionthatwillrequire
fewergates.
Forexample,
AB
AB+C
+ CD
D+AB
+ AB+C
+ CD
D=AB
AB+C
+ CD
D
NORgate>(x+y)=xy(DeMorganstheorem)
NANDgate>(xy)
NAND gate > (xy)=x
= x+y
+y (DeMorgan
(DeMorgansstheorem)
theorem)
204231:ComputerOrganizationand
Architecture
13
204231:ComputerOrganizationandArchitecture
14
204231:ComputerOrganizationandArchitecture
15
Twologicdiagramsforthesame
Booleanfunction
204231:ComputerOrganizationandArchitecture
16
17
Twologicdiagramsforthesame
Booleanfunction
204231:ComputerOrganizationandArchitecture
18
Thegeneralformof
DeMorganstheorem
((x1 +x2 +x3 + +xn) =x1x
2x
3x
n
((x1x2x3xn)) =x1 +x2 +x3 + +xn
ThisisdonebychangingallORoperationsto
AND operations and all AND operations to OR
ANDoperationsandallANDoperationstoOR
operationsandthencomplementingeach
individual letter variable
individuallettervariable.
Asanexample,
F=AB+CD+BD
F=(A+B)(C+D)(B+D)
204231:ComputerOrganizationandArchitecture
19
Map Simplification
MapSimplification
Theexpressionmaybesimplifiedusingthebasic
h
i
b i lifi d i
h b i
relationsofBooleanalgebra.
However,thisprocedureissometimesdifficult
becauseitlacksspecificrulesforpredictingeach
succeedingstepinthemanipulativeprocess.
Themapmethodprovidesasimple,
straightforwardprocedureforsimplifying
Booleanexpressions.
ThemapmethodisalsoknownastheKarnaugh
map orKmap.
204231:ComputerOrganizationand
Architecture
20
Map Simplification
MapSimplification
Themapisadiagrammadeupofsquares,
q
p
g
witheachsquarerepresentingoneminterm.
Thesquarescorrespondingtomintermsthat
produce 1 for the function are marked by a 1
produce1forthefunctionaremarkedbya1
andtheothersaremarkedbya0orareleft
empty.
204231:ComputerOrganizationand
Architecture
21
Mapsfortwo,three,and
fourvariablefunctions
204231:ComputerOrganizationandArchitecture
22
Mapsfortwo,three,and
fourvariablefunctions
204231:ComputerOrganizationandArchitecture
23
Mapsfortwo,three,and
fourvariablefunctions
204231:ComputerOrganizationandArchitecture
24
Map Simplification
MapSimplification
Mintermsofadjacentsquaresinthemapare
i
f dj
i h
identicalexceptforonvariable.
Accordingtothisdefinitionofadjacency,the
squaresattheextremeendsofthesame
horizontalrowarealsotobeconsidered
adjacent.
Thesameappliestothetopandbottomsquares
ofacolumn.
Asaresult,thefourcornersquaresofamap
j
mustalsobeconsideredtobeadjacent.
204231:ComputerOrganizationand
Architecture
25
Map Simplification
MapSimplification
ABooleanfunctionrepresentedbyatruth
p
p y
g
tableisplottedintothemapbyinserting1sin
thosesquaredwherethefunctionis1.
Thesquarescontaining1
The squares containing 1ssarecombinedin
are combined in
groupsofadjacentsquares.
Thesegroupsmustcontainanumberof
squares that is an integral power of 2.
squaresthatisanintegralpowerof2.
204231:ComputerOrganizationand
Architecture
26
Map Simplification
MapSimplification
Groupsofcombinedadjacentsquaresmay
q
shareoneormoresquareswithoneormore
groups.
Eachgroupofsquaresrepresentsanalgebraic
Each group of squares represents an algebraic
term,andtheORofthosetermsgivesthe
simplifiedalgebraicexpressionforthe
lf
l b
f h
function.
204231:ComputerOrganizationand
Architecture
27
F=BC+AC
204231:ComputerOrganizationandArchitecture
28
F=C +AB
204231:ComputerOrganizationandArchitecture
29
F =B
F
BD
D +B
BC
C +A
ACD
CD
204231:ComputerOrganizationandArchitecture
30
ProductofSums Simplification
ProductofSumsSimplification
The1sinthemaprepresentthemintermsthat
produce1forthefunction.
Thesquaresnotmarkedby1representthe
minterms that produce 0 for the function.
mintermsthatproduce0forthefunction.
Ifwemarktheemptysquareswith0sand
combinethemintogroupsofadjacentsquares,
bi th
i t
f dj
t
weobtainthecomplementofthefunction,F.
TakingthecomplementofFproducesan
p
p
expressionforFinproductofsumsform.
204231:ComputerOrganizationand
Architecture
31
SumofProduct:F=BD+BC+ACD
204231:ComputerOrganizationandArchitecture
32
33
204231:ComputerOrganizationandArchitecture
34
204231:ComputerOrganizationandArchitecture
35
204231:ComputerOrganizationandArchitecture
36
204231:ComputerOrganizationandArchitecture
37
DontCare
Don
tCareConditions
Conditions
Sincethefunctionmaybeeither0or1,wesay
thatwedontcarewhatthefunctionoutputisto
beforthisminterm.
Mintermsthatmayproduceeither0or1forthe
Minterms that may produce either 0 or 1 for the
functionaresaidtobedontcareconditionsand
are marked with an x in the map
aremarkedwithanxinthemap.
Whenchoosingadjacentsquaresforthefunction
i h
inthemap,thexsmaybeassumedtobeeither0
h
b
d b ih 0
or1,whichevergivesthesimplestexpression.
204231:ComputerOrganizationand
Architecture
38
204231:ComputerOrganizationandArchitecture
39
204231:ComputerOrganizationandArchitecture
40
204231:ComputerOrganizationandArchitecture
41
Reference
M.Moris Mano,ComputerSystem
Architecture,3rd ed.NJ:PrenticeHall,1992.
204231:ComputerOrganizationandArchitecture
42