You are on page 1of 37

‫كــلــيـــة هندسة الحاسوب والمعلوماتية واالتصاالت‬

Faculty of Computer & Informatics

ad
and Communications Engineering

hm
Logic Circuits

nA
Dr. Eng.
Hassan M. Ahmad
assa
Hassan.Ahmad@spu.edu.sy, istamo48@mail.ru
r. H
D
ad
hm
nA
Lecture _05
assa
Logic Gets
r. H
Operations & Truth Tables
D

Dr. Eng. Hassan Ahmad 9 July 2018 2


ad
 The inverter performs the Boolean NOT operation.

hm
 NOT operation indicates inversion or complementation . Thus, the Boolean

nA
expression for an inverter is X  A .
 The complemented variable A can be read as “A bar” or “not A.”
 For example, inverter operation with a pulse input, and a timing diagram:

assa
r. H
An Application
Fig. shows a circuit for producing the 1’s complement of an 8-bit binary number.
D

Dr. Eng. Hassan Ahmad 9 July 2018 3


A waveform is applied to an inverter in Figure. Determine the
output waveform corresponding to the input and show the timing diagram.

ad
According to the placement of the bubble, what is the active output state?

hm
nA
The output waveform is exactly opposite to the input (inverted), as shown in Fig.,
which is the basic timing diagram.

assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 4


 The AND gate produces a HIGH output when all inputs are HIGH; otherwise,

ad
the output is LOW.
 The distinctive shape (‫ )الشكل المميز‬symbol

hm
 For a 2-input gate, the truth table is

nA
AND Gate Truth Table

assa
 The total number of possible combinations
of binary inputs to a AND gate is determined
by the following formula: N  2n
r. H
, where N is the number of possible input
combinations and n is the number of input variables.
 For example,
D

Dr. Eng. Hassan Ahmad 9 July 2018 5


a) Develop the truth table for a 3-input AND gate.

ad
b) Determine the total number of possible combinations for a 4-input AND
gate.

hm
nA
The number of possible combinations for a 3-input AND gate is 23 = 8, and the
truth table is as shown.
Total number: N = 24 =16.
(There are 16 possible combinations of
assa
input bits for a 4-input AND gate)
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 6


 In most applications, the inputs to a AND gate are not stationary (‫ )غير ثابتة‬but

ad
are voltage waveforms that change frequency between HIGH and LOW logic
levels.

hm
 Let’s look at the operation of AND gate with pulse waveform inputs, as shown
in Fig.
 As you know, a diagram of input and output waveforms showing time

nA
relationships is called timing diagram.

assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 7


ad
If two waveforms, A and B, are applied to the AND gates inputs as shown in Fig.,
what is the resulting output waveform??

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 8


ad
The logical AND function of two variables is represented mathematically as:
X  A  B or X  AB

hm
Boolean Multiplication (‫)الضرب البوليني‬

nA
assa
Figure shows the AND gate logic symbol with two, three, and four inputs.
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 9


ad
 The OR gate produces a HIGH output if any input is HIGH; if all inputs
are LOW, the output is LOW.

hm
 The distinctive shape (‫ )الشكل المميز‬symbol

nA
 For a 2-input gate, the truth table is

assa
 The OR operation is shown with a plus sign (+) between the variables.
Thus, the OR operation is written as X  A  B
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 10


ad
Example of OR gate operation with a timing diagram showing input and output
time relationships.

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 11


If two input waveforms, A and B, are applied to the OR gate as
shown in Fig., what is the resulting output waveform??

ad
hm
nA
For the two and three input waveforms, A and B, in Fig., show the resulting output

assa
waveform with its proper relation to the inputs?
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 12


ad
The logic AND function of two variables is represented mathematically as
X  A B

hm
Boolean Addition

nA
assa
Notice that Boolean addition differs from binary addition in the case where
two 1s are added. There is no carry in Boolean addition.
r. H
Boolean expression for OR gates with two, three, and four inputs.
D

Dr. Eng. Hassan Ahmad 9 July 2018 13


ad
 The term NAND is contraction (‫ )اختصار‬of NOT-AND and implies an AND
function with inverted output.

hm
 The NAND gate produces a LOW output when all inputs are HIGH;
otherwise, the output is HIGH. For a 2-input gate, the truth table is

nA
assa
 The Boolean expression for the output of a 2-input NAND gate is shown
r. H
with a dot between the variables and an bar over covering them. Thus, the
NAND operation is written as X  A  B or X  AB

and all possible values of the two input variables


Are shown in Table.
D

Dr. Eng. Hassan Ahmad 9 July 2018 14


If two waveforms, A and B, are applied to the NAND gate

ad
inputs as shown in Fig., determine the resulting output
waveform??

hm
nA
Show the resulting output waveform for 3-inputs NAND gate with its proper

assa
relation to the inputs?
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 15


 The term NOR is contraction of NOT-OR and implies an OR function with

ad
inverted output.
 The NOR gate produces a LOW output if any input is HIGH; if all inputs are

hm
HIGH, the output is LOW. For a 2-input gate, the truth table is

nA
 The Boolean expression for the output of a 2-input NOR gate can be written as
assa
shown with a plus sign (+) between the variables and an over-bar covering them.
Thus, the NOR operation is written as X  A  B
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 16


If two (three) waveforms, A and B, (and C) are applied to the

ad
NOR gate inputs as in shown Fig., determine the resulting
output waveform??

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 17


ad
 The Exclusive-OR (XOR for short) produces a HIGH output only when
both inputs are at opposite logic levels. The truth table is

hm
nA
 The XOR operation is written logically as

assa
 Example waveforms:
X  AB  AB
r. H

 Notice that the XOR gate will produce a HIGH only when exactly one
D

input is HIGH.

Dr. Eng. Hassan Ahmad 9 July 2018 18


ad
 The Exclusive-NOR gate (XNOR) produces a HIGH output only when
both inputs are at the same logic level. The truth table is

hm
nA
 The XOR operation shown as X  A  B  A  B
 Example of exclusive-OR gate operation with pulse waveform inputs.
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 19


Determine the output waveforms for the XOR gate and for the
XNOR gate, given the input waveforms, A and B, in Fig.

ad
hm
nA
assa
r. H
The output waveforms are shown in Fig.
Notice that the XOR output is HIGH only when both inputs are at opposite
levels.
Notice that the XNOR output is HIGH only when both inputs are the same.
D

Dr. Eng. Hassan Ahmad 9 July 2018 20


Selected Key Terms
AND gate A logic gate that produces a HIGH output only when all of the inputs are

ad
HIGH.

hm
Boolean The mathematics of logic circuits.
algebra
Complement The inverse or opposite of a number. LOW is the complement of HIGH,

nA
and 0 is the complement of 1.
Exclusive-NOR A logic gate that produces a LOW only when the two inputs are at
(XNOR) gate opposite levels.
Exclusive-OR A logic gate that produces a HIGH output only when its two inputs
(XOR) gate
Inverter assa
are at opposite levels.
A logic circuit that inverts or complements its input.
r. H
NAND gate A logic gate that produces a LOW output only when all the inputs are
HIGH.
NOR gate A logic gate in which the output is LOW when one or more of the inputs
are HIGH.
OR gate A logic gate that produces a HIGH output when one or more inputs are
D

HIGH.
Truth table A table showing the inputs and corresponding output(s) of a logic circuit.
Dr. Eng. Hassan Ahmad 9 July 2018 21
ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 22


ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 23


ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 24


ad
The input waveform shown in Fig. is applied to an inverter. Draw the

hm
output waveform in proper relation to the input.

nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 25


If the waveform in Fig. is applied to point A of combination of
inverters shown in Fig., determine the waveforms at points B through F.

ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 26


Determine the output, X, for a 2-input AND gate with the input
waveforms shown in Fig. Show the proper relationship of output to inputs with

ad
a timing diagram.

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 27


The input waveforms applied to a 3-input AND gate are as indicated
in Fig. Show the output waveform in proper relation to the inputs with a timing

ad
diagram.

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 28


The input waveforms applied to a 4-input AND gate are as indicated
in Fig.

ad
1) Show the output waveform in proper relation to the inputs with timing
diagram.

hm
2) If the output of the AND gate is fed to an inverter, draw the net output
waveform (Y ) of this system.

nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 29


Determine the output for a 2-input OR gate when the input
waveforms are as shown in Fig. and draw a timing diagram.

ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 30


For the five input waveforms in Fig., determine the output for a 5-
input AND gate and the output for a 5-input OR gate. Draw the timing

ad
diagram.

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 31


For the set of input waveforms in Fig., determine the output for the
NAND Gate shown and draw the timing diagram.

ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 32


Determine the gate output for the input waveforms in Fig. and draw
the timing diagram.

ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 33


Determine the output waveform in Fig. and draw the timing
diagram.

ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 34


For the waveforms given in Fig., A and B are ANDed with output F,
D and E are ANDed with output G, and C, F, and G are ORed.

ad
Draw the net output waveform.

hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 35


Determine the output waveform in Fig.

ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 36


ad
hm
nA
assa
r. H
D

Dr. Eng. Hassan Ahmad 9 July 2018 37

You might also like