Chapter 2-CombinationalLogicCircuits
Chapter 2-CombinationalLogicCircuits
Combinational Logic
Circuits
M. Morris Mano, Charles R. Kime. (2015). Logic and computer design fundamentals (5th ed.). Pearson.
1
Contents
2
1. Binary Logic and Gates
3
Binary Logic
4
Binary Variables
5
Logical Operations
6
Logical Operations
7
Logical Operations
8
Logic Gates
9
Logic Gates
10
Logic Gates
11
Commonly Used Logic Gates
12
Commonly Used Logic Gates
13
Logic Gates
14
HDL Representations of Gates
16
HDL Representations of Gates
17
2. Boolean Algebra
• The Boolean algebra is an algebra dealing with binary variables and logic
operations.
• The variables are designated by letters of the alphabet.
• The three basic logic operations are AND, OR, and NOT.
• A Boolean expression is an algebraic expression formed by using
• Binary variables
• Constants 0 and 1
• Logic operation symbols
• Parentheses.
• Boolean function
𝐿 𝐷, 𝑋, 𝐴 = 𝐷𝑋ത + 𝐴
18
2. Boolean Algebra
19
2. Boolean Algebra
• Function 𝐿 𝐷, 𝑋, 𝐴 = 𝐷𝑋ത + 𝐴
20
2. Boolean Algebra
• Function 𝐿 𝐷, 𝑋, 𝐴 = 𝐷𝑋ത + 𝐴
21
Boolean Algebra
Dual
23
Basic Identities of Boolean ALgebra
• For example
24
Basic Identities of Boolean Algebra
25
Algebraic Manipulation
26
Algebraic Manipulation
28
Algebraic Manipulation
• Consensus theorem
29
Complement of a Function
30
Complement of a Function
31
Complement of a Function
• 3. Complementing
a function by using
dual
32
Complement of a Function
• Sum term: This is a logical sum consisting of an OR operation among the literals.
34
Minterms and Maxterms
35
Minterms and Maxterms
36
Minterms and Maxterms
• 2n maxterms
37
Minterms and Maxterms
38
Standard Forms • 1. Sum-of-Products Form
• sum of all the minterms that produce a 1 in
the function
2. Product-of-Sums Form
product of all the maxterms that produce a 0 in
the function
F
39
Minterms and Maxterms
40
Sum of Products
41
Sum of Products
• Cost Criteria:
• To formalize the way of measuring the simplicity of a logic circuit
• Literal cost and gate-input cost
• Literal cost
• The number of literal appearances in a Boolean expression
corresponding exactly to the logic diagram
43
Literal Cost
Literal cost 5 6
Literal cost 8 8
But, the first equation has two terms and the second has four. This suggests
that the first equation has a lower cost than the second. 44
Gate-Input Cost
46
Two-Variable K Map
47
Two-Variable K Map
48
Three-Variable K Map
BC BC BC BC
49
Three-Variable K Map
50
Four-Variable K Map
51
Karnaugh Map
52
Looping Groups of Two (pairs)
53
Looping Groups of Two (pairs)
54
Looping Groups of Two (pairs)
55
Looping Groups of Four (Quads)
56
Looping Groups of Four (Quads)
57
Looping Groups of Eight (Octets)
• Looping an eight of
adjacent 1s eliminates
the three variables
that appear in both
complemented and
un-complemented
form.
58
Looping Groups of Eight (Octets)
• Looping an eight of
adjacent 1s eliminates
the three variables
that appear in both
complemented and
un-complemented
form.
59
Karnaugh Map
• Simplification process
1. Construct the K map and place 1s in those squares corresponding to the 1s in the truth
table. Place 0s in the other squares.
2. Examine the map for adjacent 1s and loop those 1s that are not adjacent to any other 1s.
These are called isolated 1s.
3. Next, look for those 1s that are adjacent to only one other 1. Loop any pair containing such
a 1.
4. Loop any octet even if it contains some 1s that have already been looped.
5. Loop any quad that contains one or more 1s that have not already been looped, making
sure to use the minimum number of loops.
6. Loop any pairs necessary to include any 1s that have not yet been looped, making sure to
use the minimum number of loops.
7. Form the OR sum of all the terms generated by each loop.
60
Karnaugh Map
61
Karnaugh Map
62
Karnaugh Map
63
Karnaugh Map
64
Karnaugh Map
65
Karnaugh Map
66
Karnaugh Map
• Product-of-Sum Optimization
• Simplify the following Boolean function in product-of-sums form:
67
Don’t-Care Conditions
𝑋⨁𝑌 = 𝑋𝑌ത + 𝑋𝑌
ത
𝑋⨁𝑌 = 𝑋𝑌ത + 𝑋𝑌
ത = 𝑋ത + 𝑌 𝑋 + 𝑌ത = 𝑋𝑌 + 𝑋ത 𝑌ത
69
5. Exclusive-Or Operation and Gates
70
6. HDL Representation - Verilog
71
A1 A0 B1 B0 A is greater than B
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
A_greater_than_B = 𝐴1 𝐴0 𝐵1 𝐵0 + 𝐴1 𝐴0 𝐵1 𝐵0
0 1 0 0 1 𝐴1 𝐴0 𝐵1 𝐵0 + 𝐴1 𝐴0 𝐵1 𝐵0 +𝐴1 𝐴0 𝐵1 𝐵0
0 1 0 1 0 + 𝐴1 𝐴0 𝐵1 𝐵0 +𝐴1 𝐴0 𝐵1 𝐵0
0 1 1 0 0 B1B0
0 1 1 1 0 00 01 11 10
1 0 0 0 1 𝐴1 𝐴0 𝐵1 𝐵0 00
1 0 0 1 1 𝐴1 𝐴0 𝐵1 𝐵0 A1A0 01 1
1 0 1 0 0 11 1 1 1
10 1 1
1 0 1 1 0
1 1 0 0 1 𝐴1 𝐴0 𝐵1 𝐵0 A_greater_than_B= 𝐴1 𝐵1 + 𝐴0 𝐵1 𝐵0 + 𝐴1 𝐴0 𝐵0
1 1 0 1 1 𝐴1 𝐴0 𝐵1 𝐵0
72
1 1 1 0 1 𝐴1 𝐴0 𝐵1 𝐵0
1 1 1 1 0
Two-Bit Greater-Than Circuit
A_greater_than_B= 𝐴1 𝐵1 + 𝐴0 𝐵1 𝐵0 + 𝐴1 𝐴0 𝐵0
and0_out
B1_n
and1_out
and2_out
B0_n
73
Two-Bit Greater-Than Circuit
and0_out
B1_n
and1_out
and2_out
B0_n
74
Structural Verilog Description of Two-Bit
Greater-Than Circuit and0_out
B1_n
• Equivalent to the circuit schematic and1_out
• Gate-level modeling
and2_out
B0_n
75
• // : Single line comment
• /* .. : Multiline comment
*/
• input [1:0] A, B;
• A and B are vectors with a width of two, with the most significant (leftmost) bit numbered 1 and
least significant (rightmost) bit numbered 0. A[1] A[0] B[1] B[0]
A B
• In Verilog, wire is the default net type. Notably, input and output ports have the
default type wire. 76
77
Dataflow Verilog Description
78
and0_out
B1_n
and1_out
• Dataflow Modeling
and2_out
B0_n
79
• The order of execution of the assignment statements does not depend upon
the order of their appearance in the model description, but rather on the order
of changes of signals on the right-hand side of the assignment statements.
81
Behavioral Verilog Description
82
Testbenches
• A testbench is an HDL
model whose purpose is
to test another model,
often called the Device
Under Test (DUT), by
applying stimuli to the
inputs.
• More complex testbenches
will also analyze the output
of the DUT for correctness.
83
Testbenches
84
85