Logic Gates Notes
Logic Gates Notes
LOGIC GATES
INTRODUCTION :
A logic gate is a digital circuit which is based on certain logical relationship between the input and the
output voltages of the circuit.
The logic gates are built using the semiconductor diodes and transistors.
Each logic gate is represented by its characteristic symbol.
The operation of a logic gate is indicated in a table, known as truth table. This table contains all possible
combinations of inputs and the corresponding outputs.
A logic gate is also represented by a Boolean algebraic expression. Boolean algebra is a method of
writing logical equations showing how an output depends upon the combination of inputs. Boolean algebra
was invented by George Boole.
BASIC LOGIC GATES
There are three basic logic gates. They are (1) OR gate (2) AND gate, and (3) NOT gate
The OR gate :- The output of an OR gate attains the state 1 if one or more inputs attain the state 1.
n
A
Y=A+B
Logic symbol of OR gate
.i
B
The Boolean expression of OR gate is Y = A + B, read as Y equals A 'OR' B.
n
A B
al Y
0 0 0
0 1 1
ur
Truth table of a two-input OR gate
1 0 1
1 1 1
o
The AND gate :- The output of an AND gate attains the state 1 if and only if all the inputs are in state 1.
uj
A
Input Y" Y
Logic symbol of AND gate
Ed
Output
B
A B Y
The Boolean expression of AND gate is Y = A.B
0 0 0
It is read as Y equals A 'AND' B
0 1 0
1 0 0
Truth table of a two-input AND gate 1 1 1
The NOT gate : The output of a NOT gate attains the state 1 if and only if the input does not attain the
state 1.
A Y
Logic symbol of NOT gate
A Y
Truth table of NOT gate 0 1
1 0
COMBINATION OF GATES :
The three basis gates (OR, AND and NOT) when connected in various combinations give us logic gates such as
NAND, NOR gates, which are the universal building blocks of digital circuits.
E 29
JEE-Physics
The NAND gate :
A
A B Y
0 0 1
0 1 1
Truth table of a NAND gate
1 0 1
1 1 0
The NOR gate :
A
Y
Logic symbol of NOR gate
B
n
0 0 1
0 1 0
.i
Truth table of a NOR gate
1 0 0
UNIVERSAL GATES :
n1 1al 0
The NAND or NOR gate is the universal building block of all digital circuits. Repeated use of NAND gates (or
ur
NOR gates) gives other gates. Therefore, any digital system can be achieved entirely from NAND or NOR
gates. We shall show how the repeated use of NAND (and NOR) gates will gives us different gates.
o
The NOT gate from a NAND gate :- When all the inputs of a NAND gate are connected together, as
uj
A B= (A) Y
A Y" A 0 0 1
1 1 0
The AND gate from a NAND gates :- If a NAND gate is followed by a NOT gate (i.e., a single input
NAND gate), the resulting circuit is an AND gate as shown in figure and truth table given show how an
AND gate has been obtained from NAND gates.
Truth table
A B Y' Y
A
0 0 1 0
Y 0 1 1 0
B 1 0 1 0
E:\Data\2014\Kota\JEE-Advanced\SMP\Phy\Electronics\Eng\2. Logic Gates.p65
1 1 0 1
The OR gate from NAND gates :- If we invert the inputs A and B and then apply them to the NAND
gate, the resulting circuit is an OR gate.
Truth table
A A B A B Y
A 0 0 1 1 0
Y 0 1 1 0 1
B 1 0 0 1 1
B
1 1 0 0 1
30
E
JEE-Physics
The NOT gate from NOR gates :- When all the inputs of a NOR gate are connected together as shown
in the figure, we obtain a NOT gate
A Y
The AND gate from NOR gates :- If we invert the inputs A and B and then apply them to the NOR
gate, the resulting circuit is an AND gate.
A
A
Y
B
B
The OR gate from NOR gate :- If a NOR gate is followed by a single input NOR gate (NOT gate), the
resulting circuit is an OR gate.
A
Y
n
B
.i
XOR AND XNOR GATES :
n al
The Exclusive - OR gate (XOR gate):- The output of a two-input XOR gate attains the state 1 if one
and only one input attains the state 1.
ur
A
Y
Logic symbol of XOR gate
o
B
uj
A B Y
0 0 0
0 1 1
Truth table of a XOR gate
1 0 1
1 1 0
Exclusive - NOR gate (XNOR gate):- The output is in state 1 when its both inputs are the same that is,
both 0 or both 1.
A
Y
E:\Data\2014\Kota\JEE-Advanced\SMP\Phy\Electronics\Eng\2. Logic Gates.p65
A B Y
0 0 1
0 1 0
Truth table of a XNOR gate
1 0 0
1 1 1
E 31
JEE-Physics
LAWS OF BOOLE AN ALGEBR A
OR AND NOT
A + 0 = A A. 0 = 0 A + A = 1
A + 1 = 1 A. 1 = A A. A =0
A + A = A A.A=A A .A=A
Boolean algebra obeys commutative, associative and distributive laws as given below :
Commutative laws :
n
A + B = B + A ;
.i
A.B = B.A
Associative laws :
n al
ur
A + (B + C) = (A + B) + C
o
A. (B . C) = (A. B) . C
uj
Distributive laws :
Ed
A. (B + C) = A.B + A.C
(i) A + AB = A (ii) A . (A + B) = A
De Morgan's theorem :
32
E
JEE-Physics
OR A Y = A + B A B Y D1
Y A A
0 0 0
B B Y
0 1 1
1 0 1 B R
1 1 1 D2
AND A
Y = A. B
A B Y A D
Y
Y"
0 0 0 Y
B A B
0 1 0
1 0 0 R
1 1 1 D2 CCC
n
NOT Y = A VCC
.i
or A Y A Y
RC
Inverter
n 0
1
al
1
0
A A
RB Y
ur
NOR A Y A B VCC
Y A B Y D1
A RC
o
(OR +NOT)
B 0 0 1 Y
RB
0 1 0
uj
A B
1 0 0 B
R1
1 1 0
Ed
D2
A
NAND Y Y A.B VCC
Y" A B Y D1
(AND+NOT) A
B 0 0 1 Y
A RB
0 1 1
1 0 1 B
B
1 1 0 R1
D2 VCC
A A B Y
Y
XOR Y A B 0 0 0
E:\Data\2014\Kota\JEE-Advanced\SMP\Phy\Electronics\Eng\2. Logic Gates.p65
B
0 1 1
(Exclusive or
1 0 1
OR) Y A.B AB 1 1 0
XNOR Y=AB
A
(Exclusive Y or A B Y
B 0 0 1
NOR) Y A.B A.B
0 1 0
or 1 0 0
Y A B 1 1 1
E 33
JEE-Physics
NUMBER SYSTEMS
Decimal Number system
The base of this system is 10 and in this system 10 numbers [0,1,2,3,4,5,6,7,8,9] are used.
Ex. 1396, 210.75 are decimal numbers.
Binary Number System
The base of this system is 2 and in this system 2 numbers (0 and 1) are used.
Ex. 1001, 1101.011 are Binary numbers.
Binary to decimal conversion
We can write any decimal number in following form
2365.75 = 2000 + 300 + 60 + 5 + 0.7 + 0.05
1 1
= 2 × 1000 + 3 × 100 + 6 × 10 + 5 × 1 + 7 × +5×
10 100
3 2 1 0
= 2 × 10 + 3 × 10 + 6 × 10 + 5× 10 +7 × 10 + 5 × 10 –2
–1
1 1
n
= 1 × 16 + 0 × 8 + 1 × 4 + 0 × 2 + 1 × 1 + 1 × + 1 ×
2 4
.i
1 1
= 16 + 4 + 1 +
2
+
4
n = 21.75 al
E x . 1 Conver t bi nar y number 1011.01 i nto decimal number.
ur
1011.01= 1 × 2 3 + 0 × 2 2 + 1 × 2 1 + 1 × 2 0 + 0 × 2 –1 + 1 × 2 –2
1
o
= 8 + 2 + 1 + = 11.25
4
uj
1 1
= 64 + 4 + 1 + + = 69 + 0.5 + 0.125 = 69.625
2 8
Question for Practise : Convert the following binary numbers into decimal numbers –
(a) 101 (b) 110.001 (c) 11111 (d) 1011.11
Ans. : (a) 5 (b) 6.125 (c) 31 (d) 11.75
34
E