Chapter 4
Chapter 4
After studying this lesson, you will have a clear understanding on,
Boolean Algebra
basic Laws in Boolean Algebra
Logic Gates
designing circuits by using Combinational Logic Gates
Algebraic expressions, algebraic equations and operators are used in general algebra. The number system
used here is the Decimal number system. Before we start discussing about Boolean Algebra, let us
consider the algebraic expressions and algebraic equations we come across in general algebra.
Algebraic Expressions
When numbers, letters, digits, signs (mathematical operators), variables and plus or minus signs are
arranged to get a mathematical or logical idea we call it an algebraic expression. They should not contain
an equal sign.
Example :-
• 2x+y
• –3ax + 11xy
Is this an algebraic expression? 2x+y=4y
Since the equal sign is used in this expression it is not an algebraic expression.
Algebraic Equations
Two algebraic expressions connected by an equal sign is called as algebraic equation.
Example :- • v = u+ft
• P = ma
• Profit = Income - Expenditure
Mathematical Operations
In mathematics we use the operations: Addition ^+&, Subtraction ^-&, Multiplication ^Í& and Division ^$&
Values
Let's consider the equation Y=2X+1 used in general algebra
X Y
10001 20001
100 199
10 21
1000 2001
10000 20001
We can get any value from minus infinity to plus infinity for X and can obtain similar values for Y
relevant to it.
Accordingly in normal algebra we use the numerals from minus infinity in the decimal number system to
represent values..
1
4.1 Boolean Algebra
As we are going to discuss Boolean Algebra here, we should have an understanding of Boolean
expressions, 'Boolean values' and Boolean operations.
Boolean Values
To express Boolean Values 'True' or 'False' or '1' or '0' are used in general.
Boolean Expressions
If we can set only logical values such as 'True' or 'False' for a certain expression, it is defined as a
Boolean expression.
Boolean Variables
If a variable can take only logical values it can be called a Boolean variable. These two values can be
expressed as '0' or '1' or 'True' or 'False'.
Boolean Operations
Boolean operations are as follows :
OR - Boolean Addition
AND - Boolean Multiplication
NOT - Boolean Complementation
OR - Boolean Addition
"+" sign is used for the addition operation in Boolean Algebra. This is known as "OR". The same sign is
used for addition in General Algebra and it is given a different meaning in Boolean algebra.
If A and B are Boolean variables, let us consider the expression 'A+B ' or A OR B'. Here we have to
consider four situations. The table shows how the value of a Boolean expression changes according to the
values of Boolean variables. This is called a Truth Table
A B A+B (A OR B) Note :
0 0 0 When A and B are Boolean variables, we read 'A + B'
0 1 1 as 'A OR B' , and not
1 0 1 as A plus B.
1 1 1
If A and B are two Boolean variables, the various values the expression 'A . B' or 'A AND B' can take are
shown in Table
If A" B and C are three Boolean variables, let us consider the expression 'A.B.C' or 'A AND B AND C'.
For this we have to consider 8 situations.
If A is the Boolean variable, let us consider the expression NOT A . Here we have to consider 2
situations.
Simplify Y = 2+6 Ï 4 / 3 Ï 2-5. We cannot obtain several solutions for this expression. Therefore we
should know the priority order of the operators.
Starting from the left and going towards the right you will notice the operations '+' , ' / ' 'Ï' and '_'. Among
these operators 'Ï' and ' / ' gain precedence (than '+' and '-'). Therefore, first you have to do multiplication
or division. Since you get multiplication first, you should do that operation first.
3
Y = 2+6 Ï 4 / 3 Ï 2-5
Y = 2+24 / 3 Ï 2-5
Secondly you should do division
Y = 2+8 Ï 2-5
Then multiplication should be done
Y = 2+16-5 Then addition and subtraction should be done.
Y = 13
The following conditions should be observed when simplifying boolean expressions or equations.
• Start from the left and move towards the right'
• First simplify operation within brackets.
• After that do all 'NOT' operation ( - ) from left to right.
• Then do 'AND' operation ( . ) from left to right.
• Finally, do 'OR' operation (+) from left to right.
Example :- When simplifying the Boolean expression A+B.C , we come across both 'OR' and 'AND'
operations from left to right. The first operation here should be 'AND', that is B.C and then finally the
'OR' operation.
Activities 4.1
Find the values of following Boolean Expressions.
1. 1.1+1.0 2. 0.1+1.0
3. 1.1.1+0.1+1 4. 0+1+1.1.1
5. 1.1+1.0 6. 1.1.0 +1.1.1+0.1+1
7. 1.0.1 +(1.1.1+1.1).1 8. (1 + 1+ 1) (1+ 1. 0)
9. 1 .1 .1 +(1.1.1+1.1).1 10. (1 + 1+ 1) (1. 1. 0)
If A and B are two Boolean variables, construct Truth Tables for the following Boolean expressions.
1' A.B+A 2' A.B+A.B
A) X+0=X B) X .0 = 0 C) X+ 1 = 1 D) X.1=X
4
Commutative Law
A) X+Y=Y+X B) X.Y=Y.X
Associative Law
A) X+(Y+Z) = (X+Y)+Z B) X.(Y.Z) = (X.Y). Z
Distributive Law
A) X.(Y+Z) = (X.Y)+(X.Z) B) X + (Y.Z) = (X + Y) . (X + Z)
Idempotent Law
A) X + X = X B) X.X=X
Idempotent Law
A) X + X = X B) X.X = X
X X X+X X X X.X
0 0 0 0 0 0
1 1 1 1 1 1
A) X + 1 = 1 B) X.0 = 0
X 1 X+1 X 0 X.0
0 1 1 0 0 0
1 1 1 1 0 0
De Morgan's Law
A) X + Y = X . Y B) X . Y = X + Y
Activity 4.2
If X, Y and Z are Boolean variables, simplify the following Boolean expressions.
1. X. (X + Y) 2. X Y + XYZ + XY
3. X.(X+Y) 4. X.Y.Z+X.Y
5. X.Y .Z+X.Y.Z+X.Y+1 6. (X+Y) . (X+Y)
5
4.3 Logic Gates
Here we discuss the three main gates and other gates made from them. These gates are used in electronic
circuites.
• AND Gate
• OR Gate Main three gates
• NOT Gate
• NAND Gate
• NOR Gate The other gates produced by them
• XOR Gate
AND Gate
The 'AND' gate physically represents an 'AND' operation. The symbol for it is given in Figure
Let's consider the circuit shown in Figure 4.2 to get an idea about the function of this. Here 'A' and 'B'
switches are connected serially and when only both switches are closed (On) current passes through the
circuit. In any other situation current is not passing through the circuit. This circuit can take two values
for switch 'A' and 'B'(On or Off). Therefore 'A' and 'B' can be considered as two Boolean variables.
OR Gate
Logical addition can be physically represented by an 'OR' gate. This is represented by the figure 4.4
The symbol of an OR gate is shown in Figure 4.4 The output is 1 if at least one if the two inputs is zero.
'A' and 'B' switches are connected parallel in the above circuit. When only both of them are open (Off)
current does not pass through the circuit and in all other situations it does.
6
Activity 4.3
Construct the Truth Table for the above gate.
NOT Gate
Logical 'NOT' operation is physically represents by the 'NOT' gate. The symbol for this is given in Figure
4.5.
Table relevant to the above figure is as given in Table 4.14.
A NOT A (A’)
0 1
1 0
Combined logic gates are made by combining several basic logic gates. NAND, NOR and XOR can be
cited as examples.
A NAND B= A . B = A + B
A B A.B A NAND B
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
The NAND gate is depicted in the following diagram. When A and B swiches are on current flows in the
first circuit. When A and B switches are off, the current flows in the second circuit lighting the bulb
When only A and B switches are in ON position the bulb does not burn.
The NAND gate is used for electric circuits and ICs. NAND gate is available in the market to be bought.
Low resistance prevents short circuiting.
7
• Forming an OR gate using NAND gates
The result obtained by a combination of the OR gate and NOT gate is the NOR gate.
A NOR B = A + B = A . B
The Truth Table relevant to this is given below.
A B A+B A NOR B A simple circuit relevant to the NOR gate is given below
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
The bulb burns only when both the keys A and B are in OFF position. In all the other situations the bulb
does not burn.
The name XOR is obtained through the meaning ' exclusive OR'; that is only one of the inputs should be
1 for the output to be 1. The symbol for XOR is depicted in Figure
A B A+B
0 0 0
0 1 1
1 0 1
1 1 0
Activity4.5
Represent OR and NOT gates using NOR gate.
• XNOR gate
XNOR gate is shown in the
following figure
8
The truth table of XNOR is as follows
A B A+B
0 0 1
0 1 0
1 0 0
1 1 1
Designing Logical Circuits Related to Boolean Expressions
Let us design a circuit with logic gates to get Boolean expression Q=A.(A+B)+B.
There are two inputs in this circuit. These are A and B. The logical circuit for the above Boolean
expression is given below.
Activity
1). Write the Boolean expressions relevant to the following circuits
3). Draw circuits for the Boolean expressions given below and construct the related truth tables.
(a) A+A.B
(b) A.(A+B)
(c) (A+B).(A.C)
9
4). Write Boolean expressions for the circuits given below and construct Truth Tables.
10
Integrated Circuits
Integrated Circuits (ICs) are used to construct electronic circuits. A complex electronic circuit consists of
various circuits. For instance, a modern television circuit and a mobile phone consist of many circuits. An
integrated circuit is a type of circuit designed for a certain function with devices such as transistors,
resistors, capacitors and diodes. Now there are methods to produce circuits in small sizes so that one
circuit can be packed in one. Circuits produced in this way are called integrated circuits.
As per Figure 4.23, a microprocessor is made of a large number of integrated circuits which use logic
gates. In these integrated circuits, there are logic gates. For instance, Figure 4.22 is a logic circuit which
uses an AND gate. Thus, there are integrated circuits designed with the logic gates.
In this integrated circuit (Figure 4.22), 1, 2, 4, 5, 9, 10, 12 and 13 pins are inputs. 3, 6, 8 and 11 pins are
outputs. Figure 4.23 is the external appearance of an integrated circuit which consists of 16 pins.
Activity
1. Consider the Integrated Circuit given below. (Figure 4.24)
11
2. In the Integrated Circuit given below (Figure 4.34), if pins 1 = 1 and 2 = 1, what
is the value of 3?
12
Example 2
Circuits designed to control street lights.
Following Figure 4.29 is a circuit designed using logic gates to control street lights. This is designed
using a dark / light sensor, timer and a manual switch.
There are several occasions when the lights are on. These are,
• When only the manuals switch is closed
• When the input of the timer is 1 and when the environment is dark
• When only the manuals Switch is closed
When the manual switch is closed, its input is 1. Hence, the light is on.
When the input of the timer is 1 and when the environment is dark
If the time is in the range of two pre-arranged ranges the input is 1 and otherwise 0. This means, the input
is 1 when time is from 6 pm and 6 am, and the input is 0 when from 6 am to 6 pm. Further, the light
sensor will be 1 when there is light above pre-arranged value and it will be 0 when it is dark. Here, the
street light will be on when the timer’s input is 1 and light sensor’s value is 0. When the environment is
gloomy with a rain cloud, the street light will not be on though the light sensor’s value is 0 if the time is
not between 6 am and 6 pm.
13
Activity
A motor car manufacturing company has manufactured a motor car protecting circuit to warn if there is a
movement in the car when the engine is not on or when there is damage to a shutter. This has three
sensors to detect whether the engine is on and another sensor to detect whether there is a damage to a
shutter. Another sensor is there to detect whether the car is moving.
This circuit is designed with three basic circuits. One of these is a NOT gate and the other two gates
should be included in the empty boxes. What are the logic gates suitable for these?
Activity
14
Postulates / Axioms
In Boolean algebra postulates / axioms means starting of the logic situation. This is accepted all without
any obligations.
Laws / Theorems
9. x’’= x
Variable Properties
Below laws are used different types of variables to build a standard in logic that use to the Boolean
algebra.All of these laws can be assured using a truth table.
Commutative Law
10a. x . y = y . x 10b. x + y = y + x
Associative Law
11a. x . ( y . z ) = ( x . y ) . z 11b. x + ( y + z ) = ( x + y ) + z
Distributive Law
12a. x . ( y + z ) = x . y + x .z 12b. x + y . z = ( x + y ) . ( x + z )
Absorption Law
13a. x + x . y = x 13b. x . ( x + y ) = x
Idempotent Law
14a. x + x = x 14b. x . x = x
15
Combining Law
15a. x . y + x . y’ = x 15b. ( x + y ) . ( x + y’ ) = x
De Morgan’s Law
16a. ( x . y )’ = x’ + y’ 16b. ( x + y )’ = x’ . y’
17a. x + x’ . y = x + y 17b. x . ( x’ + y ) = x . y
Consensus Law
18a. x . y + y . z + x’ . z = x . y + x’ . z 18b. ( x + y ) . ( y + z ) . ( x’ + z) = ( x + y ) . ( x . z )
Boolean expressions can be changed two major parts without changing their content.
1. Sum of Products (SOP) – If AND gates are connected with OR gate SOP can be produced.
2. Product of Sum (POS) – If OR gates are connected with AND gate POS can be produced.
By using above methods evaluation, simplification and implementation processes can be done as easily
and standard way.
Sum of products expression mean addition (OR gate) of two or more boolean algebra products (AND
gates).
When consider the example of AND gate with truth table, which is having 3 inputs.
A B C A.B.C
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
16
According to above picture output becomes 1 when all inputs are 1 only. But some situation output
should be changed according to below table.
Step 01
To getting the output is 1 of number 1 row, output of A and B need to take as 1. To do this A’B’C
products need to be built.
Step 02
To getting the output is 1 of number 2 row, output of A needs to take as 1. To do this A’BC products
need to be built.
Step 03
To getting the output is 1 of number 3 row, output of C needs to take as 1. To do this ABC’ products
need to be built.
Step 04
Example 01
17
Product of Sum - POS
In boolean algebra two or more OR values can be multiplied and produced product of sum value.
Eg: Here circled additions are multiplied and get the result as 0.
According to the above picture output becomes 0 when all 3 inputs have 0. If any situation output can be
changed as below table,
When writing as sum of product (SOP) expression that is very large because six of the outputs become 1.
In this situation short method is to use product of sum (POS).
Step 01
Step 02
Step 03
These additions (sums) need to multiply (AND) and get the final result.
18
Eg 01: Here the product of sum (POS) expression is:
Z = ( X + Y ) ( X’ + Y’ )
Sum of Product (SOP) convert into Product of Sum (POS) and Invert.
There are two ways to convert Sum of Product (SOP) expressions into Product of Sum (POS)
expressions. They are;
1st Method
F = xy’ +yz’ is sum of product expression. To convert this into Product of Sum need to use Distributive
Law.
F = (xy’) + y.z’
2nd Method
= (xy’)’.(yz’)’
Simplifying complex Boolean expressions give simple and clear output. There are two methods to
simplify. They are;
When simplify Boolean expressions using Boolean theorem we must know Postulates / Axioms and
Laws / Theorems well. All simplifications are depend on above all.
Simplification (A + 1 = 1
Simplification (1A = 1
Simplification (A + A’ = 1)
Simplification (1A= A)
Simplification (AA = A)
20
Karnaugh Maps
In 1953 Telecommunication Engineer Morris Karnaugh introduced to simplify karnaugh crcuits using
graph. When comparing wth Boolean algebra simplification, the karnaugh map simplification is very
easy.
After, all the 1 values from truth table need to add into the karnaugh map.
Now, need to get groups 1, 2, 4, 8, etc from the karnaugh map combining very closed squares those
values has been 1 (minimum groups need to create).
Finally, above groups need to be written as Boolean expressions. This expression is gained by simplified
the logic circuit. According to the inputs of the circuit, karnaugh map variables can vary.
1. 2 inputs – 4 variables
2. 3 inputs – 8 variables
3. 4 inputs – 16 variables
4. 5 inputs – 32 variables
When noticing inputs always need to change one variable in two inputs that are closed together. This
method is different than truth table variable input method.
In truth tables normal way is 0 0 , 0 1 , 1 0 , 1 1 and for the karnaugh maps 0 0 , 0 1 , 1 1 , 1 0 . Ths
method is very important rule for the karnaugh maps.
The facts that we need to consider when making groups of the karnaugh maps.
1st picture
2nd picture
Grouped values simplification using karnaugh maps, the Boolean expression can be written as a common
input/inputs.
22
Entering variables into karnaugh map and grouping of them.
Using karnaugh maps, value 1 variables get from the truth table and simplify as Sum Of Product. The
value 0 variables get and simplify as Product of Sum.
23
Exercises:
04. Study following logic gate and the simplification of Boolean expression, simplify using karnaugh
maps. Truth table is taken as Sum of Product.
24
05. Draw karnaugh map for following logic gate
25