Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

BOOLEAN ALGEBRA AND COMPUTER HARDWARE

(Prepared by Er P K Tiwari)
PROPOSITIONAL LOGIC

The propositional logic represents logic through propositions and logic


connectives. We may define proposition as an element atomic sentence that may
take either true or false value but may not take any other value.

Definition: A Proposition is an elementary atomic sentence that may either


be true or false but may take no other value.
Terms and Symbols

A simple proposition is one that does not contain any other proposition as a part.
We will use the lower case letter p,q,r.... as symbol simple statements or
proposition. A compound proposition is one with two or more simple propositions
as parts or what will call component. A component of a compound is any whole
proposition that is part of a large proposition, component may themselves be
compounds.

Different types of connectives (or operators) used in prepositional logic are as


given below:

1. Disjunction (also called OR): Represented by symbols + or v. Disjunction


means one of the two arguments is true or both e.g. p+q (or pvq) means p
OR q. It's meaning is either p is true or q is true or both.

2. Conjunction (also called AND): Represented by symbols & or . or ^.


Conjunction means one of the two arguments is false or both e.g. p.q (or p^q)
(or p &q) means p AND q. It's meaning is either p is false or q is false or both.

3. Negation (also called NOT or Invertor): Represented by symbols ~ or ‘ or -.


Negation means if true then false otherwise true.

4. Implication (also called If Then or Conditional): Represented by symbols =>


or ->.

5. Equivalence (also called If and only if or Bi-Conditional) : Represented by


symbols  or <->
Boolean Algebra
Long long-ago mathematician kept on trying to solve logic problems using conventional
algebra but only George Boole could manipulate these symbols successfully to arrive at a
solution with his own mathematical system of logic Boole's revolutionary paper "An
invention of the laws of the thoughts" was published in 1854 which led to the
development of new system the algebra of logic, "BOOLEAN ALGEBRA".
Some Terms of Propositional Logic & Propositional Laws
Principle of duality

8LIHYEPTVMRGMTPISVTVMRGMTPISJHYEPMX]WE]WXLEXXLIFSSPIEREPKIFVEVIQ EMRWYRGLERKIH[ LIR


XLIHYEPTEMVWEVIMRXIVGLERKIH&YXRSXLMRKKSIW[ MXLGSQ TPMQ IRXFIGEYWIGSQ TPMQ IRXMWEW
WIPJHYEPSTIVEXMSR

Example:

The dual of the Boolean equation (X+Y) ·1 = X+Y is:

Answer: X·Y + 0 = X·Y


[Hint: Replace + with . , . with +, 1 with 0, 0 with 1 and Not never change)

If A=1, B=0, C=0 and D=1, then the maxterm will be:

Answer: A’+B+C+D’
[Hint: If value is 0 then simple variable, if value is 1 then complemented variable and join with +]

The compliment of the Boolean expression F(P,Q,R) = (P + Q + R) is:

Answer: (a) P’Q’R’


[Hint: (P+Q+R)’=P’.Q’.R’=P’Q’R’]

The reduced expression for the Boolean expression F(X,Y,Z) = ∑(0,1,2,3,4,5,6,7) is:

Solution:
Logic Gates
Derivation of Boolean Expression
The basic logic gate that represents the simplification of the Boolean expression
A.(A’+B). (A+B) is:

Solution:

The proposition ~( a ∧ b ) V (~a => b) is a:

Solution:
Universal Gates
Simplification using Karnaugh Map
Truth Tables provides a nice natural way to list all values of a function. There are several other
ways to represent function values. one of them is Karnaugh Map (in sort K-Map) named after
its originator Maurice Karnaugh. These maps are sometimes also called Veitch Diagrams.
What is Karnaugh Map? Karnaugh map or K-Map is a graphical display of the fundamental’s
products in a truth table. Karnaugh Map is nothing but a rectangle made up of certain number
of squares each squares representing a Maxterm or Minterm.
Sum of Product reduction using K-Map
In SOP reduction each square of K-Map represents a minterm of the given function. Thus for
a function of n variables there would be a map of 2n squares, each representing a minterm.
Given a K-Map for SOP reduction the map is filled in by placing 1's in squares whose minterm
lead to a 1 output.

2 variable K-Map representing SOP 2 variable K-Map representing SOP


X\Y Y' Y X\Y 0 1
X' X'Y' X'Y 0
0 1
X XY' XY 1
2 3

3 variable K-Map representing SOP


3 variable K-Map representing SOP
X\YZ Y'Z' Y'Z YZ YZ'
X\YZ 00 01 11 10
X' X'Y'Z' X'Y'Z X'YZ X'YZ' 0
0 1 3 2

X XY'Z' XY'Z XYZ XYZ' 1


4 5 7 6

4 variable K-Map representing SOP 4 variable K-Map representing SOP


WX\YZ Y'Z' Y'Z YZ YZ' WX\YZ 00 01 11 10
W'X' W'X'Y'Z' W'X'Y'Z W'X'YZ W'X'YZ' 00
0 1 3 2
W'X W'XY'Z' W'XY'Z W'XYZ W'XYZ' 01
4 5 7 6
WX WXY'Z' WXY'Z WXYZ WXYZ' 11
12 13 15 14

WX' WX'Y'Z' WX'Y'Z WX'YZ WX'YZ' 10


8 9 11 10
Note that in every square a number is written. These subscripted number denotes that this
square corresponds to that numbers minterm. For example in 3 variables map X'YZ' box has
been given number 2 which means this square corresponds to m2. Similarly box 7 means it
corresponds to m7 and so on. Pleas notice the numbering scheme here, it is 0,1,3,2 then
4,5,7,6 and so on. Always squares are marked using this scheme while making K-Map.
Observe carefully above given K-Map. See the binary numbers at the top of K-Map. These do
not follow binary progression, instead they differ by only one place when moving from left to
right: 00, 01, 11, 10 It is done so that only one variable changes from complemented to un-
complimented form or vice versa see A'B', A'B, AB, AB'. This binary code 00, 01, 11, 10 is
called Gray Code. Gray Code is the binary code in which each successive number differs only
in one place.

How to map in K-Map?


We will take an example of 2 variables map to illustrate this. Suppose we have been given the
following truth table for mapping.

A B F
0 0 0
0 1 0
1 0 1
1 1 1

Canonical SOP expression of this table is F=AB'+AB or ∑ (2,3).


X\Y 0 1
To map this function first we will draw an empty 0 0 1
2 variable K-Map as shown in figure.
1
2 3

X\Y 0 1
Now look for output 1 in the given truth table. 0
0 1
For minterm m2 and m3 the output is 1. Thus
marks 1 in the square for m2 and m3 i.e., the 1 1
1
square number as 2 and 3. Now our K-Map will 2 3
look like this as shown in figure.

X\Y 0 1
0 0
0
0 1
After entering 1's for all 1 output, enter 0's in 1 1 1
the blank squares. K-Map will now look like 2 3
this as shown in figure.
Same is the method for mapping 3 variable and 4 variable maps.

How to reduce Boolean expression in SOP form using K-Map


For reducing the expression, first we have to mark pairs, quads and octets. To reduce an
expression, adjacent 1's are encircled. If 2 adjacent 1's are encircled, it makes a pair, id 4
adjacent 1's are encircled its make a quad, and if 8 adjacent 1's are encircled it makes an
octet.
Pair Reduction Rule: Remove the variable
which changes its state from complimented to
un-complimented or vice versa. Pair removes WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ'
one variable only. Thus reduced expression for
Pair-1 is W'Y'Z' as W'X'Y'Z' (m0) changes to [00]W'X' 1
W'XY'Z'(m4) We can also prove the same 0 1 3 2
algebraically also as follows. [01]W'X 1 1
Pair-1 4 5 7 6
=m0+m4 1
=W'X'Y'Z'+W'XY'Z' [11]WX
12 13 15 14
=W'Y'Z'(X'+X)
W'Y'Z'.1 [X'+X=1] [10]WX'
=W'Y'Z' 8 9 11 10
Similarly reduced expression of Pair-2 will be
XYZ
Reduction of quad: If we are given with the K-
Map shown in figure in which two quads has
been marked.
Quad-1 is m0+m4+m12+m8 and quad-2 is
m7+m6+m15+m14. When we move across quad- WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ'
1 two variables changes their states i.e., W and
X changing their states, so these two variables [00]W'X' 1
will be removed. 0 1 3 2
Quad Reduction Rule: Remove the two [01]W'X 1 1 1
variables which changes their states. A quad 4 5 7 6
removes two variables. Thus, reduced 1 1 1
expression of quad-1 is Y'Z' as W and X (both) [11]WX
12 13 15 14
are removed. Similarly in quad-2
(m7+m6+m15+m14), horizontally moving [10]WX' 1
variables Z is removed as W'XYZ(m7) changes 8 9 11 10
to W'XYZ'(m6) and vertically moving, variable
W is removed as W'XYZ(m7) changes to
WXYZ. Thus, reduced expression for quad-2 is
XY.
Reduction of an octet: Suppose we have a K- WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ'
Map with an octet marked as shown in figure.
[00]W'X'
While moving horizontally in the octet two 0 1 3 2
variables Y and Z are removed and moving
vertically one variable X is removed. Thus, the [01]W'X
4 5 7 6
elimination X, Y, Z the reduced expression for
the octet is W only. [11]WX 1 1 1 1
Octet Reduction Rule: Remove the three 12 13 15 14
variables which changes their states. A octet 1 1 1 1
removes three variables. [10]WX'
8 9 11 10

After reducing pairs, quad and octet there are certain other things to be taken care of before
arriving at the final expression. These are map rolling, overlapping groups and redundant
groups.
Map Rolling: means roll the map i.e. consider the map as if its left edges are touching the
right edges and top edges are touching bottom edges. This is a special property of K-Map that
its opposite edges squares and corners squares are considered contiguous. As even in
opposite edges squares and in corner squares only one variable changes its states from
complimented to un-complimented state or vice versa. Therefore while marking the pairs,
quad and octets, map must be rolled. Following pairs, quads and octets are marked after
rolling the map.

WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ' WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ'
[00]W'X' 1
[00]W'X' 1 1
0 1 3 2
0 1 3 2
[01]W'X 1 1
[01]W'X 1 1
4 5 7 6
4 5 7 6
[11]WX 1 1
12 13 15 14 [11]WX
12 13 15 14
[10]WX' 1
[10]WX' 1 1
8 9 11 10
8 9 11 10
Pair Quad
WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ' WX\YZ [00]Y'Z' [01]Y'Z [11]YZ [10]YZ'
[00]W'X' 1 1 [00]W'X' 1 1 1 1
0 1 3 2 0 1 3 2
[01]W'X [01]W'X
4 5 7 6 4 5 7 6
[11]WX [11]WX
12 13 15 14 12 13 15 14

[10]WX' 1 1 [10]WX' 1 1 1 1
8 9 11 10 8 9 11 10
Quad Octet
Overlapping Groups: Overlapping means same one can be encircled more then once. For
example if the following K-Map as shown in the figure,
observe that 1 for m7 has been encircled twice.
[00] [01] [11] [10] Once for pair-1(m5+m7) and again for
AB\CD quad(m7+m6+m15+m14). Also 1 for m14 has
C'D' C'D CD CD'
been encircled twice. For the Quad and for
[00]
pair-2(m14+m10). Overlapping always leads to
A'B' 0 1 3 2 simpler expressions. Hence reduce expression
[01] 1 1 1 for pair-1 is A'BD. reduced expression for the
A'B 4 5 7 6 Quad is BC. reduced expression for the pair-2
[11] 1 1 is ACD'. Thus final reduced expression for this
AB 12 13 15 14 map A'BD+BC+ACD'. This reduced expression
for entire K-Map is sum of all reduced
[10] 1 expressions in the every K-Map. but before
AB' 8 9 11 10 writing the final expression we must take care
of Reduntant Group.
Reduntant Group: is a group whose all 1's are overlapped by other groups (i.e. pairs, quads,
octets) Here as an example given below.
(a)(b)
[00] [01] [11] [10] [00] [01] [11] [10]
WX\YZ WX\YZ
Y'Z' Y'Z YZ YZ' Y'Z' Y'Z YZ YZ'
[00] [00]
W'X' 0 1 3 2 W'X' 0 1 3 2
[01] 1 1 [01] 1 1
W'X 4 5 7 6 W'X 4 5 7 6
[11] 1 1 [11] 1 1
WX 12 13 15 14 WX 12 13 15 14
[10] [10]
WX' 8 9 11 10 WX' 8 9 11 10
(a) K-Map with reduntant group (b) K-Map without reduntant group
Figure (a) has a reduntant group. there are three pairs: Pair-1 (m4+m5), Pair-2 (m5+m13),
Pair-3 (m13+m15). but Pair-2 is a reduntant group as its all 1's are marked by other groups.
With this reduntant group, the reduced expression will be A'BC' + BC'D + ABD. For a simpler
expression, Reduntant Group must be removed. After removing the reduntant group, we
get the K-Map shown in the figure (b). the reduced expression for K-Map in figure (b) will be
A'BC' + ABD which is much simpler expression. Thus removal of reduntant group leads to
much simpler expression.
Summary of all the rules for SOP reduction using K-Map,
1. Prepare the truth table for given function.
2. Draw an empty K-Map for the given function (i.e. 2 variable K-Map for 2 variable function 3
variables K-Map for 3 variables function and so on.)
3. Map the given function by entering 1's for the outputs as 1 in the corresponding squares.
4. Enter 0's in all left out empty squares.
5. Encircle adjacent 1's in form of octets, quad and pairs. Do not forget to roll the map and
overlap.
6. Remove redundant groups, if any.
7. Write the reduced expressions for all the groups and OR (+) them.
Example: Reduce F(a,b,c,d) =∑ (0,2,7,8,10,15) using Karnaugh Map.
Solution: given F(a,b,c,d) = ∑ (0,2,7,8,10,15) Input Output
=m0+m2+m7+m8=m10+m15 A B C D F
m0 = 0000 = A'B'C'D' 0 0 0 0 1
m2 = 0010 = A'B'CD' 0 0 0 1
m7 = 0111 = A'BCD 0 0 1 0 1
m8 = 1000 = AB'C'D'
0 0 1 1
m10 = 1010 = AB'CD'
m15 = 1111 = ABCD 0 1 0 0
truth table for the given function is as follows: 0 1 0 1
Mapping the given function in K-Map we get, 0 1 1 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1
1 0 1 0 1
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1 1
[00] [01] [11] [10] In the given K-Map two groups have been
AB\CD marked, one pair and one quad.
C'D' C'D CD CD'
[00] Pair is m7+m15
1 1
A'B' Quad is m0+m2+m8+m10
0 1 3 2
Reduced expression for pair is (m7+m15) is
[01] 1 BCD as A is removed. Reduced expression for
A'B 4 5 7 6 quad (m0+m2+m8+m10) is B'D' as for horizontal
[11] 1 corners C is removed and for vertical corners
AB 12 13 15 14 A is removed.
[10] 1 1
AB' 8 9 11 10

Product of Sum Reduction using Karnaugh Map


In POS reduction each square of K-Map represents a maxterm. Karnaugh map is just the
same as that of used in SOP reduction. For a function of n variables, map would represent 2n
squares, each represents a Maxterm. For POS reduction map is filled by placing 0's in squares
whose maxterm lead to output 0. Following are 2,3,4 variables K-Map for POS reduction

2 variable K-Map representing POS 2 variable K-Map representing POS


X\Y Y Y' X\Y 0 1
X X+Y X+Y' 0
0 1
X' X'+Y X'+Y' 1
2 3

3 variable K-Map representing POS


3 variable K-Map representing POS
X\YZ 00 01 11 10
X\YZ Y+Z Y+Z' Y'+Z' Y'+Z
0
X X+Y+Z X+Y+Z' X+Y'+Z' X+Y'+Z 0 1 3 2

1
4 5 7 6
X' X'+Y+Z X'+Y+Z' X'+Y'+Z' X'+Y'+Z
4 variable K-Map representing POS 4 variable K-Map representing POS
WX\YZ Y+Z Y+Z' Y'+Z' Y'+Z WX\YZ 00 01 11 10
W+X W+X+Y+Z W+X+Y+Z' W+X+Y'+Z' W+X+Y'+Z 00
0 1 3 2
W+X' W+X'+Y+Z W+X'+Y+Z' W+X'+Y'+Z' W+X'+Y'+Z 01
4 5 7 6
W'+X' W'+X'+Y+Z W'+X'+Y+Z' W'+X'+Y'+Z' W'+X'+Y'+Z 11
12 13 15 14

W'+X W'+X+Y+Z W'+X+Y+Z W'+X+Y'+Z' W'+X+Y'+Z 10


8 9 11 10

Again, the numbers in the squares represent maxterm subscripts. Box with number 1
represent M1 number 6 box represents M6, and so on. Also notice box numbering scheme is
the same i.e., 0,1,3,2;4,5,7,6;12,13,15,14;8,9,11,10.
One more similarity in SOP K-Map and POS K-Map is that they are binary progression in Gray
Code Only. So here also same Gray Code appears at the top. But one major difference is that
in POS K-Map, complimented letters represent 1's and un-complimented letter represent 0's
where as it is just the opposite in SOP K-Map. Thus, in the figures for 0's un-complimented
letters appears and for 1's complimented letters appears.

How to derive POS Boolean expression using K-Map,


1. Prepare the truth table for given function.
2. Draw an empty K-Map for the given function (i.e., 2 variable K-Map for 2 variable function
3 variables K-Map for 3 variables function and so on.)
3. Map the given function by entering 0's for the outputs as 0 in the corresponding squares
(i.e. if M5 and M13 are 0's then squares no 5 and 13 will having 0's).
4. Enter 1's in all left out empty squares.
5. Encircle adjacent 0's in form of octets, quad and pairs. Do not forget to roll the map and
overlap.
6. Remove redundant groups, if any.
7. Write the reduced expressions for all the groups and AND (.) them.
Example 1:
Reduce the given Boolean function F(A,B,C,D) = ∑(0,2,4,8,9,10,12,13) by using 4‐variable Karnaugh
map
Example 2:
Reduce the given Boolean function F(A,B,C,D) = π(3,4,5, 6, 7, 11,13,15) by using 4‐variable Karnaugh map

Statement based Questions


Example:
A school intends to select candidates for an Inter school competition as per the criteria
given below:
• The student has participated in an earlier competition and is very creative
Or
• The student is very creative and has excellent general awareness, but has not
participated in any competition earlier
Or
• The student has excellent general awareness and has won prize in an inter ‐house
competition
The inputs are:

( In all the above cases 1 indicates yes and 0 indicates no).


Output: X [ 1 indicates yes and 0 indicates no for all cases].
Draw the truth table for the inputs and outputs given above and answer the following
questions:
The POS expression for X(A,B,C,D) will be:
Some Boolean Expressions
1) F(A,B,C,D)= ∑ (5,6,7,8,9,10,14)
Correct Answer: A’BD+AB’C’+BCD’+ACD’
Correct Answer: A’BD+AB’C’+BCD’+AB’D’
2) X(A,B,C,D)= π (5,6,7,8,9,10,14)
Correct Answer: (A+B’+D’)(B’+C’+D)(A’+C’+D)(A’+B+C)
3) F(A,B,C,D)= ∑ (0,1,2,4,5,7,11,13,15)
Correct Answer: A’C’+BD+A’B’D’+ACD
4) X(A,B,C,D)= π (2,3,4,7,9,11,12)
Correct Answer: (A+B+C’)(A+C’+D’)(B’+C+D)(A’+B+D’)
5) F(A,B,C,D)= ∑ (0,1,2,6,8,9,10)
Correct Answer: B’C’+B’D’+A’CD’
6) X(A,B,C,D)= π (3,4,5,7,11,12,13,14,15)
Correct Answer: (B’+C)(C’+D’)(A’+B’)
7) F(A,B,C,D)= ∑ (1,2,3,11,12,14,15)
Correct Answer: A’B’D+A’B’C+ACD+ABD’
8) F(X,Y,Z)= ∑ (0,1,3,5)
Correct Answer: X’Y’+X’Z+Y’Z
9) F(X,Y,Z)= π (0,3,6,7)
Correct Answer: (X+Y+Z)(Y’+Z’)(Y’+X’)
10) F(A,B,C,D)= ∑ (0,3,4,5,6,7,9,11,12,13,14,15)
Correct Answer: B+CD+AD+A’C’D’
11) F(W,X,Y,Z)= ∑ (0,1,2,4,5,6,8,9,12,13,14)
Correct Answer: Y’+W’Z’+XZ’
12) F(A,B,C,D)= ∑ (0,1,2,5,8,9,10)
Correct Answer: B’D’+B’C’+A’C’D
Some questions on Topic
Q. What is a literal?
Ans. Every Boolean Variable X and its complement X' are called literals. Literals are
fundamental units of Boolean expressions.
Q. State the difference between half adder and full adder circuits.
Ans. A half adder circuit can be used to add two binary digits at a time, but it cannot add more
than two digits, whereas full adder circuit is circuit which can be used to add more than two-
digit number.
Q. Differentiate between logic circuits and sequential circuit?
Ans. Logic circuits works entirely on the logic of the circuit involved at all times and will not at
all the times and will not at all dependent on the previous state of outputs. For example, we
can say that the output of an AND gate will be high when all the inputs will be maintained at
high state and that is no way depended on the previous state. But the operation of a sequential
circuit differs from this principle. The output of a sequential circuit may be entirely dependent
on the previous output condition.
Q. Explain the following:
(1) Canonical sum of Products.
(2) Canonical Product of Sum.
Ans. (1) If a Boolean expression is composed of entirely minterms, the expression is known
as Canonical Sum of Products.
(2) If an expression is composed of a product of sum terms, each of which is a maxterm, the
expression is said to be in Canonical Products of Sum form.
Q. What is canonical expression? What is canonical product of sums?
Ans. It is an expression consisting of either minterms or maxterms.
It is an Boolean expression represented as product of maxterms
Computer Hardware
Q. Define Half Adder and Full Adder circuit with the help of truth table and logic
diagram. Also derives the expression for sum and carry.
Q. What is meant by an encoder? State any one of its applications.
Ans. An encoder is a unit which is used to alter the form of data type. This altered form of data
entered in a system which could understand it. Its application is conversion of decimal to
binary.
Q. What is a decoder? State any one of its applications.
Ans. A decoder is a digital circuit that takes n input and selects one of the possible 2n output
lines. It is many-to-one digital device.
The most popular application of a decoder is binary to decimal decoder which converts an
input binary number into the corresponding decimal number.
Implementation of Decoder
Q. What is Multiplexer? State any one of its applications.
Ans. Multiplexer- A system in which a large set of information can be transmitted using lesser
number of channels.
Application of Multiplexer- In digital system a Multiplexer circuit is a combination of logic circuit
which select one of the input channels and connect it to an output channel.
Implementation of Multiplexer

You might also like