logic gates and boolean algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-logic gates...

20
` Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14 )( 12064 – Digital Techniques) Logic Gates And Boolean Algebra 2.1 Logical symbol, logical expression and truth table of AND, OR, NOT, NAND, NOR, EX-OR and EX-NOR gates. 2.2 Universal gates – NAND and NOR gates 2.3 Logical circuits of basic gates using universal gates 2.4 Gates using more than two inputs. 2.5 TTL and CMOS logic gate ICs and their pin configurations. (To be covered in Practical) 2.6 Basic laws of Boolean algebra, Duality theorem. 2.7 De Morgan’s theorems. Logic Gates Q.1What is meaning of Word Logic Gate? Ans. The word logic is commonly used in conversation English and it is derived form Greek word “LOG” which refers to reason and the suffix “ICmeaning “the study of so logic is study of reason. Gate is another common word. The common usage of “ gate” is an opening in a wall, a means of exit or entrance. The technical definition of ‘gate’ is a natural extension of its common form . It is a device whose output is a specific when specified input condition are met. Gate A gate is a logic circuit which has one or many input and a single output. There will be an output only for certain condition of input. The logic gate is a basic building block of digital electronics. There are three basic or fundamental logic gates or logic operators. Those are 1. NOT gate 2. OR gate 3. AND gate Q.2.Describe with symbol, truth table, operation of NOT gate Ans. Not operation is referred as Inversion or Complementation The NOT gate is also called as Inverter because it only inverts the input i.e. logic 1 state at the input becomes logic 0 at the output and vice versa. NOT gate is an electronic circuit with only one input and one output signal. Logic Equation Y = A Y = NOT A 1 2

Upload: hoangkiet

Post on 13-Mar-2018

232 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

` Logic Gates and Boolean Algebra

Chapter-2 (Hours:06 Marks:14 )( 12064 – Digital Techniques)Logic Gates And Boolean Algebra2.1 Logical symbol, logical expression and truth table of AND,OR, NOT, NAND, NOR, EX-OR and EX-NOR gates.2.2 Universal gates – NAND and NOR gates2.3 Logical circuits of basic gates using universal gates2.4 Gates using more than two inputs.2.5 TTL and CMOS logic gate ICs and their pin configurations.(To be covered in Practical)2.6 Basic laws of Boolean algebra, Duality theorem.2.7 De Morgan’s theorems.

Logic GatesQ.1What is meaning of Word Logic Gate?Ans. The word logic is commonly used in conversation English and it is derived form Greek word “LOG” which refers to reason and the suffix “IC” meaning “the study of so logic is study of reason.

Gate is another common word. The common usage of “gate” is an opening in a wall, a means of exit or entrance.

The technical definition of ‘gate’ is a natural extension of its common form . It is a device whose output is a specific when specified input condition are met.

Gate A gate is a logic circuit which has one or many input and a single

output. There will be an output only for certain condition of input. The logic gate is a basic building block of digital electronics. There are three basic or fundamental logic gates or logic operators. Those are 1. NOT gate 2. OR gate 3. AND gate

Q.2.Describe with symbol, truth table, operation of NOT gateAns. Not operation is referred as Inversion or Complementation

The NOT gate is also called as Inverter because it only inverts the input i.e. logic 1 state at the input becomes logic 0 at the output and vice versa.

NOT gate is an electronic circuit with only one input and one output signal.

Logic Equation Y = A Y = NOT A

1

2

Page 2: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Y is complement of AThe presence of the small circle , known as bubble always denotes inversion in the digital circuit.

Waveform

Input (A)

Output (Y)

IC NOT Gate

Fig.IC 7404 Hex Inverter

Q.3.Describe with symbol , truth table , operation of AND gateAns. A circuit which performs an AND operation is called as AND gate. This gate has two or more inputs signals but only one output signal. The AND gate has a high output only when all inputs are high. It indicates Logical Multiplication denoted by dot (.).

Waveform of And Gate

2

Truth table

A Y0 11 0

Truth TableA B Y0 0 00 1 01 0 01 1 1

Symbol : NOT gate

A Y = A

Symbol A

Y = A . BB = A And B

Page 3: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Summary of And Function 1.When all the inputs are ‘1’ then only output is ‘1’2.Output is equal to ‘0’ when one or more inputs are ‘0’3.The And operation is performed exactly same as ordinary multiplication of 1s and 0s

AND Gate IC ( 7408 Quad Two Input AND gate )

Fig.IC 7408 Quad 2Input AND gateQ.4. Describe with symbol , truth table , operation of OR gateAns. An electronics circuit which performs OR Function is called as OR gate.The OR gate has two or more inputs signal but only one outputs signal. If any or all input signal is high the output signal is high. It indicates logical addition and denoted by + sign.

Symbol Wave form of OR Gate

3

Truth Table A B Y0 0 00 1 11 0 11 1 1

Page 4: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

OR Gate IC ( 7432 Quad Two Input OR gate )

Fig.Quad 2-Input OR gateSummary of OR Function

1.When any of the inputs is ‘1’ the output of OR function is ‘1’2.Output is equal to ‘0’ when all inputs are ‘0’3.With OR operation 1+1 =1 , 1+1+1=1 , 1+1+1+1=1 ……. and so on

Q.5.Draw the symbol and write the truth table for 3 input OR and AND GateAns.3 – Input OR Gate

4

ABC

Y = A + B + C Truth TableInput OutputA B C Y=A+B+C0 0 0 00 0 1 10 1 0 10 1 1 11 0 0 11 0 1 11 1 0 11 1 1 1

Page 5: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

3 – Input AND Gate

IC numbers for 3 Input gates

//Diagram

Q.6.Why NAND and NOR gates are called as Universal gatesAns. Any Boolean (or logic) equation can be realized by using the AND, OR & NOT gates. From these three operation two more operations are derived

1) The NAND operation ( AND + NOT) 2) The NOR operation ( OR + NOT )

These operation have before very popular and are widely used. The reason being the only one type of gates either NAND or NOR are sufficient for the realization (implementing ) of any logical operation. Because of this reason NAND and NOR gates are known as universal gates.

Using theses gates one can realize any given logical expression like AND , OR , NOT ,XOR , XNOR , as a result they are called as Universal Logic Gates

Q.7.Describe with symbol , truth table , operation of NAND gateAns.NOT Operation followed by AND operation(AND+NOT)

5

ABC

Y = A . B . C

Truth TableInput OutputA B C Y=A+B+C0 0 0 00 0 1 00 1 0 00 1 1 01 0 0 01 0 1 01 1 0 01 1 1 1

Page 6: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

The word NAND stands for NOT-AND. When a NOT gate is combined with the AND gate the resultant is NAND gate. In these with AND gate function, inversion occurs. In this gate output is high when any of the input are high , whereas output is low when all the input are high.

Symbol Truth Table Wave form

Equivalent and Symbols of NAND Gate Note : Bubble indicate inversion and Bar on the equation indicates the inversion

The NAND gate has two or more inputs but only one output. All the inputs must be set to high to get a low output. If any input is low output is high.

Fig. Quad 2 Input NAND Gate

A B Y0 0 10 1 11 0 11 1 0

6

Page 7: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Q.8.Describe with symbol , truth table , operation of NOR gateAns. The word NOR stands for NOT-OR. When a Not gate is combined with the OR gate in cascade the resultant gate is known as NOR gate. Here together with OR gate inversion takes place.Symbol Truth Table Waveform

A B Y0 0 10 1 01 0 01 1 0

Equivalent and symbol of NOR gate

The NOR gate has two or more inputs but only one output. In NOR gate all must tied high to get output logic low. If any input is high output is low.

Fig.Quad 2-Input NOR gate

7

Page 8: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Q.9.Describe with symbol , truth table , operation of EXOR gateAns. Exclusive-OR or Ex-OR is called Ex-OR because it is special case of OR gate. It is not a basic operation and can be performed using basic gates AND, OR, NOT or universal gates (NOR and NAND).

Truth TableA B Y0 0 00 1 11 0 11 1 0

Symbol and Equation of Ex-OR gate waveform Truth Table The EXOR gate has two or more inputs but only one output. For an

EXOR gate if odd number of inputs are 1 then output is logic 1 and if even number of input are same then output is logic 0.

For two input EXOR gate, then output of gate is logic 1 if both the inputs are different (i.e. one input as logic 0 and other as logic 1). The output is logic 0 if both input are same i.e. either logic 0 or logic 1.Basic Property

The property of the gate is that output is HIGH only if ‘ODD’ number of the inputs are HIGH. If EVEN number are HIGH then the output is LOW.

8

Comparison of GatesTruth table - OR gate

Truth table - EX-OR gate

A B Y A B Y0 0 0 0 0 00 1 1 0 1 11 0 1 1 0 11 1 1 1 1 0

If we compare truth table of EXOR gate with OR gate then in truth table three rows are same, only fourth row is different. Hence it is named as EXOR which excludes the condition of OR gate ,where both A and B are 1 and normal OR operation is called as Inclusive OR.

Page 9: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Fig.Quad 2-Input ExOR Gate

Q.10. Describe with symbol , truth table , operation of EXNOR gateAns.

This gate is NOT followed by EX-OR gate. The output of EX-OR gate is logic 1 when both the inputs are same i.e. logic 0 or logic 1. The output is logic 0 when both the inputs are different i.e. one held at logic 0 and another at logic 1.

EXNOR is complement of EXOR operation.

Symbol and equation Truth Table Waveform

A B Y0 0 10 1 01 0 11 1 0

Q.11.Prove NAND Gate as Universal Logic or Prove NAND Gate as NOT, OR, AND, EXOR

Ans.1) NAND as NOT gate

Y = A.B = X.X Let B = A = X Since A.A =A

Y = X which equation for Not Gate

A B Y Analysis0 0 1 For all input = O , output is 10 1 1 -----------1 0 1 -----------1 1 0 For all input = 1 , output is 0

An Inverter can be made form NAND gate by connecting all of the inputs together and taking a single input as shown in the figure

9

Page 10: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

2) NAND as AND gate An AND function can be generated using only NAND gates. It is

generated by simply inverting output of NAND gate. Fig. shows the two input AND gate using NAND gates.

Fig. And gate using Nand gate

Output of 1ST NAND gateX = A.B

Output of 2nd NAND gateY = X Y = A.B = A.B

Which is same as for And gate.3) NAND as OR gate

Or gate can be designed using the Nand Gate as follows

Fig. Nand gate as Or Gate

10

Page 11: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Y = A.B = A + B By DMT = A + Bsince A = Athis is the Equation for OR gate

Note : Bubble at the input of NAND gate indicates inverted input.

4) NAND as EX-OR gate:Y = X.Z = AB . AB BY D.M.T = AB + AB = A ⊕ B

Which is same for EX-OR gate

Q.12.Prove NOR Gate as Universal Logic or Prove NOR Gate as NOT, OR, AND, EXOR

Ans.

Basic gates using NORgate1) NOR as NOT gate: An inverter can be made from a NOR gate by

connecting all of the inputs together and making a single common input, as shown in Fig.

Logic Circuit

Y = A+B = X+X Truth table = X

Since A.A =A this is the Equation for NOT gateBoolean Equation

2) NOR as OR gate : An OR function can be generated using only NOR gates. It can be generated by simply inverting output of NOR gate. Fig shows the two input OR gate

11

Page 12: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Output of 1ST NAND gate X = A+BOutput of 2nd NAND gate

Y = X

Y = A+B = A+B

Same as that of OR gate

3) NOR as AND gate: And Can be designed using NOR as Follows

` Y = A+B = A.B

=

A.B By DMTSame as that of AND Gate

Fig. Nor as And gate logic diagram Boolean Equation

12

Page 13: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Truth TableNote : Bubble at the input of NOR gate indicates inverted input.

4) NOR as EX-NOR gate ( For Students)

Y = (A+B)+(A+B) = AB + AB

= A Ο BSame as that of EX-

NOR gate

Q.13.Implement EXOR gate using Basic GateAns.Ex-OR gate using Basic Gates ExNor Using Basic Gates

(For Students)

Boolean Laws and Demorgans TheoremThe rules for manipulation of binary numbers developed English

mathematician George Boolea are known as Boolean Algebra. This the basic of all digital systems like computer, calculator etc. A Boolean variable has two values 1 and 0’s (high or low, true or false). The basic Boolean operation are AND,OR,NOT.

Q.14.How Boolean Algebra differ Conventional Algebra Ans. Basic of Boolean Algebra Logical algebra differs from conventional algebra in three respects

13

Page 14: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

1. The symbols used in logical algebra (usually) letters, do not represent numerical values.

2. Arithmetic operations are not performed in logical algebra. In Boolean Algebra there are no fractions , decimals , negative numbers , square root ,cube root, logarithms , imaginary numbers and so on.

3. Third and very important point is logical algebra allows only two possible values ‘1’ and 0’s for any variables.

Thus logical algebra is ideally suited for the system based on the two opposite values such as ON and OFF.

Q.15.List and Describe different Boolean LawsAns.Laws of Boolean Algebra

1. And Law2. OR Law3. Double Complementation Law4. Commutative law5. Associative Law6. Distributive Law

The AND law The AND operation or ANDing is similar to multiplication. The AND

law Says a) A.0=0 b) A.1=A c) A.A=A d) A.A=0

The OR lawThe OR operation or ORing mean adding two Boolean variables. The OR laws are

a) A+0=A b) A+1=1

c) A+A=A

d) A+A=1

Double complementation LawComplementation means inversion and law of complementation

results from the NOT operation. The law statea) 0 = 1 if A = 0b) 1 = 0 if A = 1

A = A i.e. called as double Inversions.

Cumulative law

14

Page 15: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

The Cumulative law states that the order in which an operation is performed on a pair of variables does not affect the result of operation. In Boolean operation order of variables in OR and AND is insignificant ie Cumulative law allows the changes of position of and OR and AND variables. Thus

a) A+B = B+Ab) A.B = B.A

Proof by perfect induction method.

A B A+B B+A A B A.B B.A0 0 0 0 0 0 0 00 1 1 1 0 1 0 01 0 1 1 1 0 0 01 1 1 1 1 1 1 1

Law (a) Proved Law (b)Proved

Law can be proved by perfect induction method.

Associative Law Law 1

The associative law that one can group any two terms of sum ,or any two of a product. In other words it allows grouping of variables. Ie This states that ORing of several variable the result is the same irrespective of the grouping of variables.Thus

A+(B+C) = (A+B)+CThe above laws can be proved using induction methodProof by perfect induction method

A B C B+C A+B A+(B+C) (A+B)+C0 0 0 0 0 0 00 0 1 1 0 1 10 1 0 1 1 1 10 1 1 1 1 1 11 0 0 0 1 1 11 0 1 1 1 1 11 1 0 1 1 1 11 1 1 1 1 1 1

Logical Implementation

== >

15

Page 16: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Law 2 The associative law of multiplication states that it makes no difference in what order the variables are grouped when ANDing several variables. As shown in Fig. This law as applied to AND gates.

A.(B.C) = (A.B).CThe above laws can be proved using induction methodProof by perfect induction method

A B C B.C A.B A.(B.C) (A.B).C0 0 0 0 0 0 00 0 1 0 0 0 00 1 0 0 0 0 00 1 1 1 0 0 01 0 0 0 0 0 01 0 1 0 0 0 01 1 0 0 1 0 01 1 1 1 1 1 1

Logical Implementation

== >

Distributive law The distributive laws states that factoring or multiplication of different term in an expression is allowed. They are expressed ad follows:

a) A.(B+C) = AB + ACb) A+(B.C) = (A+B)(A+C)

LAW 1 :The distributive law states that ORing several variables and

ANDing the result with a single variable is equivalent to ANDing the result with a single variable with each of the several variables and then ORing the products. The Fig. illustrates this law in terms of gate implementation.Proof by perfect Induction Method

A.(B+C) = AB + AC A+(B.C) = (A+B)(A+C)

A B C B+C A.B A.C A.(B+C) A.B+A.C A+(BC) (A+B)(A+C)0 0 0 0 0 0 0 0 0 00 0 1 1 0 0 0 0 0 00 1 0 1 0 0 0 0 0 00 1 1 1 0 0 0 0 1 11 0 0 0 0 0 0 0 1 1

16

Page 17: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

1 0 1 1 0 1 1 1 1 11 1 0 1 1 0 1 1 1 11 1 1 1 1 1 1 1 1 1

Logical Implementation of the Law 1

LAW 2 The distributive law states that ORing several variables and

ANDing the result with a single variable is equivalent to ANDing the result with a single variable with each of the several variables and then ORing the products. The Fig. illustrates this law in terms of gate implementation.Proof by perfect Induction Method

A.(B+C) = AB + AC A+(B.C) = (A+B)(A+C)

A B C B+C A.B A.C A.(B+C) A.B+A.C A+(BC) (A+B)(A+C)0 0 0 0 0 0 0 0 0 00 0 1 1 0 0 0 0 0 00 1 0 1 0 0 0 0 0 00 1 1 1 0 0 0 0 1 11 0 0 0 0 0 0 0 1 11 0 1 1 0 1 1 1 1 11 1 0 1 1 0 1 1 1 11 1 1 1 1 1 1 1 1 1

Q.16.State and Prove Demorgan’s TheoremAns. This theorem are named behind the discoverer Bas Augustus Demorgan . The use of these theorems enables us to realize OR operation by using AND-NAND family gates or vice-versa.

Demorgans 1st theorem Demorgan 1st theorem states that “The complement of a sum is

equal to the product of the complement”.A+B = A.B

Proof: By perfect induction method or by truth table.

LHS RHSA B A+B A+B A B A.B0 0 0 1 1 1 1

17

Page 18: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

0 1 1 0 1 0 01 0 1 0 0 1 01 1 1 0 0 0 0

Therefore LHS = RHS Hence Theorem is proved two truth table are identical.Fig. Logical Implementation of DMT1

Hence according to Demorgan’s 1st theorem NOR gate = Bubbled AND gate

Demorgan’s 2nd theoremThe second theorem states that “ The complement of a product is

equal to the sum of the complement.”

A.B = A+B Proof: By perfect induction method:

LHS RHSA B A.B A.B A B A+B0 0 0 1 1 1 10 1 0 1 1 0 11 0 0 1 0 1 11 1 1 0 0 0 0

Therefore LHS = RHS Since two truth table are identical hence Demorgan’s 2nd theorem is proved.

LHS = A.B RHS = A+B∴LHS = RHS

Hence it is proved that NAND gate = Bubbled OR gate.

18

Page 19: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Note. For Simple remembrance it is Change the Sign and Break the Line

Q.17.State and Prove Duality TheoremAns.The duality theorem is one of those elegant theorems proved in advanced mathematics. Duality theorems says, starting with a Boolean relation, one can derive another Boolean relation by

a) Change each OR sign to AND sign.b) Change each AND sign to OR sign.c) Complementing any 0 to 1 appearing in the expression.

A+0 = A A.1 = A

This dual property is obtained by changing the OR sign to an AND sign and by complementing the 0 to get 1.E.g.: A(B+C) = AB+AC

By changing each OR and AND operation we get the dual relationAB+AC = (A+B)(A+C)

By changing each AND and OR operation we get the dual relationA+BC = (A+B)(A+C)

Same can be proved using truth table method. Expected by the students

Q.18.List all the standard Theorems used in Boolean Algebra Ans.Standard Theorems

Boolean Theorems1. A+0=A 2. A.1=A3. A+1=1 4. A.0=05. A+A=A 6. A.A=17. A+A=1 8. A.A=09. A.(B+C) = AB+AC 10. A+BC=(A+B)(A+C)11. A+AB=A 12. A(A+B)=A13. A+AB=(A+B) 14. A(A+B)=AB15. AB+AB=A 16. (A+B)(A+B)=A17. AB+AC =(A+C)(A+B) 18. (A+B)(A+C)=AC+AB19. AB+AC+BC=AB+AC 20. (A+B)(A+C)(B+C)=(A+B)(A+C)

21. A.B.C . . .= A+B+C... 22. A+B+C+ . . . = A.B.C . . .

Board Solved QuestionsQ.19.Solve using Boolean AlgebraAns. Y = (A+B)(A+C)

= AA +AC +AB + BC= A + AC + AB + BC since A.A = A= A(1+C+B) +BC Since 1+C+B = 1

19

Page 20: Logic Gates and Boolean Algebra - kavediasirkavediasir.yolasite.com/resources/chapter-2-Logic Gates and Boolean... · `Logic Gates and Boolean Algebra Chapter-2 (Hours:06 Marks:14

Y= A+BC

Q.20.

20