Module -6 Boolean algebra - INFLIBNET Centre

12
1 Electronic Science Digital Electronics 6. Boolean Algebra Module -6 Boolean algebra 1. Introduction 2. Boolean Algebra 3. Postulates, Laws and Theorems of Boolean algebra 4. Simplification of Boolean Expressions 5. De Morgan’s theorem 6. Duality principle 7. Realization of Logic circuit/Boolean Algebra 8. Summary Learning objectives: 1. Learn basic rules, laws and theorems of Boolean Algebra 2. Simplify logic expressions using Boolean Algebra 3. Understand De Morgan’s theorem 4. Interconvert Boolean expression to logic circuit and vice versa 1. Introduction In 1854 George Boole published a book on Laws of thought. George Boole the great mathematician suggested that logical thought could be represented through mathematical equations. Boolean algebra is the mathematical basis for all logic designs. The applications of Boolean algebra to the design and analysis of digital circuits was explored by Shannon in 1938. Through his work on switching algebra, he has demonstrated that any circuit consisting of switches can be represented by mathematical expression. Every digital system designer requires to focus on the cost, speed and size as the performance parameters. One can use the rules, laws and theorems of Boolean algebra to minimize number of variables, number of operations and no of logic gates. This will not only reduce the number of logic gates for implementation but also reduce the cost as well as size of the design.

Transcript of Module -6 Boolean algebra - INFLIBNET Centre

Page 1: Module -6 Boolean algebra - INFLIBNET Centre

1

Electronic Science Digital Electronics 6. Boolean Algebra

Module -6

Boolean algebra

1. Introduction

2. Boolean Algebra

3. Postulates, Laws and Theorems of Boolean algebra

4. Simplification of Boolean Expressions

5. De Morgan’s theorem

6. Duality principle

7. Realization of Logic circuit/Boolean Algebra

8. Summary

Learning objectives:

1. Learn basic rules, laws and theorems of Boolean Algebra 2. Simplify logic expressions using Boolean Algebra 3. Understand De Morgan’s theorem 4. Interconvert Boolean expression to logic circuit and vice versa

1. Introduction

In 1854 George Boole published a book on Laws of thought. George Boole the great mathematician suggested that logical thought could be represented through mathematical equations. Boolean algebra is the mathematical basis for all logic designs. The applications of Boolean algebra to the design and analysis of digital circuits was explored by Shannon in 1938. Through his work on switching algebra, he has demonstrated that any circuit consisting of switches can be represented by mathematical expression.

Every digital system designer requires to focus on the cost, speed and size as the performance parameters. One can use the rules, laws and theorems of Boolean algebra to minimize number of variables, number of operations and no of logic gates. This will not only reduce the number of logic gates for implementation but also reduce the cost as well as size of the design.

Page 2: Module -6 Boolean algebra - INFLIBNET Centre

2

Electronic Science Digital Electronics 6. Boolean Algebra

This module is dedicated to understand Boolean Algebra, its use in simplification of Boolean Expression and designing the logic circuits.

2. Boolean Algebra

Boolean algebra is an algebra for binary number system. Unlike traditional algebra, Boolean algebra is easy to learn. It operates only on two numbers 0 & 1. There are only three operations: addition, multiplication, and complementation. The algebra of a number system basically describes how to perform arithmetic using the operators of the system acting upon the system's variables.

Boolean algebra describes the arithmetic of a two-state system and is therefore the mathematical language of digital electronics. The variables in Boolean algebra are represented by symbols such as A, B, C, X, Y etc.

The rules of Boolean algebra are different from those of conventional algebra in the following aspects:

1. Symbols used in Boolean algebra do not represent numerical values. 2. Arithmetic operations (addition, subtraction, multiplication, division etc.) is not

performed are not performed in Boolean Algebra. E.g. 1+1 is not 2. 3. There are no fractions, negative numbers, squares etc. 4. Boolean algebra allows only two possible values (0 and 1) or (L or H) for any variable.

These variables represent the input and output state (e.g. voltage in a circuit). These states can be represented by ‘0’ or ‘1’in Boolean algebra.

Figure 1: Binary variables, operations and functions

Fig. 1 indicates that in the Boolean algebra, Binary variables can take either of two values 0 and 1 (TRUE or FALSE), where as in traditional algebra variable can have any value up to infinity.

Page 3: Module -6 Boolean algebra - INFLIBNET Centre

3

Electronic Science Digital Electronics 6. Boolean Algebra

There are three basic operations

‒ Boolean product

‒ Boolean Sum

‒ Boolean complementation

Boolean functions are implemented using combination of these operations. Addition and multiplication are two basic operations performed on the binary variables.

Boolean algebra has only three operators: NOT, AND and OR. Digital logic circuits are simply circuits built out of these gates (operations) introduced above. Boolean algebra provides techniques for describing, analyzing and designing their operation.

The variables can have only two values. Binary 1is used for HIGH and Binary 0 for LOW. Complement of a variable is represented by over bar ( �) or (‘). ORing of a variables is represented by (+) sign between them. Logical ANDing of two or more variables is represented by a dot between them. Sometimes the dot between the variables may be ignored.

The operation of the three basic gates and their Boolean descriptions, are Y= A’ or �̅, Y= A.B and Y= A + B.

Boolean function has at least a variable and a operator. A variable is usually an uppercase letter to represent a logical quantity. A variable can have a 0 or 1 value. Complement is the inverse of a variable and indicated by a bar or single quote. E.g. complement of A is known as Not A or A bar.

Boolean expression can contain sum or product terms or combination of both.

Y= A .B

Z= C. D. E

W= F.G.H.K

As indicated here Boolean expressions are in AND form i.e. containing only product terms.

Where as P= A +B and Q= C+D+E indicates Boolean expressions in sum form. We can even get sum and product terms in an expression as shown below.

F(A,B,C,D) = (A.B)+(C.D)

Page 4: Module -6 Boolean algebra - INFLIBNET Centre

4

Electronic Science Digital Electronics 6. Boolean Algebra

3. Postulates, Laws and Theorems of Boolean algebra

Boolean algebra is useful mathematical tool normally used to analyze a logic circuit and express its operation mathematically. It also plays an important role in designing digital system. The basic laws and theorems are normally utilized for minimization of Boolean expressions. Let us first discuss the important postulates of Boolean algebra.

Fig. 2 shows some of the important postulates of Boolean algebra. Axioms or Postulates are a set of basic logical expressions those are accepted as it is without proof. These postulates are normally used to build a set of useful laws and provide foundation to Boolean algebra. Really speaking postulates are nothing but representation of basic logical operations with binary values. Each postulate can be explained with the help of basic operations performed by AND, OR and NOT gates. Boolean algebra has its own set of fundamental rules which differ from the real algebra.

Figure 2: Postulates of Boolean algebra

Similarly, 0’ = 1 and 1’=0 are two additional postulates related to complementation i.e. inverter or NOT gate. Many theorems of Boolean algebra are based on these postulates, which can be used to simplify Boolean expressions. Let us now discuss Boolean theorems. Let us now understand simple rules of Boolean algebra and study them in comparison with the real algebra.

Laws of Boolean Algebra

The rules, laws and theorems of Boolean algebra can be used to simplify many a complex Boolean expression and also to transform the given expression into a more useful and meaningful equivalent expression. Similar to real algebra, the Boolean algebra also possess certain well – defined rules and laws. Let us now discuss the most important laws of Boolean algebra.

(I) Identity Law : A term ANDed with a ‘1’ or ORed with ‘0’ equal to that term.

1. A.1=A [A variable ANDed with 1 is always equal to the variable.]

Page 5: Module -6 Boolean algebra - INFLIBNET Centre

5

Electronic Science Digital Electronics 6. Boolean Algebra

2. A+0=A [A variable ORed with 0 is equal to the variable.]

Figure -3: Verification of Identity law

(II) Null Law : A term ANDed with a ‘0’ equals to 0 or ORed with ‘1’ will equal 1.

3. A.0=0 [A variable ANDed with 0 is always equal to 0.]

4. A+1=A [A variable ORed with 1 is always equal to 1.]

Figure -4: Verification of Null law

(III) Idempotent Law: An input that is ANDed or ORed with itself is equal to the input.

5. A.A = A [A variable ANDed with itself is always equal to the variable] 6. A+A =A [A variable ORed with itself is always equal to the variable]

Figure -5: Verification of Idempotent law

(IV) Inverse Law: A term ANDed with its complement equals ‘0’ and a term ORed with its

complement equal 1.

7. A.�� =0 [A variable ANDed with its complement is always equal to 0]

8. A+�� =1 [A variable ORed with its complement is always equal to 1]

Figure -6: Verification of Inverse law

Page 6: Module -6 Boolean algebra - INFLIBNET Centre

6

Electronic Science Digital Electronics 6. Boolean Algebra

(V) Double complementation: A term that is complemented twice is equal to the original term.

9. A ̿ = A [ A double complementation of a variable is always equal to the variable]

(VI) Commutative Law: This law indicates that the order of application of two separate terms is not important.

10. A.B = B.A [ The order in which two variables are ANDed makes no difference on the

Result.]

11. A+B=B+A [ The order in which two variables are ORed makes no difference on the

Result.]

Figure -7 : Verification of Commutative law

(VII) Associative Law: This law enables the removal of the brackets from the expression and regrouping of the variables.

12. A.(B.C)= (A.B).C

13. A+(B+C) = (A+B) +C

(VII) Distributive Law: This law allows the multiplying or factoring out an expression

14. A.(B+C) = A.B +A.C

15. A+(B.C)= (A+B).(B+C)

(VIII) Absorptive Law: This law permits a reduction of a complicated expression to a simpler one by absorbing similar terms.

16. A.(A+B)=A

17. A+(A.B)=A

A B A.B B.A 0 0 0.0=0 0.0=0 0 1 0.1=0 1.0=0 1 0 1.0=0 0.1=0 1 1 1.1=1 1.1=1

A B A+B B+A 0 0 0+0=0 0+0=0 0 1 0+1=1 1+0=1 1 0 1+0=1 0+1=1 1 1 1+1=1 1+1=1

Page 7: Module -6 Boolean algebra - INFLIBNET Centre

7

Electronic Science Digital Electronics 6. Boolean Algebra

4. Simplification of Boolean expression

Let us consider several examples to understand the applications of Boolean algebra in

simplifying the expressions and to reduce the number of variable or the terms present in the

Boolean function or expression.

Ex-1: A+(A.B) = A.A +A.B (distributive law)

= A +AB = A.(1+B) = A .1 = A Ex-2: Simplify the Boolean Expression

Ex-3: Simplify the Boolean Expression

5. De Morgans’s theorems

De Morgan, a mathematician and a logician, proposed two theorems to enrich the Boolean

algebra.

Theorem-1: The complement of product is equal to the sum of complements. It also states that

the complement of two or more variables ANDed together is equivalent to ORing of

complements of individual two or more variables.

ZX.Y.ZZ.XY.XZ)Y,f(X, +++=

ZYX

ZYY.X

Y.ZY.XZ

Y.ZY.X)X(XZ

++=

++=

++=

+++=

.C).MB(A.C)B(AC)B,f(A, +++=

.C)B(A

.C).1B(A

M).C).(1B(A

+=

+=

++=

Page 8: Module -6 Boolean algebra - INFLIBNET Centre

8

Electronic Science Digital Electronics 6. Boolean Algebra

A

B

A

B

� + ��������� � �. � �

A

B

� � + ��

� . �������= � � + ��

Figure 8: De Morgan’s theorem - I

From the equivalent circuits and truth table, it is evident the NAND gate is equivalent to Bubbled

OR gate. This law is applicable and extended to any number of variables and combination of

variables. For example,

� . � . � . � . � ������������������= � � + � � + � � + � � + � �

Theorem-2: The complement of sum is equal to the product of complements. It also states that

the complement of two or more variables ORed together is equivalent to the ANDing of the

complements of individual two or more variables.

� + ���������= � �. � �

Figure -9: Verification of De Morgan’s theorem - II

From the equivalent circuits and truth table, it is evident the NOR

gate is equivalent to Bubbled AND gate. This law is applicable and extended to any number of

variables and combination of variables. For example

� + � + � + � + �������������������������= � �. � �. � �. � �. ��

A B � . ������� � � + ��

0 0 1 1

0 1 1 1

1 0 1 1

1 1 0 0

A B � + ��������� � �. � �

0 0 1 1

0 1 0 0

1 0 0 0

1 1 0 0

A

B

� . �������

Page 9: Module -6 Boolean algebra - INFLIBNET Centre

9

Electronic Science Digital Electronics 6. Boolean Algebra

At this stage it is important to note that De Morgan’s theorems can be used for transformation of

Boolean expressions from sum-of-complements or complement-of-sum forms and vice a versa.

Ex. 1: Apply De Morgan’s theorem

Points to remember regarding De Morgan’s

1. De Morgan's theorem allows large bars in a Boolean Expression to be broken up into

smaller bars over individual variables.

2. De Morgan's theorem says that a large bar over several variables can be broken between

the variables if the sign between the variables is changed.

3. De Morgan's theorem can be used to prove that a NAND gate is equal to an OR gate with

inverted inputs.

4. De Morgan's theorem can be used to prove that a NOR gate is equal to an AND gate with

inverted inputs.

5. In order to reduce expressions with large bars, the bars must first be broken up. This

means that in some cases, the first step in reducing an expression is to use De Morgan's

theorem.

Visualization of signal flow using De Morgan’s theorem

In many complex logic circuits, to determine the output of the logic circuit one needs to prepare

a truth table. Truth table for logic circuit with more than 3 variable require more than 8

combinations at input. In order determine the active condition for the output it is possible to

visualize the signal flow without referring to the truth table using following procedure.

Bubble pushing is a technique to apply De Morgan's theorem directly to the logic diagram.

1. Inspect the circuit starting from output and go back towards input.

2. Identify the active condition for the output.

C.B)(ACB)(A +=++

CBCA.CB).(A +=+=

Page 10: Module -6 Boolean algebra - INFLIBNET Centre

10

Electronic Science Digital Electronics 6. Boolean Algebra

Y Y

3. Internally change the logic gate NAND to its equivalent OR and NOR to its equivalent

AND so as keep active levels same for the interconnections.

4. Active HIGH a output be connected to active HIGH input or bubbled output be connected

to bubbled input.

Figure 10: Visualization of signal flow

Fig. 10 shows a simple circuit using interconnected NAND circuit with 4 inputs A,B,C & D to

produce output Y. One can use above mentioned procedure to visualize the single flow using De

Morgan’s theorem. Replacing output NAND by its De Morgan’s equivalent i.e. bubbled OR gate

produces interconnections of Bubbled output to bubble input gate. The output Y is HIGH if

either output of first NAND or Second NAND is LOW. The NAND gate output is low only

when both the inputs are HIGH. Thus to get Y=1, either A=B=1 or C=D=1. Please note that

there is no need to prepare the truth table to determine the active state of the circuit.

Logic gates can be De Morganized so that bubbles appear on inputs or outputs in order to satisfy

signal conditions rather than specific logic functions. An active-low signal should be connected

to a bubble on the input of a logic gate.

6. Duality Principle

Axioms or postulates for Boolean algebra are always come in pairs. If you swap + with . and 0 and 1, in one of the pair you will get the second. The duals of a Boolean expression are obtained by swapping these operators and 0 and 1. Note that the dual of any theorem in Boolean algebra is also a theorem.

Page 11: Module -6 Boolean algebra - INFLIBNET Centre

11

Electronic Science Digital Electronics 6. Boolean Algebra

The principle of duality is an important property in Boolean algebra, specifically for proving the laws and theorems. It states that every algebraic expression deducible from the postulates of Boolean algebra remains valid if the operators and identity elements are interchanged. If the dual of an algebraic expression is desired, we simply interchange OR and AND operators and replace 1's by 0's and 0's by 1's .

For example: The dual of Boolean expression A.B + A.B is (A+B).(A+B). It is observed that the principle of duality is used extensively in proving the laws and theorems of Boolean algebra. As Boolean algebra deals with variables consisting of only two elements then we can prove both the sides are valid and equivalent.

7. Realization of Logic circuit/Boolean Algebra

Logic circuits can be realized from the Boolean expression or Boolean function can be realized

for given logic circuit. Let us understand the procedure for the same.

Realize a logic circuit from Boolean expression

1. Identify the number of terms present in logical expressions

2. Determine the logic gates required to implement each term.

3. Represent each term by a logic gate.

4. Interconnect al the logic gates to realize the Boolean expression.

5. Label the gates appropriately using the variables indicated by the Boolean

expression.

Realize a logic expression from a logic circuit

In many applications, it is necessary to analyze the given logic circuit and we have to write the

Boolean expression relating to input and output. The procedure is as follows:

1. Begin with the input side.

2. Write the expression for output of each gate.

3. Repeat the process for all remaining gates and proceed towards the output.

4. Combine all the terms to get complete Boolean expression for output.

Page 12: Module -6 Boolean algebra - INFLIBNET Centre

12

Electronic Science Digital Electronics 6. Boolean Algebra

9. Summary

Boolean algebra is a mathematical tool for simplification of Boolean expression. The algebraic method used to simplify digital circuits applies a number of Boolean laws to successively simplify complex equations. Selected laws and rules are applied, step by step, to the original equation, so as to eventually arrive at a simplified version that can be implemented with a smaller number of gates and therefore lead to a simpler circuit.

Axioms or Postulates are a set of basic logical expressions those are accepted as it is without proof. These postulates are normally used to build a set of useful laws and provide foundation to Boolean algebra. Boolean axioms help us to simplify Boolean expressions. The laws of Boolean algebra are similar in some ways to those of standard algebra, but in some cases Boolean laws are unique.

Axioms or postulates for Boolean algebra are always come in pairs. The duality principle states that every algebraic expression deductible from the postulates of Boolean algebra The duality rule can be used to change a logic expression containing both AND and OR elements to its equivalent dual expression.

The operation of a single gate could be described by using a Boolean expression. A design problem can be converted into a truth table which relates the desired outputs for all combinations of inputs. Minimizing complex Boolean expressions to their simplest form using Boolean laws and rules is a matter of choosing the most appropriate law or rule to reduce the expression step by step.

De Morgan formulated an extension to George Boole’s Algebraic logic that has become very important in digital logic. Not only is it used in the simplification of Boolean expressions but can also be used to change the function of logic gates, so that NAND gates (or NOR gates) can carry out any of the other standard logic functions of gates.

De Morgan suggested two important theorems, (1) the complement of product is equal to the sum of complements (2) The complement of sum is equal to the product of complements.

De Morgan’s theorems can also be used to visualize the single flow. In this a simple principle is used. Internally change the logic gate NAND to its equivalent OR and NOR to its equivalent AND so as keep active levels same for the interconnections. Active HIGH output be connected to active HIGH input or bubbled output be connected to bubbled input.