CBSE Class 12 Computer Science Boolean Algebra A
CBSE Class 12 Computer Science Boolean Algebra A
com
Unit -IV
CHAPTER- 13
BOOLEAN ALGEBRA
Boolean algebra
Boolean algebra:- a modern algebra which uses the set of numbers 0 and 1,the logic numbers used to
solved logic problems.
Binary decision:-. The decision which results into yes or no. Also called logical statements or truth
function.
Truth table:- a table representing all possible input-output combinations for a given logical
problem/expression.
Tautology:-a Boolean expression that always results in true or 1.
Fallacy:-a Boolean expression that always results in false or 0.
Cononical expression :- a Boolean expression having all minterms or maxterms.
Minterm:-product of all the literals(with or without the bar) within the logic system.
Maxterm:-sum of all the literals(with or without the bar) within the logic system.
Karnaugh Map:- it is a graphical representation of the truth table of the given expression.
Logic Gates
Logic gates serve as the building blocks to digital logic circuits using combinational logic. We're
going to consider the following gates: NOT gates (also called inverters), AND gates, OR gates,
NAND gates, NOR gates, XOR gates, and XNOR gates.
We'll also discuss the concept of gate deltay.
NOT gates
NOT gates or inverters have a single bit input and a single bit of output.
This is a diagram of a NOT gate. It is a triangle with a circle on the right. The circle indicates
"negation".
x z
0 1
1 0
68
x1 x0 z
0 0 0
0 1 0
1 0 0
1 1 1
x1 x0 z
0 0 0
0 1 1
1 0 1
1 1 1
The function implemented by OR2 gates has interesting properties:
The function is symmetric. Thus, x + y == y + x. This can be verified by using truth tables.
We use "+" to represent OR2
The function is associative. Thus, (x + y) + z == x + (y + z). This can be verified by using
truth tables.
Because of these properties, it's easy to define ORn, which is an n-input OR gate.
ORn(x1, x2,...,xn) = x1 + x2 + ... + xn
That is, an AND gate with n-inputs is the AND of all the bits. This is not ambiguous because the
AND function is associative (all parenthesization of this expression are equivalent).
69
x1 x0 z
0 0 1
0 1 1
1 0 1
1 1 0
The function implemented by NAND2 gates has interesting properties:
The function is symmetric. Thus, x NAND y == y NAND x. This can be verified by using
truth tables.
The function is not associative. This can be verified by using truth tables.
Because of these properties, NANDk is defined from ANDk, and not built from NAND2 gates.
NOR2 gates
OR2 gates have two bits of input and a single bit of output. The subscript, 2, indicates how many
inputs this OR gate has. For example, NOR3 gates have 3 inputs.
The output of NOR2 gate is the negation of OR2.
x1 x0 z
0 0 1
0 1 0
1 0 0
1 1 0
The function implmented by NOR2 gates has interesting properties:
The function is symmetric. Thus, x NOR y == y NOR x. This can be verified by using truth
70
If you look carefully at the drawing of the gate, there is a second arc behind the first one near the
inputs. Since this second arc is hard to see, it's usually a good idea to write the word "XOR" inside
the gate.
The truth table defines the behavior of this gate.
x1 x0 z
0 0 0
0 1 1
1 0 1
1 1 0
The function implmented by XOR2 gates has interesting properties:
The function is symmetric. Thus, x (+) y == y (+) x. This can be verified by using truth
tables. (We use (+) to denote logical XOR--ideally, we'd draw it with a + sign inside a circle,
but HTML doesn't seem to have a symbol for this).
The function is associative. Thus, [ x (+) y ] (+) z == x (+) [ y (+) z ]. This can be verified by
using truth tables.
Because of these properties, it's easy to define XORn, which is an n-input XOR gate.
XORn(x1, x2,...,xn) = x1 (+) x2 (+) ... (+) xn
That is, an XOR gate with n-inputs is the XOR of all the bits. This is not ambiguous because the
XOR function is associative (all parenthesization of this expression are equivalent).
XNOR2 gates
XNOR2 gates have two bits of input and a single bit of output.
The output of XNOR2 gate is the negation of XOR2 and has 1 when both inputs are the same.
71
x1 x0 z
0 0 0
0 1 1
1 0 1
1 1 0
The function implmented by XNOR2 gates has interesting properties:
The function is symmetric. Thus, x XNOR y == y XNOR x. This can be verified by using
truth tables.
The function is associative. Thus, (x XNOR y) XNOR z == x XNOR (y XNOR z). This can
be verified by using truth tables.
Because of these properties, it's easy to define XNORn, which is an n-input XNOR gate.
XNORn(x1, x2,...,xn) = x1 XNOR x2 XNOR ... XNOR xn
That is, an XNOR gate with n-inputs is the XNOR of all the bits. This is not ambiguous because the
XNOR function is associative (all parenthesization of this expression are equivalent).
(Error-checkers! You may wish to verify this, and email me if this is incorrect!).
Solved questions
Q1. State the principal of duality in Boolean algebra.
Ans Principal of duality states that from every Boolean relation, another Boolean relation can be
derived by
i) Changing each OR sign(+) to an AND sign(.)
ii) Changing each an AND sign(.) to an OR sign(+)
iii) Replacing each 1 with 0 and each 0 with 1
Q2. Define the following terms:
(a) Logical constant
(b) Logical variable
(c) Binary valued quantity
(d) Boolean literal
Ans:- (a) the truth values true(1) or false(0)are known as logical constants.
(b) A variable that can store the truth-values (TRUE or FALSE) is called logical variable.
(c ) quantity can be represented in terms of TRUE or FALSE is known as binary valued
quantity.
(d) a single Boolean variable(logical variable) or its complement e.g X or Y or Z is known
as literals.
Q3. State Demorgan’s laws. ____
Ans Demorgan’s first law: -it states that X+Y= X.Y
____
Demorgan’s second law: -it states that X.Y=X+Y
72
Ans.
X Y X+Y X.(X+Y)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1
From the above table it is obvious that X.(X+Y) = X because both the columns are identical.
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
State Demorgan’s laws. Verify one of the Demorgan’s laws using truth tables.
Ans. De Morgan’s first theorem. It states that X + Y = X . Y
De Morgan’s second theorem. It states that X . Y = X + Y
Truth table for second theorem
X Y X.Y X.Y X Y X+Y
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
X.Y and X+Y are identical.
Q10. Why are AND and NOR gates called Universal gates?
Ans. NAND and NOR gates are less expensive and easier to design. Also, other switching
functions (AND, OR) can easily be implemented using NAND/NOR gates. Thus, these
(NAND, NOR) gates are also reffered to as Universal Gates.
Q11. By means of truth table, demonstrate the validity of the following Postulates /
Laws of Boolean algebra:
(a) Commulative law
(b) Absorption law
(c) Idempotent law
Comparing the columns X+Y and Y+X, we see both of these are identical. Hence proved.
74
X X X+X
0 0 0
1 1 1
75
0 0 0
1 1 1
Q12. Obtain the simplified form of a boolean expression using Karnaugh map.
F(u,v,w,x) = ∑ (0, 3, 4, 5, 7, 11, 13, 15)
[00]WZ [01] WZ [11]WZ [10]WZ
1 1
1 1 1
1 1
2 quads, 1 pair.
Quad 1(m3+m7+m11+m15) reduces to WZ
Quad 2(m5+m7+m13+m15) reduces to VZ
Pair 1(m0,m4) reduces to UWZ
Therefore F=WZ + VZ + UWZ
Q13 . Draw the logic circuit diagram for the following expression :
Y=ab+bc+ca
76
0 0 0 1 1 1 1 0 0
0 0 1 1 1 0 0 0 0
0 1 0 1 0 1 1 0 1
0 1 1 1 0 0 0 0 0
1 0 0 0 1 1 1 1 1
1 0 1 0 1 0 0 1 1
1 1 0 0 0 1 1 0 0
1 1 1 0 0 0 0 0 0
Q15. Write the equivalent expression for the following logic circuit :
Ans. To get the product of sums form, we need to add maxterms for all those input combinations
that produce output as 0. Thus ,
G(U,V,W) = (U + V + W) (U + V + W’) (U + V’ + W’) (U’ + V + W’)
Q2. Seven inverters are cascaded one after another. What is the output if the input is 1?
Ans: 0.
Q3. Why are NAND and NOR gates called Universal Gates?
Ans: NAND and NOR gates are less expensive and easier to design. Also other functions (NOT,
AND, OR) can easily be implemented using NAND/NOR gates.
Q4. Obtain a simplified form for the following Boolean ex-pression using Karnaugh•fs
Map:
F(a, b, c, d) = ‡”(0, 1, 2, 4, 5, 7, 8, 9, 10, 11, 14).
Ans:
78
Q10. Convert the following function into canonical product of sums form
F(X,Y,Z)=(0,2,4,5).
Ans F(X,Y,Z)=(0,2,4,5)= MO.M2.M4.M5
M0=000=X+Y+Z
M2=010=X+Y•f+Z
M4=100=X•f+Y+Z
M5=101=X•f+Y+Z•f
F= (X+Y+Z )(X+Y•f+Z )(X•f+Y+Z )(X•f+Y+Z•f)
79