Chapter 3 Logic Gates and Boolean Algebra
Chapter 3 Logic Gates and Boolean Algebra
Chapter
3
LogicGates and
Boolean Algebra
Syllabus
Digital logic gates, Universal gates, Realization using NAND and NOR gates, Boolean algebra,
De-Morgan's theorems.
Chapter Contents
3.1 Introduction 3.7 Logic Gaes
3.8 NOT Gate or Inverter
3.2 Basic Definitions of Boolean Algebra
Axiomatic Definition of Boolean Algebra 3.9 AND Gate
3.3
Two Valued Boolean Algebra 3.10 The OR Gate
3.4
3.11 Special Type of Gates or Derived Gates
3.5 Basic Theorems and Properties of Boolean
Algebra
3.12 Universal Gates
3.6 Boolean Expression and Boolean Function
LogicGatesand
...Logical multiplication
DSD (Sem. II / E&Tc / MU) 3-2
not used and
A -B dot is We
Sometimesthis and Bas AB
multiplicationof A
3.1 Introduction : However
logical
denotethe
In the decimal system which is used in our day-to Operator:
addition, OR HIGH(1) output when
day life, the arithmetic operations such as 3.1.4 producesa logic circuit
OR-operation
subtraction, multiplication, division, square, square The the
of a
inputs
equations. or all
root etc. are used tosolve arithmetic one
any
George Boole logical addition. It i
In 1850s, the Irish mathematician HIGH(1). represents
formulating
developed a mathematical system for The "OR"
operator between thetwo variables to
so that problems can (+) sígn
logic statements with symbols denoted by a
manner similar to ordinary
be written and solved in a beadded. circuitthen it is
addedin a logic
algebra. B are to be
algebra and it is extremely If A and
This is called Boolean systems. representedas, ...Logicaladdition
of digital
useful in the design and analysis the A+ B
Boolean algebra is used to write or simplify "A OR B".
read as
logical expressions. Andit is to be
If *and are two binary operators working ona set S, 2. Arithmetic operations (addition, subtraction, divis
then * is said to be distributive over if the following etc.) are not performed in boolean algebra. A
condition is satisfied. there are no fractions, negative numbers, Squa
A * (B C) = (A*B)· (A *C) ..3.2.4) square root, logarithms, imaginary numbers etc.
Conclusions : 3 Third and most important point is Boolean alge
Field is an example of an algebraic structure. It is a allows only two possible values ("0" to "1") for
set of elements along with binary operators. variable.
TechKnoule
DSD (Sem. II/E&Tc/ MU)
3-5 Logic Gates and Boolean Algebra
Rules in boolean algebra :
2(b) An identity element with respect to (), designated
There are some rules to be
followed while using a by 1 :
Boolean algebra, these are:
This is because for anyAthe following expression is
1 Variables used can have only two values. Binary 1 for
HIGH and Binary 0 for LOW. always true.
A1 = 1" A = A.
2 Complement of a variable is
Overbar (). Thus complement represented
by a
of variable B is 3(a) Commutative law with respect to' (+):
represented as B. Thus if B = 0 then B = 1 and if A+B = B+ A
B = 1then B = 0. 3(b) Commutative law with respect to ():
3 ORing of the variables is A-B = B"A
sign between them. For represented
by a plus (+)
example ORing of A, B, C is 4(a) (-) is distributed over (+):
represented as A + B + c.
A "(B + C) = (A B) + (A "C)
A Logical ANDing of the two or more variables is
represented by writing a dot between them such as 4(b) (+) is distributed over ():
A.BC.D E. Sometimes the dot may be omitted A + (B -C) = (A + B)· (A + C)
like ABCDE.
5 For every binary element A, there exists an element
33.1 Boolean Postulates and Laws : called complement of A (it is denoted by A) such
MU : Dec. 06, Dec. 07, May 15 that,
University Questions A + A = l and A-
Q. 1 Explain laws of boolean algebra.
Note that if A= 0then A= 1 and if A= 1 then Ã
= 0.
(Dec. 06, Dec. 07, 5 Marks) 6. In a set of binary elements, there always exist atleast
0.2 State and prove laws of Boolean algebra.
two elements A and B such that A + B. If A = 0 then
(May 15, 10 Marks) B= 1 and vice versa.
Boolean algebra is an algebraic structure, which is
3.3.2 Differences between Boolean and
defined by a set of elements and two binary
operators namely (+) and () if and only if it satisfies Ordinary Algebra :
the postulates given below: If we compare Boolean algebra with arithmetic and
1(a) Closure with respect to operator (+) : conventional algebra in the field of real numbers,
When operator (+) ie. OR is used over two binary then the following differences are observed:
elements in agiven set, it produces a unique binary 1. The Huntington's postulates do not include the
element e.g. 1+0 =1,0 +0 = 0. associative law. But this law is applicable to Boolear
1(b) Closure with respect to operator () : algebra and it can be derived for both the operator
When operator ) i.e. AND is used over two binary (+ and -) from the other postulates.
elements in a given set, it produces a unique binary 2. The following distributive law of + over is valid fo
element e.g. 1·0 = 0, 1·1=1 etc. the Boolean algebra. But it is not valid for ordina
2(a) An identity element with respect to (+), designated algebra.
by 0: A+ (B C) = (A + B)· (B + C)
This is because for any A, the following expression is 3. In Boolean algebra, there are no
always true.
subtraction
division operations in Boolean algebra. These
A +0 = 0+A= A present for ordinary algebra.
TechKnowl
Publicat
Gates and Booleah
DSD (Sem. II / E&Tc / MU)
3-6
Logic
operator
Agebra
3.4.1(c) :NOT
4 Table
The operator caled Complement is present for the Input
Output
Boolean algebra. But it is not available for the
A
ordinary algebra. 1
1
(C-6135)Table 3.4.2 : Verification of the commutative law
loloE
1 Inputs
Llolo A B BA A+ B B+ A
A B
1 1 0
A B A +B
A B= B"A A+ B=B+A
0
4. The distributive law:
1 1
(a) The distributive law of A · (B +
1 C) = (A B) + (A C
can be proved by using the truth
1 1 tables as shoW
below.
DSD (Sern. III /EE&Tc/ MU)
3-7
Logic Gates and Boolean Algebra
staternent i.e.
(C-6136) Table 3.4.3: Verification of the distributive law Similarly we can verify the other
Inputs
B+C A-(B+C) AB AC AB + AC
A + (B + ) = (A + B) + C
B C
of
Basic Theorems and Properties
A
3.5
1
3.5.1 Duality :
1 1 following
According to the duality theorern the
1
1 1 1
Boolean
1 1 conversions are possible in a given
A (B+ C) = AB + AC expression:
operation.
(b) The distributive law of + over " can also be proved 1. Change each AND operation to an OR
AND operation.
using the truth tables in the similar way. 2 Change each OR operation to an
expression.
Inverse: 3. Complernent any 1 or 0 appearing in the
5. creating new
Erorm Table 3.4.1(b) it is easily seen that, Duality theorem is sometimes useful in
expressions.
expressions from the given Boolean
A+ =1 ie. 0 +1= 1and 1 +0 =1 A + 1 = 1then
For example if the given expression is
Andfrorm Table 3.4.1(a) it can be shown that, operation
replace the OR (+) operation by AND()
the dual of the
A A =0 ie. 0.1=0 and 1.0 = 0 and take complement of1 to write
This verifies postulate 5. given relation as,
A0 = 0
Postulate 6 says that there exists at least two
elements A and B such that A # B. As Boolean The dual of A (B + C) = AB + AC is given by,
algebra has two distinct elements 0 and 1 (A and B), A+ (B "C) = (A + B) · (A + )
this postulate is getting satisfied because
constructing
0+1(A B). It is possible to verify this theorem by
truth tables for both the sides of equations.
7. Ass0ciative Law: MU: Dec. 16
3.5.2 Basic Theorems:
This law states that the order in which the logic
University Questions
operations are performed is not important because
Q. 1 State basic theorems of Boolean algebra.
for any order the effect is the same.
(Dec. 16, 5 Marks)
i.e. (A B) C = A" (B -C)
And (A +B) + C = A+ (B + C) 1 AND Laws :
These laws are related to the AND operation
The associative laww can be verified by referring to the
following truth table. therefore they are called as "AND" laws. The AND
laws are as follows :
(C6137) Table 3.44 : Verification of the associative law
1. A
.0= 0:
Inputs B-C A(B C) AB A B)C
ABC That means if one input of an AND operation is
1
permanently kept at the LOW (0) level, then the
1 output is zero irrespective of the other variable.
1 1 1
1 2 A1=A:
1 1
That means if one input of an AND operation is
1
1
11 1
HIGH (1) permanently then the output is always
A (B C) =(A· B)· C equal to the other variable.
Tech Kaswkedge
PubiIt ations
Logic Gates and Boolean Algebr
ie
DSD (Sem. IlII/ E&Tc/ MU) 3-8 the input
equal to
will be
Output also
So if A= 0, then Y= 0"1=0ie. Y= Aand if A= 1, the and for
respectively. i.e. Y= A
then Y=1·1=1 so Y= A. + 0=
0
A = 0. Y = 0
For A.
3.A A=A: 1ie. Y =
Y= 1+1 -
That means if both the inputs in an AND operation A+ "OR"
have the same value either "0" or "1" then the output 4. the result of an
states that complementis alwayS
operatio
will also have the same value as that of the input. This law
variable andits =1
(HIGH),
AÅ=0:
on a
and Y=0 + 1 whereas
4
then A = 1
If A = 0 =1+0=1,
This law states that the result of an "AND" operation and Y
=1 then A= 0
A
on avariable (A) and its complement (A) is
always
Summary of OR Laws:
LOW (0). 3. A+A = A
1. A+ 0= A
whereas if A= 1 A+A = 1
If A=0 then A = land Y = 01=0 4
2. A+1 =1
then A=0 and Y=1·0=0.
INVERSION Law :
Summary of AND Laws:
3
operation. The inversion I
This law uses the "NOT" a douhl
1. A"0 =0 3 A"A =A if a variable is subjected to
states that variah.
it will result in the original
2 A"1=A 4. A -A = 0 inversion then
itself i.e.
2 OR Laws :
they are
These laws use the OR operation. Therefore A
called as OR laws. The OR laws are as follows:
illustrated in Fig. 3.5.1 whick
Inversion law is being
(A) = 0..yY =A
1. A+0= A: shows that if A= 0then A = 1and
That means if one variable of, an "OR" operation is and (Ä) =1
whereas if A=1 then A = 0
LOW (0) permanently, then the output is always .. Y = A.
equal to the other variable. A=0
A=0 Y=(A) =0 A=1 =° Y=(A) =1
B=0 permanently therefore for A= 0, Y= 0 + 0= 0
i.e. Y= Aand for A= 1,Y= 1+0=1 i.e. Y= A.
(B-481) Fig. 3.5.1: 1Ilustration of inversion law :A = A
2 A+1=1: Table 3.5.1: Collection of Boolean laws
That means if one variable of an "OR" operation is Sr.
HiGH (1) permanently, then the output is HIGH (1) Name Statementofthe aw
No.
permanently irrespective of the value of the other
1. Commutative Law A-B=BA
variable.
A+B= B+A
Here B = 1 permanently, so if A = 0 then
2. Associative Law (A-B)· C=A" (B C)
Y=0 + 1 = 1 and if A= 1then Y= 1 +1= 1.
(A+ B) +C=A+ (B+C)
Thus output rernains HIGH (1) always, irrespective of
the value of A.
3. Distributive Law A (B+ C)= AB + AC
A AND Laws A0= 0
3 A+A=A: A"1=A
operation have the same value either "0" or "1" then A=0
TechKnouled
Algebra
DSD (Sem. III /E E&Tc / MU) Logic Gates and Boolean
3-9
table
verified by writing a truth
This theorem can be
Sr. Name Statement of the law as shown in Fig. 3.5.3.
NO.
OR Laws AB A A+ B
A +0 = A A B
A+1= 1
<oo- 1 1 1
1 1
A+A = A 1 1
1
A+A =1
Inversion Law A =A
LHS AB= A+B RHS
6
=A + B
Verification of the theorem AB
Other Important A + BC = (A+ B) (A + C) (C-6138) Fig. 3.5.3 :
7
Laws NOR= Bubbled AND:
A+ AB =A+B Theorem 2: A+B =A "B:
of
in Fig. 3.5.4. The LHS
A + AB =Á+B This theorem is illustrated
NOR gate with inputs A
A + AB=A this theorem represents a
represents an AND gate with
and B whereas the RHS
A+AB = A + B
inverted inputs.
Thus
De-Morgan's Theorems : called as "Bubbled AND",
35.3
X
MU: Dec. 15, May 16, May 18, May 19
Such an AND gate is
we can state
De-Morgan's second theorem as a
NOR
of
inputs A and B whereas the Right Hand Side (RHS)
1
1 1
inverted
the theorem represents an OR gate with 1 1
inputs.
Thus we LHS A+ B=AB RHS
Such an OR gate is called as "Bubbled OR".
can state De-Morgan's first theorem
as a NAND (C-6139) Fig. 3.5.5: Truth table to verify De-Morgan's
theorem
operation isequivalent to abubbled OR operation.
NAND = Bubbled OR 3.6 Boolean Expression and Boolea
Function :
Y= A+B
Y= AB A
B Boolean algebra deals with binary variables and l
NAND
Bubbled OR
operations. A Boolean function is described by
theorem algebraic expression called Boolean expression w
(B-482) Fig. 3.5.2 : Ilustration of De-Morgan'sfirst
Tech Knoul
Publicat
Logic Gates and Boolean Algeb
Soln.:
AB = +B
But
...De-Morgan's first theorem
F = A + BD + DCA+ AC
BD.6
= A + AC + BD + DCA y = AD. CD +
BDCD
= A (1 + ) + BD + DA .
y = (A + D)CD +
= A + DC + BD [1 +C= 1] = (A+ D) CD + BCD
1]
[since (C+ 1) = 1 and (B + 1) = 1] ..." D + D =1and B+ B =
= ABC+ AB + ABC + AC = A(BC + CD)
AB + BC+
= C(A + AB) + B (AC + A) Ex, 3.6.5: Using Boolean algebra prove that
= C(A + B) + B (A + C) AC= AB + AC.
Marks
Dec. 08, 4 Marks, Dec. 17, 10
= AC + BC + AB + BC Soln. :
= AB + BC + AC 1. AB + BC + ÁC = AB + AC
TechKnowlede
nsp (Sem. III /E&Tc / MU)
3-13 Logic Gates and Boolean Algebra
On the same lines we can
derive the De Morgan's We have to use different laws,
rules and theorems to
theorems for any
number
of
variables. These
theorenms in the analyze the digital circuits.
generalized form can be stated as
follows : mentioned earlier, in
By connecting the gates
perform
B+C +D different ways, we can build circuits that can
1. (A + ..... + G) = A. B.C.D. . . . G with the
arithmetic and other functions associated
2 (A BC.D. G) = A + B + C+ D
.....
human brain.
Ex. 3.6.9: Find the
+...... G
complements of the following
functions: Because they simulate mental processes, gates are
often called as logiccircuits.
F,=ABC +ABC and F, =A (BC+ BC)
3.7.1 Classification of Logic Gates :
Soln. :
are classified
ABC As shown in Fig. 3.7.1, the logic gates
1. F, =ABC + into three categories namely, the basic gates,
the
universal gates and the special purpose gates.
.:. F, = (ABC+ ABC)
Logic Gates
= (AB C)"(ABC)
Special Purpose
Basic Gates Univorsal Gates Gates
.:: F, = (A + B+ C)·(A +B+C)
...Ans. NOT gate EX-OR gate
NAND gate
. AND gate " EX-NOR gate
NOR gate
"OR gate
2. F, = A(BC+ BC)
(B-448(a)) Fig. 3.7.1l: Classification of gates
.:. F, = [A (BC+ BC)] NOT Gate or Inverter:
3.8
( of a gate is called as the Boolean expression. These gates are also called as the derived gates.
The Boolean expression for an AND gate is, 3.11.1 The EX-0R Gate :
Y = AB
gate
(a) Symbol of a two Input EX-NOR
1 1
A
1
B Y-A@ BOCO D
Symbol of a four input EX-OR gate (c) Truth table of a
(b) two input C
EX-OR gate D
Boolean expression:
(c) Truth table of a two Input
EX-NOR gate
The Boolean expression for the two input
EX-OR gate (B-478) Fig. 3.11.2
ie V= A B. The alternate Boolean
expression fora
hwo input EX-OR gate can be as follows : Boolean expression :
B+C
Term 2: 3.11.3
(C-161)Fig. P.
ciruit for thefunction
Ex, 3.11.4: Draw thelogic
f=A BCD+ABCD+ABCD+ABC
A
-
function using Boolea
Term 3:
B
then simplify the
circuit.
simplified
(C-158) Fig. P. 3.11.1(a) Algebra and draw the
Dec. 09, 10 Marks
circuits :
Step 2:Logically add the outputs of the three
A AE Soln. :
+ ABCD + ABCD
B OR = Logical adding f = AB CD+ABCD
BC BCD +A BCD
Y= AB + BC + A B = ABCD + A
ABCD
= CD [AB+ AB]+
AB =CD [A B] + A BCD
Y = (A + B) (A + C)
= AA + AB + AC + BC
= A+ AB + AC + BC ...(" A.A = A)
= A (1 + B + C) + BC
Soln.:
ABC + ABC + ABC + ABC= AB + AC + BC
A
Di Definition:
The logic
gate
using
expressionis
which we can reaize
knoWn as a
universal
called as
gate.
Boolean
The NAND
and NOR gates are
possible to implement"Universa
(C-164) Fig. P. 3.11.8: Given circuit because it is of only
Soln. :
Gates"
Boolean
expression with
the help NAND
Step 1 : Equations for input gates : only NOR gates. logical circuit
can build any with the
Input gates are 1, 2, 3. Therefore a user gates.
NANDgates oronlyNOR
.. Y, =A help ofonly a user will have to
advantage because
This is a great only NAND or NOR gate ICs with
Y, = B of
make a stock
And Y, = C him.
Gate :
Step 2: Equation for gate - 4: 3.12.1 The NAND
Y4 = Y,Y, = A. B
Logical symbol :
wh:
Step 3: Equation for gate -5:
NAND can be split as NOT-AND
The term
Y =Y, + Y, = (A: B) + C ...Ans. the NAND operation can
means that
AND nt.
Ex, 3.11.9: Prove that a dual of exclusive OR is also its implemented with the combination of an
complement Dec. 08, 4 Marks inverter.
Soln. :
and a NOT gate i.e.
to an AND gate
The Boolean expression for EX-OR gate is, Thus a NAND gate is equivalent
3.12.1(6).
Y = A B followed by an inverter as shown in Fig.
Bubble represents
ie. Y = AB + -inversion
3.12.2 Universality of NAND Gate: Equation (3.12.1) can be realized using only NAND
gates as shown in Fig. 3.12.2(b).
MU: May 14, Dec. 16, Dec. 17, May 18, Dec. 19 AB
University Qåestions
Input
0.1 Implement EX-OR gate using NAND.
(May 14, 5 Marks) (B-506) Fig. 3.12.2(b) : AND gate using NAND
Q. 2 Prove that NAND and NOR gates are universal 3. OR gate using NAND:
gates. (Dec. 16, Dec. 17, May 18, 10 Marks) Y = A + B ... OR gate
Q.3 What are the universal gates ? Why are they so
Y = A+ B Double inversion
called ? Design any one basic logic gate using only
universal gates. (Dec. 19, 5 Marks) .:. Y A.B .. De Morgan's law
In this section we are going to illustrate the This is the required expression.
conversion of each logic function into an expression So Y = A+B
using only NAND gates.
= A-B and Fig. 3.12.2(0) shows the realization.
Note : ANAND gate is expressed mathematically as
Y=AB
A
Y= A+B
Hence we have to bring the given Boolean
expression into this form.
=À+B
using only NAND gates
3.12.2():EX-NOR
(B-508) Fig. 3.12.2 (d) : NOR gate using only NAND gates (8-510) Fig.
NOR Gate :
Fig. 3.12.2(d) shows the realization of NOR gate using 3.12.3 The
NAND gates. Logical symbol :
universal gate.
This is another which
..A +B = A.B
be split as NOT-OR means
can
EX-OR gate using NAND : The word
NOR implemented with u
5
operation can be
Y = A B
that a NOR gate and a NOT gate
i.
combination of an OR
equivalent to an OR gate
= AB + AB ... EX-OR gate Thus a NOR gate is
inverter. 3.12.3(b)
inverter as shown in Fig.
Y = A B + AB ...Double inversion followed by an i
two input NOR gate is shown
The symbol of a sida
Let X = AB andZ= AB.
where a bubble (o) on the output
Fig. 3.12.3(a),
..Y = X+ Z represents inversion.
-D Bubble represents
-inversion
Y(Output)
(c) Truth table
Inputs Output
(B-509) Fig. 3.12.2(e) :EX-OR using NAND gates
A B Y
6 EX-NOR using NAND :
(a) Logical symbol
1
Y = AOB= AB + AB
R.
= X+Z ..EX-NOR gate 1
Y = A Y= AB
(B-511) Fig. 3.12.4(a) : NOT gate using NOR gate Y = A B= AB+ AB ..EX-OR gate
2. OR using NOR:
Let X= AB and Z = AB
Y = A+B . OR gate
:.Y = X + Z
Y = A+ B ..Double inversion Y = X+Z ...Double inversion.
TechKaowledge
Pubiati0ns
Logic
3-22 A
DSD (Sem. lI /E&Tc / MU)
.:. Y = AB ...Ans.
Y = (ABC + BC)C AB
= ABC + 0 ...since CC = 0 and C. C=C (b) Realization using the NAND gates
(C-192) Fig. P. 3.12.3
..Y = ABC = ABC Realize expression using minimum NAND
Ex.3.12.4:
gates only :
Using De-Morgan's first theorem we get,
y= AB +AC +C +AD+AB C+ABC
May 10, 4 Marks
Y = A + B+ C
Soln. :
This expression can be realized using NOR gates as y = AB + AC +C+ AD + AB C+ ABC
shown in Fig. P. 3.12.2.
A - AB(1 + ) + A +C(1 +AB) + AD
A
= AB + AC+ C + AD
B -Ã+ B+G
Y=A | 1 + C=1 and 1 + AB = 1]
Specifyits symbol
DSD (Sem. IlI /E&Tc / MU) 3-24
Explainthe
OR gate. and wr
Q. 4 truthtable.
..y = A+C |: 1+ B+ D = 1] Specify its
Explainthe
EX-OR gate. symb0
Realization using NAND gates only : Q. 5 truth table.
writeits
y = A+C NANDgate. Specify its symbol and
Explain the
Q. 6 its truth table.
y = A. Specify its symbol
NOR gate. and
A Explainthe
Q:7 its truth table.
universalgates
D 0.8
Q. 9
Explainand
Name the
mention the
universal and
derivedgates
NOR gates called
(C-2993) Fig. P. 3.12.4 Why are NAND and unive
Q. 10
Ex, 3.12.5: gates ?
Implement Y=A +BC using nly NOR gates. table of
following:
May 16, 5 Marks Q. 11 Write the truth gate
Three input EX-OR
Soln. : 1 gate.
Three input EX-NOR
Step 1: Implementation using NOR gates : 2
State AND laws.
Taking double inversion of R.H.S. Q. 12
State OR laws.
Q. 13
A + BC theorems.
Y =
Q. 14 State De Morgan's
AND-OR-NOTlogic?
Q. 15 What is
= BC .(De-Morgan's theorem) Define truth table.
Q. 16
Boolean expressions for the followinn.
Q. 17 Write the
= + BC =Ã+ B + =Ã+B+C 1 OR gate
2. EX-NOR gate
two input EXNn
Implementation using NOR gates is as shown in Q. 18 Explain with circuit diagrams a
Fig. P. 3.12.5.
gate using only NOR gates.
gates using NAN
Q. 19 Draw the equivalent circuit of all
gate.
Q. 20 Draw the equivalent circuit of all gates using NO
gate.
Y= Q. 21 Define 'truth table'. What is a logic gate ? Class
the logic gates.
Q. 22 State the rules of Boolean algebra.
(C-s497) Fig. P. 3.12.5: Implementation using NOR gates
Q. 23 State and explain the commutative law.
Review Questions Q. 24 State and explain the associative law.
R TechKnowledgi