Logic
Logic
A Review
Boolean Algebra
y Two Values: zero and one y Three Basic Functions: And, Or, Not y Any Boolean Function Can be
1 0
Algebraic Laws
Classification Identity Dominance Commutativity Associativity Distributive Demorgans Laws Law a1=1a=a a+0=0+a=a a0=0a=0 1+a=a+1=1 a+b=b+a ab=ba a(bc)=(ab)c a+(b+c)=(a+b)+c a(b+c)=ab+ac a+bc=(a+b)(a+c) ( a + b ) = a b ( ab ) = a + b
Boolean Expressions
y Addition represents OR y Multiplication represents AND y Not is represented by a prime a or an
Superfluous Terms
y The following Two Equations Represent
Prime Implicants
y A Prime Implicant is a Product of
Variables or Their Complements, eg. abcd y If a Prime Implicant has the Value 1, then the Function has the Value 1 y A Minimal Equation is a Sum of Prime Implicants
Number of Prime Implicants y A MinTerm is a Prime Implicant with the Maximum Number of Variables y For a 3-input Function abc is a MinTerm, while ab is not. y Prime Implicants can be Combined to Eliminate Variables, abc+abc = ab
^ ^
01 0 0 11 0 0 10 1 0
^1
00 0 1 1
Procedure
y Select Regions Containing All 1s y Regions should be as Large as Possible y Regions must contain 2k cells y Regions should overlap as little as
possible y The complete set of regions must contain all 1s in the map
Procedure 2
y Top and Bottom of Map are Contiguous y Left and Right of Map are Contiguous y Regions represent Prime Implicants y Use Variable name guides to construct
equation
Completely inside the region of a variable means prime implicant contains variable Completely outside the region of a variable means prime implicant contains negation
^ ^
01 0 0 11 0 0 10 1 0
^1
00 0 1 1
q=cb+ca
^ ^
01 0 1
1
^
A
11 0 1
0
10 0 1
1
First Minimization D
00 00 0 01 10 0
0 11
^ ^
01 0 1
1
^
A
11 0 1
0
10 0 1
1
Second Minimization D
00 00 0 01 10 0
0 11
^ ^
01 0 1
1
^
A
11 0 1
0
10 0 1
1
ab d + bc d + a bc + acd
ac d + a bd + bcd + ab c
Several Different Minimal Forms y Karnaugh Maps are Ineffective for Functions with More than Six Inputs.
Number of Inputs y Effective Procedure for Finding Prime Implicants, but y Can Require an Exponential Amount of Time for Some Circuits
Quine-McClusky Procedure
y Start with The Function Truth Table y Extract All Input Combinations that
Produce a TRUE Output (MinTerms) y Group All MinTerms by The Number of Ones They Contain y Combine Minterms from Adjacent Groups
More Quine-McClusky
y Two Min-Terms Combine If They Differ
by Only One Bit y The Combined MinTerm has an x in the Differing Position y Create New Groups From Combined Min-Terms y Each Member of A New Group Must Have the Same Number of 1s and xs
xs in The Same Position. y Combine Members of the New Groups To Create More New Groups y Combined Terms Must Differ By One Bit, and Have xs in the Same Positions y Combine as Much as Possible y Select Prime Implicants to Cover All Ones in the Function
Quine-McClusky Example 1
Numbers in Parentheses are Truth-Table Positions.
Quine-McClusky Example 2
New Groups After Combining MinTerms
Quine-McClusky Example 3
The Final Two Groups Note That These Two Elements Cover All Truth-Table Positions
xx11(3,7,11,15) 11xx(12,13,14,15)
Quine-McClusky Example 4
y Each Group Element Represents a Prime
Implicant y It is Necessary to Select Group Elements to Cover All Truth-Table Positions. y In This Case, ab+cd is the Minimal Formula. y In General, Selecting a Minimal Number of Prime Implicants is NP-Complete
And
Or
Not
Xor 0 1
0 0 1
1 1 0
Signal Flow
Nand
Nor
Buffer Xnor
Sequential Logic
y Contains Memory Elements y Memory is Provided by Feedback y Circuit diagrams generally have
An RS Flip-Flop
RS Characteristics
y If S=0 and R=1, Q is set to 1, and Q is
reset to 0 y If R=0 and S=1, Q is reset to 0, and Q is set to 1 y If S=1 and R=1, Q and Q maintain their previous state. y If S=0 and R=0, a transision to S=1, R=1 will cause oscillation.
Instability
y RS flip-flops can become unstable if
both R and S are set to zero. y All Sequential elements are fundamentally unstable under certain conditions
Invalid Transisions Transisions too close together Transisions at the wrong time
D Flip-Flops
too close together y Is generally implemented as a special circuit, not as pictured here.
A Clocked D Flip-Flop
Flip-Flop Symbols
D Clk
T Clk
A CMOS Flip-Flop
Clk Q D Q Clk
or 2 Controls y Clocks or Controls must be Complements of One another y Clock-Skew (Non-Simultaneous changes in both clocks) can cause problems
D
Clk
Asynchronous Circuits
y Combinational Logic is used:
Q Q
Synchronous Circuits
y Combinational Logic is used to:
Flip-Flops y State Changes can be made only when clock changes y Combinational Logic Must be Stable when Clock is Active
Register Symbol
Input 16
Load Clock 16
Output
Register Issues
y Generally A Collection of D Flip-Flops y Can be Synchronous or Asynchronous y Default is Assumption is
Tristate Elements
y Three States:
Zero (Output is grounded) One (Output connected to Power Terminal) High-Impedance (Output Not Connected to Either Power Or Ground)
y Can be Used to Construct Cheap
Multiplexors
Non-Inverting
Inverting
Buffer can be in Non-Tristate State y Violating This Rule Can Destroy The Circuit Due a Power/Ground Short
1 1
DANGER!
0
Logic Design
A Review
Boolean Algebra
Two Values: zero and one y Three Basic Functions: And, Or, Not y Any Boolean Function Can be Constructed from These Three
y
A nd 0 1
0 0 0
1 0 1
Or 0 1
0 0 1
1 1 1
N ot 0 1
1 0
Algebraic Laws
Classification Identity Dominance Commutativity Associativity Distributive Demorgans Laws Law a1=1a=a a+0=0+a=a a0=0a=0 1+a=a+1=1 a+b=b+a ab=ba a(bc)=(ab)c a+(b+c)=(a+b)+c a(b+c)=ab+ac a+bc=(a+b)(a+c) ( a + b ) = a b ( ab ) = a + b
Boolean Expressions
Addition represents OR y Multiplication represents AND y Not is represented by a prime a or an overbar a y Examples: y s = abc + abc + abc + abc y q = ab + bc + ac + abc
y
Superfluous Terms
y
Prime Implicants
A Prime Implicant is a Product of Variables or Their Complements, eg. abcd y If a Prime Implicant has the Value 1, then the Function has the Value 1 y A Minimal Equation is a Sum of Prime Implicants
y
A Karnaugh Map
^ ^
01 0 0 11 0 0 10 1 0
^1
00 0 1 1
Procedure
Select Regions Containing All 1s y Regions should be as Large as Possible y Regions must contain 2k cells y Regions should overlap as little as possible y The complete set of regions must contain all 1s in the map
y
Procedure 2
Top and Bottom of Map are Contiguous y Left and Right of Map are Contiguous y Regions represent Prime Implicants y Use Variable name guides to construct equation
y
Completely inside the region of a variable means prime implicant contains variable Completely outside the region of a variable means prime implicant contains negation
^ ^
01 0 0 11 0 0 10 1 0
^1
00 0 1 1
q=cb+ca
^ ^
^
A
First Minimization D
00 00 0 01 10 0 0 0 11 01 0 1 1 1
^ ^
11 0 1 0 1 10 0 1 1 1
^
A
Second Minimization D
00 00 0 01 10 0 0 0 11 01 0 1 1 1
^ ^
11 0 1 0 1 10 0 1 1 1
^
A
ab d + bc d + a bc + acd
ac d + a bd + bcd + ab c
Moral: A Boolean Function May Have Several Different Minimal Forms y Karnaugh Maps are Ineffective for Functions with More than Six Inputs.
y
Quine-McClusky Procedure
Start with The Function Truth Table y Extract All Input Combinations that Produce a TRUE Output (MinTerms) y Group All MinTerms by The Number of Ones They Contain y Combine Minterms from Adjacent Groups
y
More Quine-McClusky
Two Min-Terms Combine If They Differ by Only One Bit y The Combined MinTerm has an x in the Differing Position y Create New Groups From Combined Min-Terms y Each Member of A New Group Must Have the Same Number of 1s and xs
y
Quine-McClusky Example 1
Numbers in Parentheses are Truth-Table Positions.
Quine-McClusky Example 2
New Groups After Combining MinTerms
Quine-McClusky Example 3
The Final Two Groups Note That These Two Elements Cover All Truth-Table Positions
xx11(3,7,11,15) 11xx(12,13,14,15)
Quine-McClusky Example 4
Each Group Element Represents a Prime Implicant y It is Necessary to Select Group Elements to Cover All Truth-Table Positions. y In This Case, ab+cd is the Minimal Formula. y In General, Selecting a Minimal Number of Prime Implicants is NP-Complete
y
And
Or
Not
Xor 0 1
0 0 1
1 1 0
Signal Flow
Nand
Nor
Buffer Xnor
Sequential Logic
Contains Memory Elements y Memory is Provided by Feedback y Circuit diagrams generally have implicit or explicit cycles y Two Styles: Synchronous and Asynchronous
y
An RS Flip-Flop
RS Characteristics
If S=0 and R=1, Q is set to 1, and Q is reset to 0 y If R=0 and S=1, Q is reset to 0, and Q is set to 1 y If S=1 and R=1, Q and Q maintain their previous state. y If S=0 and R=0, a transision to S=1, R=1 will cause oscillation.
y
Instability
RS flip-flops can become unstable if both R and S are set to zero. y All Sequential elements are fundamentally unstable under certain conditions
y
Invalid Transisions Transisions too close together Transisions at the wrong time
D Flip-Flops
A Clocked D Flip-Flop
Flip-Flop Symbols
D Clk
T Clk
A CMOS Flip-Flop
Clk Q D Q Clk
D
Clk
Asynchronous Circuits
y
State is maintained in Asynchronous Circuit Elements y Care must be used to avoid oscillations
y
Q Q
Synchronous Circuits
y
State is maintained in Synchronous Flip-Flops y State Changes can be made only when clock changes y Combinational Logic Must be Stable when Clock is Active
y
Register Symbol
Input 16
Load Clock 16
Output
Register Issues
Generally A Collection of D Flip-Flops y Can be Synchronous or Asynchronous y Default is Assumption is Synchronous y May have internal wiring to:
y
Tristate Elements
y
Three States:
Zero (Output is grounded) One (Output connected to Power Terminal) High-Impedance (Output Not Connected to Either Power Or Ground)
Non-Inverting
Inverting
DANGER!
0