Logic Gates
Logic Gates
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.
A
Y=A+B
Logic symbol of OR gate
B
The Boolean expression of OR gate is Y = A + B, read as Y equals A 'OR' B.
A B Y
0 0 0
0 1 1
Truth table of a two-input OR gate
1 0 1
1 1 1
The AND gate :- The output of an AND gate attains the state 1 if and only if all the inputs are in state 1.
A
Input Y" Y
Logic symbol of AND gate 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 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
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
Head Office : Pushpanjali Place, Boring Road, Patna, Mob. : 8102926611,12,13
IITian’s TAPASYA
Branch Office : Rukanpura Flyover, Near Sri Sai Yamaha, Bailey Road, Patna-14, Mob. : 7677222110
[32]
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
B
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.
A
Y
Logic symbol of XOR gate
B
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
Logic symbol of XNOR gate
B
A B Y
0 0 1
0 1 0
Truth table of a XNOR gate
1 0 0
1 1 1
OR AND NOT
A+0=A A. 0 = 0 A+ A =1
A+1=1 A. 1 = A A. A =0
Boolean algebra obeys commutative, associative and distributive laws as given below :
Commutative laws :
A+B=B+A;
A.B = B.A
Associative laws :
A + (B + C) = (A + B) + C
A. (B . C) = (A. B) . C
Distributive laws :
A. (B + C) = A.B + A.C
(i) A + AB = A (ii) A . (A + B) = A
De Morgan's theorem :
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
NOT Y= A VCC
or A Y A Y
RC
Inverter 0 1 RB Y
A A
1 0
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 AB 0 0 0
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 AB 1 1 1
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
= 2 × 10 + 3 × 10 + 6 × 10 + 5× 10 +7 × 10 + 5 × 10 –2
3 2 1 0 –1
1 1
= 1 × 16 + 0 × 8 + 1 × 4 + 0 × 2 + 1 × 1 + 1 × + 1 ×
2 4
1 1
= 16 + 4 + 1 + + = 21.75
2 4
Ex.1 Convert binary number 1011.01 into decimal number.
1011.01= 1 × 23 + 0 × 22 + 1 × 21 + 1 × 20 + 0 × 2–1 + 1 × 2–2
1
= 8 + 2 + 1 + = 11.25
4
Ex.2 Convert binary number 1000101.101 into decimal number.
1000101.101 1× 26+0× 25+0× 24+0× 23+1× 22+0× 21+1× 20+1× 2–1+0× 2–2+1× 2–3
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