Professional Documents
Culture Documents
LOGIC GATES
LOGIC GATES:
A Logic gate is an electronic circuit, which makes logic decisions. It has only one output and
one or more inputs. A logic gate gives an output only when certain input combinations are satisfied
depending on the type of gate. There are three basic gates AND, OR and NOT.
AND Gate: The output of AND gate is high when all the inputs are HIGH otherwise it is LOW.
Truth table
Inputs Output
A B Y = A .B
A Y = A.B
0 0 0 B
0 1 0
1 0 0 Logic symbol of AND gate
1 1 1
OR Gate: The output of OR is HIGH when any one of the input is HIGH otherwise it is LOW.
Truth table
Inputs Output
A B Y=A+B
A Y=A+B
0 0 0
B
0 1 1
Logic symbol of OR gate
1 0 1
1 1 1
NOT Gate: A NOT gate is the only gate which has one input and one output. The output of NOT
gate is complement of the input. It is also called an inverter. The output is HIGH when the input is
LOW and the output is LOW when the input is HIGH.
Input Output Y = A
A Y =A
0 1
1 0
A B Y = A .B
0 0 1
1 0 1
0 1 1
1 1 0
A Y=A +B
A A+B Y =A + B
B
B
Logic symbol of NOR gate
Truth table
Inputs Output
A B Y = A+B
0 0 1
1 0 0
0 1 0
1 1 0
Demorgan's Theorem
1. "The complement of sum equal to the product of the complements". It is expressed as
A + B = A .B
NOR gate
Bubbled AND Gate
A .B = A +B
De Morgan's second theorem tells us that a NAND gate is logically equivalent to a BUBBLED OR
gate and they are interchangeable.
A AB
B AB + A B
A Y = A B
B
AΒ
A B = AB + A B
As a Boolean equivalency, this rule may be helpful in simplifying some Boolean expressions. Any
expression following the A B +A B form (two AND gates and an OR gate) may be replaced by a
single Exclusive-OR gate.
A B A Y = AB + A B = A B
A Y = A B
B
B Logic Symbol of X-NOR gate
The output of XOR gate is given by Y = A B. An XNOR function is just the reverse of XOR
1 0 + 0 .1 = 0 = 1.
When either of the inputs are 1 (either A = 0, B = 1 or A = 1; B = 0) the output Y=
0 . 1 + 0 .1 = 1 1 + 0 . 0 = 1 = 0.
A B Y= A B
0 0 1
0 1 0
1 0 0
1 1 1
__________
________ ________
Y= A B = AB + AB = AB . AB
= (A+ B ). ( A +B)
= AB + A.B
NAND and NOR gates possess a special property: they are universal. That is, given enough gates,
either type of gate is able to mimic the operation of any other gate type. For example, it is possible
to build a circuit exhibiting the OR functions using three interconnected NAND gates. The ability for
a single gate type to be able to mimic any other gate type is one enjoyed only by the NAND and
the NOR. In fact, digital control systems have been designed using either NAND or NOR gates, all
the necessary logic functions being derived from collections of interconnected NAND or NOR. As
proof of this property, this section will be divided into subsections showing how all the basic gate
types may be formed using only NAND or only NOR.
Y =A
Input A Output Y = A
A
0 1
1 0
b) NAND as AND gate
The output of a NAND gate is A .B by complementing this using NOT gate at the output, we
get AND gate whose output is given by Y = A.B which is the logic function a normal AND gate.
This is as shown in the figure.
Inputs Output
A B Y = A.B
A A.B Y =A . B =A.B 0 0 0
B 0 1 0
1 0 0
1 1 1
single input NAND gates acting as inverters are used. The output in this case is A .B . This can
be proved to be equal to A + B, using De-Morgan’s theorem-a most powerful theorem of
Y =A . B =A+B 0 0 0
0 1 1
B
B
1 0 1
1 1 1
A.AB
2
AB
A Y = A.AB. B. AB
1 4
B
3
B.AB
Y = A.AB B.AB.
= A.AB + B.AB
Y = (A. AB ) + (B. AB )
Y = AB (A + B)
Y = ( A + B ) (A + B)
Y = A A + A B + AB + B B
Y = A B + A B = A B XOR gate.
A A AB
Y = A.AB.B.AB 2
AB
A, AB B, AB
AB A, AB B, AB
Y = A AB. B.AB A
B
1 4
Y= ( A +AB) ( B + AB) AB
3
B B AB
Y= AB + A B
Y = A B XNOR gate
b) NOR as OR gate
The output of NOR gate is A + B . By complementing the output of NOR gate with the help of
NOT gate, we get OR operation. This is illustrated in the figure
Inputs Output
A B Y=A+B
A A+ B Y=A+ B = A+ B 0 0 0
B 0 1 1
1 0 1
1 1 1
single input NOR gates are used. The output in this case is A + B . This can be shown to be
equal to A.B using De Morgans theorem, i.e., A + B = A.B which is AND operation. This is as
shown in figure.
Inputs Output
A
A A B Y = A.B
Y = A +B = A + B 0 0 0
0 1 0
B
B 1 0 0
1 1 1
A A + A +B
A +B
A
Y = ( A + ( A + B)) + (B + ( A + B))
B
A +B
B + A +B
B
Y=
( A + ( A + B) + B + ( A + B )
Y = A + ( A + B) . B + ( A + B)
Y = [ A + ( A + B )].[B + ( A + B) ]
Y = (A + AB ).(B + AB )
Y = A B XNOR gate
A +B
A + A +B +B + A +B
A
Y=
A + A +B +B + A +B
B
A +B
B B+ A +B
Y=
A + A +B+B+ A +B
Y = A + A +B+B+ A +B
Y = A .(A + B) + B .(A + B)
Y = A A + A B + AB + B B
Y = A B + AB
Y = A B = XOR gate
̅̅̅̅̅
̿̿̿̿̿ ̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿ ̅̅̅̅̅
X. X= ̅
X
X. Y = X.Y ̅̅̅̅̅̅
(X. X) ̅̅̅̅̅̅̅̅̅
. ( Y. Y) = ̅̅̅̅̅
X. Y = X+Y
̅̅̅̅̅
X. X= ̅
X
̅̅̅̅̅̅̅
a + b = ̅̅̅̅̅̅̅
̿̿̿̿̿̿̿ a̅ + b̅ = a.b
̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿
̅̅̅̅̅̅̅̅ +( b + b) = ̅̅̅̅̅̅̅
(a + a) ̅̅̅̅̅̅̅̅̅̅̅̅ a̅ + b̅ = a.b
QUESTION BANK
PART – A
One mark questions
1 What is a logic gate?
A gate is simply an electronic circuit which operate on one or more input signals to produce an
output signal.
2 What is truth table?
A truth table is a table which represents all the possible values of logical variables/statements along
with all the possible results of the given combination of values.
A ̅
A
0 1
1 0
5 Which gate is called as inverter?
NOT gate is called inverter
6 Define AND gate.
When all the input signals are 1 (high), the output is 1 (high), otherwise the output is0.
7 Write the standard symbol for AND gate.
8 Define OR gate.
A A+B
B
NAND gate is a logic gate which has two or more inputs and one output that performs
complement of AND operation. Its output is low if and only if all its inputs are high and its output is
High If any one of its input is low.
20 Write the standard symbol for NAND gate
25 For the truth table given below, what type of logic gate does the output F represent?
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
NAND gate
XOR gate.
27 For the truth table given below, what type of logic gate does the output X represent?
X Y F
0 0 0
0 1 1
1 0 1
1 1 1
OR gate.
28 For the truth table given below, what type of logic gate does the output X represent?
X Y F
0 0 0
0 1 0
1 0 0
1 1 1
AND gate
For the truth table given below, what type of logic gate does the output X represent?
X Y F
29 0 0 1
0 1 0
1 0 0
1 1 0
NOR gate.
PART – B
Two marks questions
1 Mention the types of logic gates.
Basic gates : AND, OR, NOT
Derived gates : XOR, NAND, NOR, XNOR
2 Mention the Basic logic gates.
Basic gates : AND, OR, NOT
3 Which gates are called universal gates and why?
NAND and NOR gates are called universal gates. Using these gates any basic gates can be designed.
4 Mention the derived gates.
XOR, NAND, NOR, XNOR
5 Mention different universal gates.
NAND, NOR
A A ̅
𝐀
A
0 1
1 0
7 Write the standard symbol and truth table for AND gate.
X Y F
0 0 0
0 1 0
1 0 0
1 1 1
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
12 Write the standard symbol and truth table for NAND gate.
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
13 Write the standard symbol and truth table for XOR gate.
X Y F
0 0 0
0 1 1
1 0 1
1 1 0
14 Write the standard symbol and truth table for XNOR gate.
A B C X
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
4 Explain OR gate.
A OR gate has two or more input signal but only one output signal.
If any of the input signals is 1 (high), then the output is 1(high).
5 Write the truth table three input variable using OR gate.
A B C A+B+C
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
6 Explain NOR gate.
A NOR gate has two or more input signal but only one output signal. The NOR gate is a
complemented of OR gate. The output of NOR gate will be 1 only when all inputs are 0 and output
will be 0 if any input represents a1.
7 Write the truth table three input variable using NOR gate.
A B C ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝐀+ 𝐁 + 𝐂
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
9 Write the truth table for three input variable using NAND gate.
A B C X
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 0
An exclusive-OR has two or more input signal but only one output signal. Exclusive-OR gate is
different form of OR gate. Exclusive-OR gate produces output 1 for only those input combinations
that have odd number of1’s. The output is 0 if there are even number of 1’s in the input. The output
is 1 if there are odd number of 1’s in the input.
11 Write the truth table three input variable using XOR gate.
A B C X
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
12 Explain XNOR gate.
The XNOR gate is complement of XOR gate. The output of XNOR is 1 only when the logic values of
both X and Y is same i.e. either both are equal to 1 or both are0. Its output is 0 when its inputs are
different.
13 Write the truth table three input variable using XNOR gate.
A B C X
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
14 Mention the design rules of NAND-to-NAND logic network.
PART – D
Five marks questions
1 Explain any two basic gates with example and truth table.
OR, AND and NOT are the basic gates.
OR gate
A OR gate has two or more input signal but only one output signal.
If any of the input signals is 1 (high), then the output is 1(high).
X Y F
0 0 0
0 1 1
1 0 1
1 1 1
AND gate
When all the input signals are 1 (high), the output is 1 (high), otherwise the output is0.
X Y F
0 0 0
0 1 0
1 0 0
1 1 1
2 Explain any two derived gates with truth table.
NAND, NOR, XOR, XNOR are the derived gates.
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
NAND gate is a logic gate which has two or more inputs and one output that performs
complement of AND operation. Its output is low if and only if all its. Inputs are high and its output
is high if anyone of its input is low.
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
3 Explain universal gates with truth table.
NAND, NOR are the universal gates. Using these gates any other basic gates.
NOR gate is a logic gate which has two or more inputs and one output that performs complement of
OR operation. Its output is high if and only if all its inputs are low and its output is low if any one of
its input is high.
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
NAND gate is a logic gate which has two or more inputs and one output that performs
complement of AND operation. Its output is low if and only if all its inputs are high and its output is
high if anyone of its input is low.
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
4 Explain logical AND gate, logical OR gate.
X Y F
0 0 0
0 1 1
1 0 1
1 1 1
AND gate
When all the input signals are 1 (high), the output is 1 (high), otherwise the output is0.
X Y F
0 0 0
0 1 0
1 0 0
1 1 1
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
NAND gate is a logic gate which has two or more inputs and one output that performs
complement of AND operation. Its output is low if and only if all its inputs are high and its output is
high if anyone of its input is low.
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
An XOR/exclusive-OR has two or more input signal but only one output signal. Exclusive-OR gate is
different form of OR gate. Exclusive-OR gate produces output 1 for only those input combinations
that have odd number of1’s. The output is 0 if there are even number of 1’s in the input. The output
is 1 if there are odd number of 1’s in the input.
The XNOR gate is complement of XOR gate. The output of XNOR is 1 only when the logic values of
both X and Y is same i.e. either both are equal to 1 or both are0. Its output is 0 when its inputs are
different.
NAND as OR
NAND as AND NAND as NOT
̅̅̅̅̅ ̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿
̅̅̅̅̅̅
(X. X) ̅̅̅̅̅̅̅̅̅
. ( Y. Y) = ̅̅̅̅̅
X. Y =
̿̿̿̿̿
X. Y = X.Y ̅̅̅̅̅ ̅
X. X= X
X+Y
9 Realize logical NOT gate and logical AND gate using NAND gate.
̅̅̅̅̅
̿̿̿̿̿ ̅̅̅̅̅
X. Y = X.Y X. X= ̅
X
10 Design to implement logical OR gate and logical AND gate using NOR logical gate.
̅̅̅̅̅̅̅
a + b = ̅̅̅̅̅̅̅
̿̿̿̿̿̿̿ a̅ + b̅ = a.b
̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿̿
̅̅̅̅̅̅̅̅ +( b + b) = ̅̅̅̅̅̅̅
(a + a) ̅̅̅̅̅̅̅̅̅̅̅̅ a̅ + b̅ = a.b
Practice Problems
1 ̅C + B
Design a circuit to realize the following: F(A, B, C) = AB + A ̅A̅C
2 Draw the diagram of digital circuit for the function: F(X, Y, Z) = (X + Y)(X + Z̅)(Y
̅ + Z)
3 Draw the diagram of a digital circuit for: F(A, B, C, D) = AB + BC + CD using NAND-to-NAND logic.
4 ̅C + C̅B using NAND-to-NAND logic only.
Draw the circuit diagram for F = AB
5 Draw the diagram of digital circuit for the function F(X, Y, Z) = YZ + XZ using NAND gates only.
6 Draw the diagram of a digital circuit for the following function
̅ ̅YZ
a) XYZ + XZ + X b) AB + AC̅+ B
̅A̅C