Basic and Derived Logic Gates
Basic and Derived Logic Gates
Basic and Derived Logic Gates
1
Introduction
Digital (logic) circuits operate in the binary mode
where each input &output voltage is either a 0 or 1;
the 0 and 1 designations represent predefined voltage
ranges.
This characteristic of logic circuits allows us to use
Boolean algebra as a tool for the analysis and design
of digital systems.
In this chapter we will study logic gates, which are the
most fundamental logic circuits, and we will see how
their operation can be described using Boolean
algebra.
The interconnection of gates to perform a variety of
logical operations is called logic design.
We will also see how logic gates can be combined to
produce logic circuits, and how these circuits can be
described and analyzed using Boolean algebra.
2
Basic Logic Gates
Boolean algebra
Boolean Constants and Variables
Boolean algebra differs in a major way from ordinary
algebra in that Boolean constants and variables are allowed
to have only two possible values, 0 or 1.
Boolean Variable is a quantity that may, at different times,
be equal to either 0 or 1 .
The Boolean Variables are often used to represent the
voltage level represent on a wire or input/output terminal of
a circuit.
For example: in a certain digital system the Boolean Value
of 0 might be assigned to any voltage in the range from 0 to
0.8V while the Boolean value of 1 might be assigned to any
voltage in the range of 2 to 5V.
Voltage b/w 0.8 and 2V are undefined (neither 0 nor 1) and
under normal circumstances should not occur.
3
Thus, Boolean 0 and 1 do not represent actual
numbers but instead represents the state of voltage
variable, or what is called its logic level.
A voltage in a digital circuit is said to be at logic
level 0 or the logic level 1, depending on its actual
numerical value.
In table below, some of the more common terms in
the digital logic field are shown.
LOGIC 0 LOGIC 1
False True
Off On
Low High
No Yes
Open switch Closed switch 4
In all our works to follow we shall use letter
symbols to represent logic variables.
Because only two values are possible, Boolean
algebra is relatively easy to work with as compared
with ordinary algebra.
In Boolean algebra there are no decimals, fractions,
negative numbers, square root, logarithms,
imaginary number, and so on.
In Boolean algebra there are only three basic
operation; OR, AND and NOT.
These basic operations are called logic operations
Digital circuits called logic gates can be
constructed from diode, transistors, and resistors
connected in such a way that the circuit output is
the result of a basic logic operation (OR, AND,
NOT) performed on the inputs.
5
Truth Tables
Many logic circuits have more than one input Inputs Output
and only one output. A B C D Y
A truth table shows how the logic circuit's 0 0 0 0 ?
output responds to the various combinations 0 0 0 1 ?
of logic levels at the inputs. 0 0 1 0 ?
The format for two-, three-, and four-input truth 0 0 1 1 ?
tables is shown in Table below 0 1 0 0 ?
The number of input combinations will equal 0 1 0 1 ?
2N for an N-input truth table. 0 1 1 0 ?
Inputs Output 0 1 1 1 ?
Inputs Output A B C Y 1 0 0 0 ?
0 0 0 ? 1 0 0 1 ?
A B Y 1 0 1 0 ?
0 0 1 ?
0 0 ? 0 1 0 ? 1 0 1 1 ?
0 1 ? 0 1 1 ? 1 1 0 0 ?
1 0 ? 1 0 0 ? 1 1 0 1 ?
1 0 1 ? 1 1 1 0 ?
1 1 ?
1 1 0 ? 1 1 1 1 ?
Truth table for 1 1 1 ?
Truth table for
two-input
Truth table for four-input
6
three-input
OR OPERATION
Let A and B represents two independent logic variables.
When A and B are combined using the OR operation the result Y
can be expressed as
Y = A+B
In this expression the + sign does not stand for ordinary addition;
it stands for the OR operation, whose rules are given in the truth
table shown below
A B Y= A+B
0 0 0
0 1 1
1 0 1
1 1 1
7
It should be apparent from the truth table that
except for the case where A=B=1, the OR operation
is the same as ordinary operation.
However, for A=B=1 the OR sum is 1 (not 2 as in
ordinary addition).
This is easy to remember if we recall that only 0 and
1 are possible values in Boolean algebra, so that
the largest value we can get is 1.
This same result is true if we have Y= A+B+C, for
the case where A=B=C=1 that is
Y= 1+1+1 = 1
We can therefore say that the OR operation result
will be 1 if any one or more variables is a 1
The expression Y= A+B is read as
‘’Y equals A OR B’’
8
OR Gate
A gate is logic circuit with one output and one A
Y=A+B
or more inputs; an output signal occurs only B
for certain combinations of input signals.
In digital circuitry an OR gate is a circuit that Logic symbol of
has two or more inputs and whose output is
equal to the OR sum of the inputs. Two-input OR gate
This is the logic symbol for a two-input OR gate A
The OR gate operates in such way that its B
C
Y = A + B+C
output is HIGH (Logic 1) if either input A or B or
both are at a logic 1 level.
The OR gate output will be Low (Logic 0) only if Logic symbol of
all its inputs are at logic 0.This same idea can three-input OR gate
be extended to more than two inputs.
A B C Y= A+B+C
Figure below shows three inputs OR gate and
its truth table. 0 0 0 0
0 0 1 1
Summary of the OR Operation 0 1 0 1
The OR operation produces a result of 1 when 0 1 1 1
any of the input variables is 1 1 0 0 1
1 0 1 1
The OR operation produces a result of 0 only
1 1 0 1
when all the input variables are 0.
1 1 1 1
With the OR operation, 1+1 =1, 1+1+1 = 1, and 9
so on.
Discrete OR Gate
D1
+5 V
A Y
A B Y
B 0 0 0
D2
R 0 1 1
Y
1 0 1
R
Two-input A T1 T2 T3 1 1 1
diode OR Gate
B
Truth Table
Two-input 10
Transistor OR gate
Example: Determine the OR gate output in Figure below. The OR gate
inputs A and B are varying according to the timing diagrams shown. For
example, A starts out LOW at time to, goes HIGH at t1, back LOW at t3, and
so on.
1
A
0
1
B
0
1
Output
Y
0
t0 t1 t2 t3 t4 t5 t6 t7
11
AND OPERATION
If two logic variables A and B are
combined using the AND operation, the
result, Y, can be expressed as
Y= A·B
In this expression the ∙ sign stands for A B Y= A.B
the Boolean AND operation whose
rules are given in the truth table shown
in figure below. 0 0 0
It should be apparent from the table
that the AND operation is exactly the 0 1 0
same as ordinary multiplication.
Whenever A or B is 0, their product is
zero, when both A and B are 1, their 1 0 0
product is 1. We can therefore say that
in the AND operation the result will be 1
only if all the inputs are 1: for all other 1 1 1
cases the result is 0.
The expression Y= A.B is read ‘’Y
equals A AND B’’
The multiplication sign is generally
omitted as in ordinary algebra, so that
the expression becomes Y=AB
12
AND Gate
The logic symbol for a two- input AND A
gate is shown in fig. Below Y = AB
The AND gate output is equal to the AND B
product of the logic inputs i.e. Y= AB.
In other words, the AND gate is a circuit Logic symbol of AND gate
that operates in such a way that its output
is HIGH only when all its inputs are
HIGH. A
B Y = ABC
For all other cases the AND gate output C
is LOW.
This same operation is Characteristic of
AND gates with more than two inputs. Logic symbol of
A three-input AND gate and its three-input AND gate
accompanying truth table are shown in
fig. Below.
Summary of the AND operation A B C Y=ABC
The AND operation is performed 0 0 0 0
exactly like ordinary multiplication 1s 0 0 1 0
and 0s 0 1 0 0
The output equal to 1 occurs only for 0 1 1 0
the single case where all inputs are 1 1 0 0 0
1 0 1 0
The output is 0 for any case where one 1 1 0 0
or more inputs are 0. 1 1 1 1
13
Discrete AND Gate
+5 V +5 V
A B X
0 0 0
A T1 Y
A Y 0 1 0
1 0 0
B B T2 T3
1 1 1
Two-input
diode AND Gate Two-input Truth Table
Transistor AND gate 14
Example: Determine the output from the AND gate in
Figure below for the given input waveforms.
Solution
1
A
0
1
B
0
1
Output
0
t0 t1 t2 t3 t4 t5 t6 t7
15
NOT OPERATION
The NOT operation is unlike the OR and AND
operation in that it can be performed on a
single input variable.
Example: If the variable A is subjected to the A Y= Ā
NOT operation, the result Y can be expressed
as
Y= Ā 0 1
Where the over bar represents the not
operation. 1 0
This expression is read as
‘’Y equals NOT A’’ or
‘’Y equals the inverse of A ‘’ or
‘’Y equals the complement of A’’.
All indicate that the logic value of Y= Ā is A
opposite to the logic value of A. Y=A
The truth table below clarifies this for the two Presence of small circle
cases
always denotes inversion
NOT Circuit (INVERTER)
Fig below, shows the symbol for a not circuit,
which is more commonly called an
INVERTER.
This circuit always has only a single input
and its output logic level is always opposite
to the logic level of this input.
16
Discrete NOT Gate
+5 V
R A Y
0 1
Y
1 0
A
T Truth Table
Transistor as Inverter
17
Summary of Boolean operation
The rules for the OR, AND, and NOT
operation may be summarized as follows:
OR AND NOT
0+0 = 0 0·0 = 0
0 1
0+1 = 1 0·1 = 0
1 0
1+0 = 1 1·0 = 0
1+1 = 1 1·1 = 1
18
Derived Logic Gates
NOR GATES & NAND GATES
Two other types of logic gates, NOR
gates and NAND gates, are used
extensively in digital circuitry.
These gates are derived from
combination of the basic AND, OR and
NOT gates, which make it relatively easy
to describe them using the Boolean
algebra operations learned previously.
19
NOR Gate
The NOR gate is actually a NOT OR gate. A
In other words, the output of an OR gate Y = A+B
B
is inverted to form a NOR gate.
Denotes
The logic symbol for the NOR gate is inversion
diagramed in fig (a).
Fig (a)
Note that the NOR symbol is an OR
symbol with a small invert bubble (small A
circle) on the right side
The NOR function is being performed by B
Y = A+B
an OR gate and an INVERTER in fig (b)
Fig (b)
The Boolean expression for the final
NOR function is Y = A + B . INPUTS OUTPUTS
The truth table in fig below shows that A B OR NOR
the NOR gate output is the exact inverse 0 0 0 1
of the OR gate output for all possible 1 0 1 0
0 1 1 0
input conditions. 1 1 1 0
The OR gate output goes HIGH when any Fig (c)
input is HIGH, while the NOR gate output Truth table for
goes LOW when any input is HIGH. 20
OR and NOR gates
Discrete NOR Gate
+5 V
A B Y
Y
0 0 1
A T1 T2 0 1 0
B
1 0 0
1 1 0
0 1 1
A Y
1 0 1
B
1 1 0
T
Truth Table
24
Universality of NAND Gates
A Y = A.A = A
INVERTER
A AB
Y = AB
B
AND
A
A
Y=A B
B
B OR
25
Universality of NOR Gates
Similarly, it can be shown that NOR gates can be arranged to implement
any of the Boolean operations. See fig. below
A Y = A+A= A
INVERTER
A AB
Y = A+B
B
OR
A
A
Y = A+B
B
B AND
26
XOR and XNOR Logic Circuits
Two special logic circuits that
occur quite often in digital
systems are the exclusive-OR and A AB
exclusive NOR circuits.
Exclusive OR
Consider the logic circuit of fig (a) . AB
The output expression of this circuit B Y = A B+ A B
is Y = AB + A B
The accompanying truth table
Fig. (a)
shows that x= 1 for two cases:
A= 0, B= 1 (the AB term) and
A= 1, B= 0 (the A B term). A B Y
In other words, this circuit produces
a HIGH output whenever the two
inputs are at opposite levels. 0 0 0
This is the exclusive OR circuit, 0 1 1
which will hereafter be abbreviated
XOR. 1 0 1
This particular combination of logic 1 1 0
gates occurs quite often and is very 27
useful in certain applications.
In fact, the XOR circuit has been given
a symbol of its own as shown in fig
below A
This XOR circuit is commonly referred
B
to as an XOR gate, and we consider it
as another type of logic gate. Y = A ⊕B = AB + A B
An XOR gate has only two inputs; there
are no three-input or four- input XOR
gates.
A short hand way that is sometimes
used to indicate the XOR output
expression is Y= AB.
Where, the symbol represents the
XOR gate operation.
The characteristics of an XOR gate are
summarized as follows:
1. It has only two inputs and its output is
Y = A B + A B = A ⊕B
2. Its output is HIGH only when the two 28
inputs are at different levels
Exclusive –NOR
The exclusive-NOR circuit AB
A
(Abbreviated XNOR) operates
B Y=A B+A B
completely opposite to the XOR
circuit.
The fig (a) drawn below, shows an
X-NOR circuit and its accompanying
AB
truth table.
The output expression is Y = A B + A B Fig.(a)
A. B is ORed with C C
A is ANDed with the term B+C
To avoid this confusion, it will be understood that if an (b) Logic circuit requires
expression contains both AND and OR operations the parenthesis
AND operations are performed first, unless there are
parentheses in the expression, in which case the
operation inside the parentheses is to be performed
first. 31
Try to write the expression to Figure (b)
EVALUATING LOGIC–CIRCUIT OUTPUTS
A
Once the Boolean expression for a circuit output has been ABC
A
B 1 Y ABC A D
obtained, the output logic level can be determined for C
The output logic level for given input levels can also be determined directly
from the circuit diagram without using the Boolean expression.
Technicians often use this technique during the troubleshooting or testing of
logic system since it also tells them what each gate output is supposed to be as
well as the final output.
1
A=0
1
B=1 1
C=1
2 Y=0
0
1 0
D=1
1
33
THANK YOU!!!
ANY Question???
34