كــلــيـــة هندسة الحاسوب والمعلوماتية واالتصاالت
Faculty of Computer & Informatics
ad
and Communications Engineering
hm
Logic Circuits
nA
Dr. Eng.
Hassan M. Ahmad
assa
[email protected], [email protected]
r. H
D
ad
hm
nA
Lecture _08
assa
Combinational Logic Circuits
r. H
&
its Implementing
D
Dr. Eng. Hassan Ahmad 23 July 2018 2
ad
AND-OR Logic
hm
In Sum-of-Products (SOP) form, basic combinational circuits can be directly
nA
implemented with AND-OR combinations if the necessary complement terms
are available.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 3
AND-OR circuit consists of two 2-input AND gates and one 2-input OR gate,
ad
as shown in Figure-Logic diagram.
hm
nA
assa
In general, an AND-OR circuit can have any number of AND gates each with
any number of inputs.
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 4
The truth table for a 4-input AND-OR logic circuit is shown.
ad
hm
nA
assa
r. H
The operation of the AND-OR circuit in Fig. is stated as follows:
For a 4-point AND-OR logic circuit, the output X is HIGH (1) if both input
D
A and B are HIGH (1) or both input C and D are HIGH (1).
Dr. Eng. Hassan Ahmad 23 July 2018 5
AND-OR-Invert Logic
ad
When the output of an AND-OR is complemented (inverted), it results in an
hm
AND-OR Invert circuit.
The logic diagram in Figure shows an AND-OR Invert circuit and
nA
development of the POS output expression.
An example of an AOI implementation is shown. The output expression can
be changed to a POS expression by applying DeMorgan’s theorem twice.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 6
AND-OR-Invert Logic
ad
In general, an AND-OR Invert circuit can have any number of AND gates
hm
each with any number of inputs.
The operation of the AND-OR Invert circuit in Fig. is stated as follows:
nA
For a 4-point AND-OR Invert logic circuit, the output X is LOW (0) if
both input A and B are HIGH (1) or both input C and D are HIGH (1).
A truth table can be developed from truth table for a 4-input AND-OR logic
assa
circuit by simply changing all 1s to 0s and all 0s to 1s in the output column.
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 7
Exclusive-OR Logic
ad
The exclusive-OR gate is actually a combination of two AND gates, one OR
gate, and two invertors, as shown in Figure.
hm
nA
assa
The truth table for an exclusive-OR gate is
r. H
Notice that the output is HIGH whenever A and B disagree (opposite levels).
A special exclusive OR operator is often used, so the output expression
can be stated as X AB AB
D
o X is equal to A exclusive-OR B” and can be written as X A B
Dr. Eng. Hassan Ahmad 23 July 2018 8
Exclusive-NOR Logic
ad
The complement of exclusive-OR function is exclusive-NOR, which is
hm
derived as follows:
X AB AB ( AB ) ( AB ) ( A B)( A B) AB AB
nA
The exclusive-NOR can be implemented by simply inverting the output of an
exclusive-OR, as shown in Fig. (a), or by directly implementing the
expression AB AB , as show in Fig. (b).
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 9
ad
From a Boolean Expression to a Logic Circuit
Let’s examine the following Boolean expression: X AB CDE
hm
This expression is composed of two terms, AB and CDE, with a domain of five
variables.
The first term is formed by ANDing A with B, and the second term is formed by
nA
ANDing C, D and E.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 10
Given the Boolean expression X AB(C D EF )
Implement the corresponding logic circuit.
ad
The structure that indicated in relation to the expression is as follows:
hm
nA
Before we can implement the final expression, we must create the sum term C D EF ;
but before we can get this term, we must create the product terms C D and EF ;
assa
but before we can get the term C D , we must create D .
So, as we can see, the logic operations must be done in the proper order.
r. H
The logic gates required to implement X AB(CD EF ) are as follows:
1. One invertor to form D .
2. Two 2-input AND gates to form C D and EF .
3. One 2-input OR gate to form CD EF .
4. One 3-input AND gate to form X.
D
Dr. Eng. Hassan Ahmad 23 July 2018 11
The resulting logic circuit for given expression is shown in Fig.
ad
hm
nA
The expression is converted to SOP as follows: X AB(C D EF ) ABC D ABEF
and the resulting circuit is shown in Fig.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 12
From a Truth Table to a Logic Circuit
ad
Let the following table specifies a logic function.
hm
nA
assa
The Boolean SOP expression obtained from the truth table ORing the
r. H
product terms for which X = 1 is: X ABC ABC
The first term in the expression is formed by ANDing the three variables
A, B, and C
D
The second term is formed by ANDing the three variables A, B, and C
Dr. Eng. Hassan Ahmad 23 July 2018 13
The logic gates required to implement this expression are as follows:
ad
• Three invertors to form A, B, and C variables; X ABC ABC
• Two 3-inputs AND gates to form terms ABC and ABC ;
hm
• One 2-input OR gate to form the final output function, ABC ABC .
nA
The implementation of logic function X ABC ABC is illustrated in Fig.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 14
Design a logic circuit to implement the operation specified in
following given truth table.
ad
hm
nA
Notice that X = 1 for only three of the input conditions. Therefore, the logic expression is
X ABC ABC ABC
assa
The logic gates required are three inverters, three 3-input AND gates and one 3-input OR
gate. The logic circuit is shown in Fig.
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 15
Develop a logic circuit with four input variables that will only
produce a 1 output when exactly three input variables are 1s.
ad
hm
The combinations in which there are
exactly three 1s are listed in Table.
The product terms are Ored
nA
to get the following expression:
X ABCD ABCD ABCD ABC D
This expression is implemented in Fig.
with AND-OR logic.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 16
Reduce the combinational logic circuit in Fig. to a minimum
form.
ad
hm
The expression for the output of the circuit is:
X A BC C A BC D
nA
Applying DeMorgan’s theorem and Boolean algebra,
X ( A B C )C A B C D (rul _ 9)
AC BC CC A B C D
assa
AC BC C A B C D
AC BC C A B D
C ( A B 1) A B D
(rul _ 7)
(rul _ 5)
(rul _ 2)
r. H
C ( A 1) A B D (rul _ 2)
A B C D (rul _ 4)
The simplified circuit is a 4-input OR gate as shown in Fig.
D
Dr. Eng. Hassan Ahmad 23 July 2018 17
ad
The operation of any gate is the same regardless ( )بغض النظرof whether its
hm
inputs are pulsed or constant levels.
The nature of the inputs (pulsed or constant levels) does not alter ( )يغيّرthe
nA
truth table of a circuit.
The following is a review of the operation of individual gates for use in
analyzing combinational circuits with pulse waveform inputs:
assa
1. The output of an AND gate is HIGH only when all inputs are HIGH at
the same time.
2. The output of an OR gate is HIGH only when at least one of its inputs
r. H
is HIGH.
3. The output of a NAND gate is LOW only when all inputs are HIGH at
the same time.
4. The output of a NOR gate is LOW only when at least one of its inputs
D
is HIGH.
Dr. Eng. Hassan Ahmad 23 July 2018 18
Determine the final output waveform X for the circuit in following
Fig., with input waveforms A, B, and C as shown.
ad
hm
nA
assa
The output expression, AB AC , indicates that the output X is LOW when:
r. H
• both A and B are HIGH or
• both A and C are HIGH or
• all inputs are HIGH.
The output waveform X is shown in the timing diagram of given Fig.
The intermediate waveform Y at the output of the OR gate is also shown.
D
Dr. Eng. Hassan Ahmad 23 July 2018 19
Draw the timing diagram for the circuit in following Fig. showing the
outputs of G1 , G2 , and G3 with the input waveforms, A, and B, as indicated.
ad
hm
nA
When both inputs are HIGH or when both inputs are LOW, the output X is HIGH as shown
in following Fig.
assa
r. H
Notice that this is an exclusive-NOR circuit.
The intermediate outputs of gates G2 , and G3 are also shown in Fig.
D
Dr. Eng. Hassan Ahmad 23 July 2018 20
Determine the output waveform X for the logic circuit with input
waveforms in Figure by first finding the intermediate waveform at each of points Y1, Y2, Y3,
ad
and Y4.
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 21
ad
Universal gate Either a NAND or a NOR gate. The term universal refers to a
property of a gate that permits any logic function to be implemented
hm
by that gate or by a combination of gates of that kind.
Negative-OR The dual operation of a NAND gate when the inputs are active-LOW.
Negative-AND
nA
The dual operation of a NOR gate when the inputs are active-LOW.
Node A common connection point in a circuit in which a gate output is
connected to one or more
gate inputs.
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 22
ad
1. AND-OR logic can have only two 2-input AND gates.
hm
2. AOI is an acronym for AND-OR-Invert.
3. If the inputs of an exclusive-OR gate are the same, the output is LOW (0).
nA
4. If the inputs of an exclusive-NOR gate are different, the output is HIGH (1).
5. A parity generator cannot be implemented using exclusive-OR gates.
6. NAND gates can be used to produce the AND functions.
7.
assa
NOR gates cannot be used to produce the OR functions.
8. Any SOP expression can be implemented using only NAND gates.
9. Negative-OR is equivalent to NAND.
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 23
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 24
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 25
ad
hm
Answers:
1. b 5. c
nA
2. d 6. b
3. c 7. c
assa 4. d 8. a
9. c
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 26
ad
Write the output expression for each circuit in Figure.
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 27
ad
Write the output expression for each circuit in Figure.
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 28
Develop the truth table for each circuit in Figure.
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 29
Use AND gates, OR gates, and inverters as needed to implement the
following logic expressions as stated
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 30
Use NAND gates, NOR gates, or combinations of both to
implement the following logic expressions as stated:
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 31
Using Karnough map, implement a logic circuit for the truth table
in Table.
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 32
Implement the logic circuits in Figure using only NAND gates,
and also using only NOR gates.
ad
hm
nA
NAND:
assa
r. H
NOR:
D
Dr. Eng. Hassan Ahmad 23 July 2018 33
Determine the output waveform X for the circuit in Fig., directly from the
output expression.
ad
hm
The output expression for the circuit is developed in following Fig.
nA
assa
r. H
Result: The SOP form indicates that the output is HIGH when A is LOW and C is HIGH
or when B is LOW and C is HIGH or when C is LOW and D is HIGH, regardless ( بغض
)النظرof values of another variables in each state.
D
Dr. Eng. Hassan Ahmad 23 July 2018 34
The result is shown in following Fig. and is the same as the one obtained by the
intermediate-waveform method in Example 8-7.
ad
hm
nA
assa
r. H
The corresponding product terms for each waveform condition that results in a HIGH
output are indicated.
D
Dr. Eng. Hassan Ahmad 23 July 2018 35
ad
hm
nA
assa
r. H
D
Dr. Eng. Hassan Ahmad 23 July 2018 36