Unit 2 Logic Gates
Unit 2 Logic Gates
Logic Gates
Introduction
In the computers, these Boolean operations are performed by logic gates.
An Inverter is a gate with only one input signal and one output
signal; the output state is always the opposite of the input state.
X X
X X
X X
0 1
Low High
1 0
High Low
A low input i.e., 0 produces high output i.e., 1 and vice versa. NOT operation
is symbolized as or i.e., NOT X is written as X1 or X.
OR Gate
The OR gate has two or more input signals but only one output signal. If any of
the input signals is 1 (high), the output signal is 1 (high). The output is 0(low)
when all inputs are 0(low).
A A A
F B F B F
B C C
D
X Y F=X.Y X Y Z F=X.Y.Z
0 0 0 0 0 0 0
0 0 1 0
0 1 0 0 1 0 0
1 0 0 0 1 1 0
1 0 0 0
1 1 1 1 0 1 0
Table 3.5: 2- input AND gate 1 1 0 0
1 1 1 1
A A A
F B F B
B F
C
C D
The NOR gate has two or more input signals but only one output signal. If all the
inputs are 0 (low), then the output signal is 1 (high). If anyone of the input is
1(high), then the output is 0(low).
X Y F = X+Y
0 0 1
X Y Z F=X+Y+Z
0 1 0
0 0 0 1
1 0 0
0 0 1 0
1 1 0 0 1 0 0
Table 3.7: 2-input NOR gate 0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
Table 3.8: 3-input NOR gate 1 1 1 0
(a)
In Boolean algebra, sign stands for XOR operation. Thus, A XOR B can
Mr. Guruprasad T R, Faculty, Dept. Of CS Page 4
Logic gates
be written as AB.
Following Truth Tables (2.11 and 2.12) illustrates XOR operation.
The bubble (small circle), on the output of NAND, NOR, XNOR gates
represents complementation.
The expression representing XNOR may be written as
F = (X+Y) . (X+Y)
The XNOR operation is symbolized as i.e. X NOR Y is written as XY.
Circuit diagrams
Boolean algebra is useless unless it can be translated into hardware, in
the form of gates. This translation of Boolean algebra in the gates’ form is known
as logic circuits.
Example 2.1: Design a circuit to realize the following:
F(A, B, C) = AB + AC + BAC
Solution: The given Boolean expression can also be written as follows
F(A, B, C) = A . B + A . C + B . A . C
or F(A, B, C) = (A AND B) OR (A AND (NOT C)) OR ((NOT B) AND (NOT A) AND C)
Example 2.2 Draw the diagram of digital circuit for the function:
F(X, Y, Z) = (X + Y) . (X + Z) . (Y + Z)
Solution: Above expression can also be written as
F(X, Y, Z) = (X OR Y) AND ((NOT X) OR (NOT Z)) AND (Y OR Z)
Thus circuit diagram will be
X X+Y
Y
X X+Z F
Z
(X+Y).(X+Z).(Y+Z)
Y Y+Z
Z
Example 3 : AB+BC(B+C)
NAND–to-NOT logic
Not Operation
X X
NOT X = X NAND X
= X.X {De Morgan's Second Theorem}
=X+X {De Morgan's Second Theorem}
=X
NAND–to-AND logic
AND and OR operations from NAND gates are shown below:
AND operation
X.Y XY
X+Y
Y
Y.Y
A A
A
B
A.B
B
NOR as OR Gate
The OR is replaced by a NOR gate with its output complemented by a NOR gate inverter.
The X-OR gate is replaced by a NOR gate with all its inputs complemented by NOR gate inverter