Professional Documents
Culture Documents
Digital Logic Sol CH02
Digital Logic Sol CH02
Digital Logic
Chapter (2):
Intorduction to Logic Circutis
Chapter (3):
Implementation Technology
Chapter (4):
Otimized Implement Mentation of Logic Function
Chapter (5):
Number Representation & Arithmetic Circuit
Chapter (6):
Combinational-Circuit Building Blocks
Chapter (7):
Flip-Flops, Registers, and Counters
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Chapter
2
INTRODUCTION TO LOGIC CIRCUITS
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
. info@eng-hs.com 9 4444 260
eng-hs.com, eng-hs.net
July 2013
2.4
Gate
Symbol
Inputs
AND
Truth Table
Output
Output
0
Any
0
All
1
.
.
.
0
0
1
1
OR
+
.
.
.
NOT
0
1
0
1
0
1
1
1
All
0
Any
1
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Example 1:
Given the logic network shown in the figure below, find the following:
I.
(the output expression).
II.
Truth table for the logic function
.
III. Timing diagram for the logic function
.
Solution:
I:
1- Name the output of each gate and show its logic symbol:
2- Write the output ( ) in terms of output names, expand it to reach the inputs. (moving
from outputs to inputs)
=
(A
(( )
= (
+
D
) + (B
) + (( )
) + ( )
)
)
:
) (
) (
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
II :
1- From part ( I ) above, = ( ) + (
equal to 1 (review OR gate truth table).
Expanding C and D:
C = 1: when
D = 1: when
), means
= 1 when either C or D is
, and
, and
#inputs
)
.
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
0
1
1
1
0
III :
Copy-paste from the truth table to the timing diagram as follows:
1
0
1
0
1
0
1
0
()
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
2.5
Boolean Algebra
Axioms of Boolean
Algebra
1a.
1b.
2a.
2b.
3a.
3b.
4a.
4b.
00=0
1+1=1
11=1
0+0=0
01=10=0
1+0=0+1=1
Single-Variable Theorems
5a.
5b.
6a.
6b.
7a.
7b.
8a.
8b.
9.
Duality ()
Commutative
Associative
Distributive
Absorption
Combining
DeMorgans
theorem
Consensus
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Solution:
Starting with Right Hand Side:
Why choose RHS?
Has more manipulations than LHS.
Using 7a (
=1
(OR gate = 1, when any input = 1)
Using 6a,
= LHS
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Solution:
In this example, since both sides have approximately equivalent amount of
manipulations, we can try to simplify both sides.
Using 10b to exchange places of
2nd and 3rd terms.
Using 8b,
(*)
Using 6a,
Using 8b
6a
(*)
and
nd
Using 16a,
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
0/1
A
0
E
1
B
1
C
0/1
+
OR
0
D
+
OR
1
H
0/1
0/1
OR
+
OR
0
0
0
0
1
1
1
1
LHS = RHS Valid
OR
0
0
1
1
0
0
1
1
0/1
F
0
1
0
1
0
1
0
1
+
OR
A
C
A, C
D
D
B
0/1
0
1
1
1
1
1
1
0
1
G
E
G
H
F
E
F, G
0
1
1
1
1
1
1
0
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
0/1
A
AND
1
B
AND
0
C
0/1
0/1
F
+
0
LHS
0
D
0/1
0
0
0
0
1
1
1
1
RHS Not Valid
AND
0
0
1
1
0
0
1
1
0/1
0
E
0
1
0
1
0
1
0
1
A
A
C
C
B
0
1
0
1
0
0
1
0
AND 1
D, E
D
E
F
F
0
0
1
1
0
0
1
0
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
2.6
Functions Synthesis
Row#
Minterm
Maxterm
(Force to 1,
then product the inputs)
(Force to 0,
then Sum the inputs)
(e.g.)
0
1
2
3
0
0
0
0
0
0
1
1
0
1
0
1
1
1
4
5
1
1
0
0
0
1
0
1
0
0
Let n = #inputs,
#inputs
then #Rows = 2
Let be a function of variables, then can be represented in the canonical form as Sum-ofProducts (SOP), or as Product-of-Sums (POS) as follows:
=
=
=
=
=
=
=
=
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Example 6:
Given the truth table below, write the expression of
a. Sum-of-products.
b. Product-of-sums.
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
as the following:
0
1
0
1
1
1
1
0
Solution:
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
1
0
=
=
=
=
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Solution:
Which is Sum-of-Products
Using 8b,
the small parenthesizes
into 1.
Using 6a
to reduce
=
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Solution:
Lets see the truth table for more insight into the question:
Sum#
0
1
2
3
4
5
6
7
.
.
15
0
0
0
0
0
0
0
0
.
.
1
0
0
0
0
1
1
1
1
.
.
1
0
0
1
1
0
0
1
1
.
.
1
0
1
0
1
0
1
0
1
.
.
1
0
1
1
1
0
0
0
1
.
.
1
1st
1st, 2nd
2nd
3rd
Using 14b
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
2.7
Gate
Symbol
NAND
NOR
Inputs
Output
Truth Table
0
0
1
1
0
0
1
1
0
1
0
1
Output
1
1
1
0
0
1
0
1
Output
1
0
0
0
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Solution:
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Solution:
082
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
2.8
Design Examples
(Multiplexer Circuit)
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
1
0
1
0
1
.
0
1
Figure 3: Multiplexer Graphical symbol
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
1st
2nd
3rd
4th
5th
. . .
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
=
Minimizing:
Lets try to move from 4 to 3 variables per term. To do so, we need to find each
terms differ-by-one couple term (
. From the truth table we notice:
-
=
=
=
=
Note: the same 5th term can be used more than once if you use 7a. (
.
.
.
.
=
+
+
+
=
+
=
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
2.9
Example A
Always
(procedural statements)
Continuous Assignment
(logic expressions)
Structural
(gate level primitives)
Verilog
Specification
~ NOT
|
OR
& AND
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
Example B
Always
(procedural statements)
Continuous Assignment
(logic expressions)
Structural
(gate level primitives)
Verilog
Specification
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
x1, x2)
1)
f = x2;
else
f = x1;
endmodule
Other Solution: (using conditional operator
module
(. ? : ) )
endmodule
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net
July 2013
(b)
Solution:
module prob2_50(x1, x2, x3,
input x1, x2, x3, x4;
output f1, f2;
assign
assign
endmodule
Term#
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
0
0
1
1
0
0
1
1
1
0
1
1
1
1
Term#
rd
2nd, 3rd
2nd
1
0
0
0
1
1
0
0
1
1
1
0
1
1
1
1
2nd
1st
All terms
1st
1st
3rd
9 4444 062
Physics I/II, English 123, Statics, Dynamics, Strength, Structure I/II, C++, Java, Data, Algorithms, Numerical, Economy
eng-hs.com, eng-hs.net