View
213
Download
1
Embed Size (px)
Citation preview
Boolean AlgebraBoolean Algebra
ENEE 644 2
A A Boolean algebraBoolean algebra A set of operators (e.g. the binary operators: +, A set of operators (e.g. the binary operators: +, •, •,
INV)INV) A set of axioms or postulatesA set of axioms or postulates
Boolean AlgebraBoolean Algebra
ENEE 644 3
CommutativeCommutative x+y = y+xx+y = y+xxx•y=y•x•y=y•x
DistributiveDistributive x+(y•z)=(x+y)•(x+z)x+(y•z)=(x+y)•(x+z)x•(y+z)=x•y+x•zx•(y+z)=x•y+x•z
IdentitiesIdentities x+0=xx+0=xx•1=xx•1=x
ComplementComplement x+x’=1x+x’=1 x•x’=0x•x’=0
ClosureClosure x+yx+y x•y x•y
AssociativeAssociative (x+y)+z=x+(y+z) (x+y)+z=x+(y+z) (x•y)•z=x•(y•z)(x•y)•z=x•(y•z)
PostulatesPostulates
ENEE 644 4
Complement of a variable is unique.Complement of a variable is unique. (x’)’ = x (x’)’ = x -- involution -- involution x+x = xx+x = x --idempotent --idempotent x+1=1x+1=1 x+xx+x•y=x•y=x -- absorption -- absorption (x+y)’=x’(x+y)’=x’•y’•y’ -- -- DeMorgan’s LawDeMorgan’s Law xy+x’z+yz = xy + x’zxy+x’z+yz = xy + x’z
-- consensus -- consensus
Complement of a variable is unique.Complement of a variable is unique. (x’)’ = x (x’)’ = x -- --
involutioninvolution x+x = xx+x = x xx•x=x•x=x -- --
idempotentidempotent x+1=1x+1=1 xx•0=0•0=0 x+xx+x•y=x•y=x x•(x+y)=xx•(x+y)=x -- --
absorptionabsorption (x+y)’=x’(x+y)’=x’•y’•y’ (x•y)’=x’+y’(x•y)’=x’+y’ -- -- DeMorgan’s LawDeMorgan’s Law xy+x’z+yz = xy + x’zxy+x’z+yz = xy + x’z
(x+y) (x+y) •(x’+z) •(y+z) = (x+y) •(x’+z)•(x’+z) •(y+z) = (x+y) •(x’+z) -- consensus -- consensus
Duality:Duality: + + • and 0 • and 0 1 1
Properties of Boolean AlgebraProperties of Boolean Algebra
ENEE 644 5
Proof of ConsensusProof of Consensus
a <= b essentially implies that if a =1 then b =1 and if a = 0 then b a <= b essentially implies that if a =1 then b =1 and if a = 0 then b could be anythingcould be anything
Theorem: In Consensus xy + x’z + yz = xy + x’z (How?)Theorem: In Consensus xy + x’z + yz = xy + x’z (How?)We Prove that xy + x’z + yz >= xy + x’z and xy + x’z + yz <= xy + x’z We Prove that xy + x’z + yz >= xy + x’z and xy + x’z + yz <= xy + x’z
(This would imply equality and prove the theorem)(This would imply equality and prove the theorem)
Proof: First: xy + x’z + yz >= xy + x’z. Let xy + x’z = a and yz = b;Proof: First: xy + x’z + yz >= xy + x’z. Let xy + x’z = a and yz = b;So we want to prove that a + b >= a which is true by definition of the So we want to prove that a + b >= a which is true by definition of the inequalityinequality
Second: xy + x’z + yz <= xy + x’z. This inequality could be split into xy + Second: xy + x’z + yz <= xy + x’z. This inequality could be split into xy + x’z <= xy + x’z and yz <= xy + x’zx’z <= xy + x’z and yz <= xy + x’z
All we need to do is to prove yz <= xy + x’zAll we need to do is to prove yz <= xy + x’z
ENEE 644 6
Proof of ConsensusProof of Consensus
yz <= xy + x’zyz <= xy + x’z
We know that a <= b iff ab’ = 0 (How?)We know that a <= b iff ab’ = 0 (How?)
So if the above inequality is true yz(xy + x’z)’ = 0 So if the above inequality is true yz(xy + x’z)’ = 0 must be true. Which is always true.must be true. Which is always true.
Hence Proved.Hence Proved.
ENEE 644 7
A A Boolean functionBoolean function is a mapping is a mapping f(x): Bf(x): Bnn B B.. Constant function: Constant function: f(xf(x11,…,x,…,xnn) = b.) = b.
Projection (to the Projection (to the ii-th axis):-th axis): f(xf(x11,…,x,…,xnn) = x) = xii..
A Boolean function is A Boolean function is completecomplete if if f(x)f(x) is defined is defined for all for all x xBBnn. Otherwise the point . Otherwise the point xx that that f(x)f(x) is not is not defined is called a defined is called a don’t caredon’t care condition. condition.
Operations on Boolean functions:Operations on Boolean functions: Sum:Sum: ((f+g)(x) = f(x) + g(x)f+g)(x) = f(x) + g(x) Product:Product: (f(f••g)(x) = f(x)g)(x) = f(x)••g(x)g(x) Complement:Complement: (f’)(x) = (f(x))’(f’)(x) = (f(x))’
Boolean FunctionsBoolean Functions
ENEE 644 8
Algebraic expressionsAlgebraic expressions f(x,y,z) = xy+zf(x,y,z) = xy+z
Tabular formsTabular forms Venn diagramsVenn diagrams Cubical Cubical
representationsrepresentations Binary decision Binary decision
diagrams (BDD)diagrams (BDD)
xx yy zz ff
00 00 00 00
00 00 11 11
00 11 00 00
00 11 11 11
11 00 00 00
11 00 11 11
11 11 00 11
11 11 11 11
x
zy
x
z
y
Representations of Boolean FunctionsRepresentations of Boolean Functions
Algebraic expressionsAlgebraic expressions f(x,y,z) = xy+zf(x,y,z) = xy+z
Algebraic expressionsAlgebraic expressions f(x,y,z) = xy+zf(x,y,z) = xy+z
Tabular formsTabular forms
Algebraic expressionsAlgebraic expressions f(x,y,z) = xy+zf(x,y,z) = xy+z
Tabular formsTabular forms Venn diagramsVenn diagrams
Algebraic expressionsAlgebraic expressions f(x,y,z) = xy+zf(x,y,z) = xy+z
Tabular formsTabular forms Venn diagramsVenn diagrams Cubical Cubical
representationsrepresentations
ENEE 644 9
Algebraic expressionsAlgebraic expressions f(x,y,z) = xy+zf(x,y,z) = xy+z
Tabular formsTabular forms Venn diagramsVenn diagrams Cubical Cubical
representationsrepresentations Binary decision Binary decision
diagrams (BDD)diagrams (BDD)
xx yy zz ff
00 00 00 00
00 00 11 11
00 11 00 00
00 11 11 11
11 00 00 00
11 00 11 11
11 11 00 11
11 11 11 11
x
zy
x
z
y
Representations of Boolean FunctionsRepresentations of Boolean Functions
ENEE 644 10
The The cofactorcofactor of of f(xf(x11,…,x,…,xnn)) w.r.t. w.r.t. xxii (or (or x’x’ii) is a ) is a
Boolean functionBoolean function , s.t. , s.t.
Boole’s Expansion Theorem:Boole’s Expansion Theorem:
Boole’s Expansion TheoremBoole’s Expansion Theorem
BBforf n
xxii
1:)( '
),,,0/1,,,(
),,,,,(
111
111/ '
nii
niixx
xxxxf
xxxxfii
)()(
),,,,,,(,,
111
,,iiii xixixixi
niii
fxfxfxfx
xxxxxf
ENEE 644 11
Boole’s Expansion: ExamplesBoole’s Expansion: Examples
f(x) = x f(x) = x • f(1) + x’ • f(0) • f(1) + x’ • f(0) for single-variable for single-variable xx
= (x + f(0)) • (x’+f(1)) = (x + f(0)) • (x’+f(1)) (from duality)(from duality) f(x+y) • f(x’+y) = f(1) • f(y)f(x+y) • f(x’+y) = f(1) • f(y)
Define Define g(x,y) = f(x+y)f(x’+y)g(x,y) = f(x+y)f(x’+y)
g(x,y) g(x,y) = xg(1,y) + x’g(0,y) = xg(1,y) + x’g(0,y) = xf(1)f(y) + x’f(y)f(1) = xf(1)f(y) + x’f(y)f(1) = f(1)f(y)= f(1)f(y)
What if expand w.r.t variable y?What if expand w.r.t variable y?
f(x+y) • f(x’+y) f(x+y) • f(x’+y) =yf(1)f(1) + y’f(x)f(x’) =yf(1)f(1) + y’f(x)f(x’) = yf(1)+y’f(1)f(0) = f(1)(yf(1) + y’f(0)) = yf(1)+y’f(1)f(0) = f(1)(yf(1) + y’f(0))
=f(1)f(y)=f(1)f(y)
ENEE 644 12
Boole’s Expansion: ExamplesBoole’s Expansion: Examples
ff ff
11 yy
ff ff
yyyyxx x’x’Hardware? Hardware? Delay?Delay?
ENEE 644 13
nn
nn
nnnn
xxxf
xxxf
xxxfxxxf
11
'1
'1
''1
'111
)1,1,,1(
)1,0,,0(
)0,0,,0(),,,(
discriminants
minterms
Complete ExpansionComplete Expansion
ENEE 644 14
A form is called A form is called canonicalcanonical if the representation of if the representation of the function in that form is unique.the function in that form is unique.
Minterm Canonical FormMinterm Canonical Form AND-OR circuitsAND-OR circuits
Pro and Cons of Canonical FormsPro and Cons of Canonical Forms Unique up to permutationUnique up to permutation InefficientInefficient
Canonical FormsCanonical Forms
ENEE 644 15
SOP (SOP (Disjunctive Normal FormDisjunctive Normal Form)) A disjunction of product termsA disjunction of product terms A product term (1 is also considered a product term)A product term (1 is also considered a product term) 00
The Primary Objective During Logic Minimization The Primary Objective During Logic Minimization is to Remove the Redundancy in the is to Remove the Redundancy in the Representation. Representation.
Normal (Standard) FormsNormal (Standard) Forms
ENEE 644 16
An An implicantimplicant of a function is a product term that is of a function is a product term that is included in the function.included in the function.
An implicant is An implicant is primeprime if it cannot be included in if it cannot be included in any other implicants.any other implicants.
A prime implicant is A prime implicant is essentialessential if it is the only one if it is the only one that includes a minterm.that includes a minterm.
Example: Example: f(x,y,z) = xy’ + yzf(x,y,z) = xy’ + yz xy(not I),xyz(I, not PI), xy(not I),xyz(I, not PI), xz(PI,not EPI), yz(EPI)xz(PI,not EPI), yz(EPI)
ImplicantsImplicants
x
z
y
xy’z’
xy’z
xyzx’yz
ENEE 644 17
Specification for IncompletenessSpecification for Incompleteness
A Boolean function is A Boolean function is incompleteincomplete if if f(x)f(x) is NOT is NOT defined for some defined for some x xBBnn. Such point . Such point xx is called a is called a don’t caredon’t care condition. condition.
Tabular representationTabular representation {1-set, 0-set, don’t care set}{1-set, 0-set, don’t care set}
1-set = {xy}1-set = {xy} 0-set = {x’y’}0-set = {x’y’} Don’t care set = {x’y, xy’}Don’t care set = {x’y, xy’}
xx yy ff
00 00 00
00 11 --
11 00 --
11 11 11
ENEE 644 18
Don’t Care ConditionsDon’t Care Conditions
Satisfiability don’t caresSatisfiability don’t cares of a subcircuit consist of of a subcircuit consist of all input patterns that will never occur.all input patterns that will never occur.
Observability don’t caresObservability don’t cares of a subcircuit are the of a subcircuit are the input patterns that represent situations when an input patterns that represent situations when an output is not observed.output is not observed.
Example:Example:
x
y
{xy,x’y}{xy,x’y} {xy’,x’y’}{xy’,x’y’}
y=0y=0