part2
part2
2016-2017
2 Logic Gates
A logic gate is an electronic circuit which makes logic decisions. It has one
output and one or more inputs.
THE INVERTER
The inverter (NOT circuit) performs the operation called inversion or
complementation. The inverter changes one logic level to the opposite level. In
terms of bits, it changes a 1 to a 0 and a 0 to a 1.
Standard logic symbols for the inverter are shown in Fig.(2-1), shows the
distinctive shape symbols.
When a HIGH level is applied to an inverter input, a LOW level will appear on its
output. When a LOW level is applied to its input, a HIGH will appear on its output
as shown in Fig.(2-2). This operation is summarized in Table 2-1, which shows the
output for each possible input in terms of levels and corresponding bits. A table
such as this is called a truth table, which gives the output state for all possible
input combinations.
28
Dr. Najat Hadher/ Digital Tech. 2016-2017
Table 2-1
This expression states that the output is the complement of the input, so if A = 0,
then X = 1, and if A = 1, then X = 0.
29
Dr. Najat Hadher/ Digital Tech. 2016-2017
For a 2-input AND gate, output X is HIGH only when inputs A and B are
HIGH; X is LOW when either A or B is LOW, or when both A and B are
LOW.
30
Dr. Najat Hadher/ Digital Tech. 2016-2017
The logical operation of a gate can be expressed with a truth table that lists all
input combinations with the corresponding outputs, as illustrated in Table 2-2 for a
2-input AND gate. The truth table can be expanded to any number of inputs. For
any AND gate, regardless of the number of inputs, the output is HIGH only when
all inputs are HIGH.
31
Dr. Najat Hadher/ Digital Tech. 2016-2017
Let's examine the waveform operation of an AND gate by looking at the inputs
with respect to each other in order to determine the output level at any given time.
In Fig.(2-5), inputs A and B are both HIGH (1) during the time interval, t 1 making
output X HIGH (1) during this interval. During time interval t2 input A is LOW (0)
and input B is HIGH (1), so the output is LOW (0). During time interval t3 , both
inputs are HIGH (1), and therefore the output is HIGH (1). During time interval t4
, input A is HIGH 0) and input B is LOW (0), resulting in a LOW (0) output.
Finally, during time interval t5 , input A is LOW (0), input B is LOW (0), and the
output is therefore LOW (0). As you know, a diagram of input and output
waveforms showing time relationships is called a timing diagram.
32
Dr. Najat Hadher/ Digital Tech. 2016-2017
Fig.(2-6) Boolean expressions for AND gates with two, three, and four
inputs.
The OR Gate
An OR gate can have more than two inputs. The OR gate is another of the basic
gates from which all logic functions are constructed. An OR gate can have two or
more inputs and performs what is known as logical addition.
An OR gate has two or more inputs and one output, as indicated by the
standard logic symbol in Fig.(2-7), where OR gates with two inputs are illustrated.
An OR gate can have any number of inputs greater than one.
33
Dr. Najat Hadher/ Digital Tech. 2016-2017
Operation of an OR Gate
An OR gate produces a HIGH on the output when any of the inputs is
HIGH. The output is LOW only when all of the inputs are LOW.
The inputs of the 2-input OR gate in Fig.(2-7) are labelled A and B. and the output
is labelled X. The operation of the gate can be stated as follows :
34
Dr. Najat Hadher/ Digital Tech. 2016-2017
35
Dr. Najat Hadher/ Digital Tech. 2016-2017
Notice that Boolean addition differs from binary addition in the case
where two 1 s are added. There is no carry in Boolean addition.
36
Dr. Najat Hadher/ Digital Tech. 2016-2017
Fig.(2-10)(a) shows the OR gate logic symbol with two input variables and the
output variable labelled.
Fig.(2-10) Boolean expressions for OR gates with two, three, and four inputs.
To extend the OR expression to more than two input variables. a new letter is used
for each additional variable. For instance, the function of a 3-input OR gate can be
expressed as X = A + B + C. The expression for a 4-input OR gate can be written
as X = A + B + C + D, and so on. Parts (b) and (c) of Fig.(2-10) how OR gates
with three and four input variables, respectively.
Ex: For a three-input OR gate shown in Figure below, determine the output
waveform.
37
Dr. Najat Hadher/ Digital Tech. 2016-2017
(a) (b)
38
Dr. Najat Hadher/ Digital Tech. 2016-2017
gate for all four input combinations, and Table 2-4 is the truth table summarizing
the logical operation of the 2-input NAND gate.
The NAND is the same as the AND except the output is inverted.
39
Dr. Najat Hadher/ Digital Tech. 2016-2017
negative in this context mean that the inputs are defined to be in the active or
asserted state when LOW.
For a 2-input NAND gate performing a negative-OR operation, output X is
HIGH when either input A or input B is LOW, or when both A and B are
LOW.
When a NAND gate is used to detect one or more LOWs on its inputs rather than
all HIGHs, it is performing the negative-OR operation and is represented by the
standard logic symbol shown in Fig.(2-13).
X = AB
This expression says that the two input variables, A and B, are first ANDed and
then complemented, as indicated by the bar over the AND expression. This is a
description in equation form of the operation of a NAND gate with two inputs.
Evaluating this expression for all possible values of the two input variables, you
get the results shown in Table 2-5.
40
Dr. Najat Hadher/ Digital Tech. 2016-2017
Table 2-5.
(a) (b)
(b)
Fig.(2-14) Standard NOR gate logic symbols.
41
Dr. Najat Hadher/ Digital Tech. 2016-2017
For a 2-input NOR gate, output X is LOW when either input A or input B is
HIGH, or when both A and B are HIGH; X is HIGH only when both A and B
are LOW.
42
Dr. Najat Hadher/ Digital Tech. 2016-2017
When a NOR gate is used to detect all LOWs on its inputs rather than one or more
HIGHs, it is performing the negative-AND operation and is represented by the
standard symbol in Fig.(2-16). It is important to remember that the two symbols in
Fig.(2-16), represent the same physical gate and serve only to distinguish between
the two modes of its operation.
43
Dr. Najat Hadher/ Digital Tech. 2016-2017
X = A+B
This equation says that the two input variables are first ORed and then
complemented, as indicated by the bar over the OR expression. Evaluating this
expression, you get the results shown in Table 2-7. The NOR expression can be
extended to more than two input variables by including additional letters to
represent the other variables.
Table 2-7
44
Dr. Najat Hadher/ Digital Tech. 2016-2017
For an exclusive-OR gate, output X is HIGH when the two inputs are
different.
The four possible input combinations and the resulting outputs for an XOR gate
are illustrated in Fig.(2-18). The HIGH level is the active or asserted output level
and occurs only when the inputs are at opposite levels. The operation of an XOR
gate is summarized in the table shown in Table 2-8.
45
Dr. Najat Hadher/ Digital Tech. 2016-2017
46
Dr. Najat Hadher/ Digital Tech. 2016-2017
The four possible input combinations and the resulting outputs for an
XNOR gate are shown in Fig,(2-20). The operation of an XNOR gate is
summarized in Table 2-9. Notice that the output is HIGH when the same level is
on both inputs.
47
Dr. Najat Hadher/ Digital Tech. 2016-2017
Example: Determine the output waveforms for the XOR gate and for the XNOR
gate, given the input waveforms, A and B, in Figure below:
GENERAL QUESTIONS
Finish
48