nand & nor...

49
NAND & NOR Implementation By : Ali Mustafa

Upload: lenhi

Post on 15-Apr-2018

235 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND & NOR Implementation

By : Ali Mustafa

Page 2: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND and NOR Implementations

• NAND & NOR gates are universal gates.

• Digital circuit are frequently constructed with NAND or NOR gates rather than AND and OR gates.

• NAND and NOR gates are easier to fabricate with electronic components and are the basic gates used in all IC digital logic families.(covering AND,OR,NOT)

Page 3: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

DeMorgan’s Law

Recall the DeMorgan’s Law:

(a + b)’ = a’ b’ (a b)’ = a’ + b’

a + b = (a’ b’)’ (a b) = (a’ + b’)’

= =

==

Page 4: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Universal Gate – NAND

I will demonstrate

• The basic function of the NAND gate.

• How a NAND gate can be used to replace an AND gate, an ORgate, or an INVERTER gate.

• How a logic circuit implemented with AOI logic gates can be re-implemented using only NAND gates.

• That using a single gate type, in this case NAND, will reduce the number of integrated circuits (IC) required to implement a logic circuit.

4

AOI Logic NAND Logic

More ICs = More $$ Less ICs = Less $$

Page 5: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Gate

5

X Y Z

0 0 1

0 1 1

1 0 1

1 1 0

X

YY X YXZ

Page 6: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Gate as an Inverter Gate

6

X Z

0 1

1 0

X XZ

XXX (Before Bubble)

Equivalent to Inverter

Page 7: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Gate as an AND Gate

7

X Y Z

0 0 0

0 1 0

1 0 0

1 1 1

X

YY X Y XZ

YX

NAND Gate Inverter

Equivalent to AND Gate

Page 8: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Gate as an OR Gate

8

X Y Z

0 0 0

0 1 1

1 0 1

1 1 1

Equivalent to OR Gate

X

Y

YXY X Y XZ

X

NAND GateInverters

Y

Page 9: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Gate Equivalent to AOI Gates

9

INVERTERORAND

Page 10: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Process for NAND Implementation

1. If starting from a logic expression, implement the design with AOI logic.

2. In the AOI implementation, identify and replace every AND,OR, and INVERTER gate with its NAND equivalent.

3. Redraw the circuit.

4. Identify and eliminate any double inversions (i.e., back-to-back inverters).

5. Redraw the final circuit.

10

Page 11: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Implementation

11

Example:

Design a NAND Logic Circuit that is equivalent to the AOI circuit shown below.

CA C B

Page 12: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Implementation

12

Solution – Step 2

Identify and replace every AND,OR, and INVERTER gate with its NAND equivalent.

Page 13: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Implementation

13

Redraw the circuit.

Solution – Step 3

Page 14: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Implementation

14

Identify and eliminate any double inversions.

Solution – Step 4

Page 15: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Implementation

15

Solution – Step 5

Redraw the circuit.

Page 16: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Proof of Equivalence

16

CC B

C AC A C BZ

C AC BZ

CA C B

Page 17: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

AOI vs. NAND

17

IC Type Gates Gate / IC # ICs

74LS04 1 6 1

74LS08 2 4 1

74LS32 1 4 1

Total Number of ICs → 3

IC Type Gates Gate / IC # ICs

74LS00 4 4 1

Total Number of ICs → 1

Page 18: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Summary - NAND Universality

Inverter

AA

AND gate

AB

AB

A

B

A + B

OR gate

A

B

A + B

NOR gate

Page 19: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Self Task

• Implement the following Boolean express using only NAND gates

Y = ABC’ + ABC + A’BC

Y = AB + CDE + F

Y = ∑ (0,1,5)

Page 20: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Universal Gate – NOR

Now I will demonstrate…

• The basic function of the NOR gate.

• How an NOR gate can be using to replace an AND gate, an ORgate or an INVERTER gate.

• How a logic circuit implemented with AOI logic gates could be re-implemented using only NOR gates

• That using a single gate type, in this case NOR, will reduce the number of integrated circuits (IC) required to implement a logic circuit.

AOI Logic NOR Logic

More ICs = More $$ Less ICs = Less $$ 20

Page 21: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Gate

X Y Z

0 0 1

0 1 0

1 0 0

1 1 0

X

YY X Y XZ

21

Page 22: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Gate as an Inverter Gate

X Z

0 1

1 0

X XZ

XXX (Before Bubble)

Equivalent to Inverter

22

Page 23: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Gate as an OR Gate

X Y Z

0 0 0

0 1 1

1 0 1

1 1 1

X

YYX Y XZ

Y X

NOR Gate “Inverter”

Equivalent to OR Gate

23

Page 24: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Gate as an AND Gate

X Y Z

0 0 0

0 1 0

1 0 0

1 1 1

Equivalent to AND Gate

X

YY XY X Y XZ

X

NOR Gate“Inverters”

Y

24

Page 25: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Gate Equivalent of AOI Gates

INVERTERORAND

25

Page 26: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Process for NOR Implementation

1. If starting from a logic expression, implement the design with AOI logic.

2. In the AOI implementation, identify and replace every AND,OR, and INVERTER gate with its NOR equivalent.

3. Redraw the circuit.

4. Identify and eliminate any double inversions. (i.e. back-to-back inverters)

5. Redraw the final circuit.

26

Page 27: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR ImplementationExample:

Design a NOR Logic Circuit that is equivalent to the AOI circuit shown below.

CA C B

27

Page 28: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR ImplementationSolution – Step 2

Identify and replace every AND,OR, and INVERTER gate with its NAND equivalent.

28

Page 29: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Implementation

Redraw Circuit.

Solution – Step 3

29

Page 30: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR Implementation

Identify and eliminate any double inversions.

Solution – Step 4

30

Page 31: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NOR ImplementationSolution – Step 5

Redraw Circuit.

31

Page 32: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Proof of Equivalence

B

CA C AC A

C A C BZ

C A C B

C

C

A

C BC BCB

C A C B

32

Page 33: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

AOI vs NOR

IC Type Gates Gate / IC # ICs

74LS04 1 6 1

74LS08 2 4 1

74LS32 1 4 1

Total Number of ICs → 3

IC Type Gates Gate / IC # ICs

74LS02 7 4 2

Total Number of ICs → 2

33

Page 34: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Summary NOR - Universality

Inverter

AA

OR gate

AB

A + B

A

B

AB

AND gate

A

B

NAND gate

Page 35: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Self Task

• Implement the following Boolean express using only NOR gates

Y = (A’+B+C)(A + B)D

Y = ∏ (0,1,2,4,6)

Page 36: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Conversion to NAND Implementation

• Minimized expressions are AND-OR combinations

–Two illustrations for NAND gates• AND-invert

• Invert-OR

•Key observation: two “bubbles” eliminate each other•Two bubbles equal straight wire

•How to generate a sum of minterms using NAND?–Use AND-invert for minterms–Use invert-OR for sum

Page 37: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Conversion to NAND Implementation

´

Page 38: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

NAND Example• Function F = Σ(1,2,3,4,5,7)Minimize and implement with

NAND

SolutionDraw K-Map 1st

Implementation

Page 39: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Multilevel NAND circuits• Multilevel circuits conversion rules:

1.Convert all AND gates to NAND with AND-invert symbols

2.Convert all OR gates to NAND with invert-OR symbols

3.Check all bubbles in diagram. For every bubble that is not compensated by another bubble, insert inverter.

• Example

Page 40: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Self Task• Simplify the equation by simple gates & NAND

F=(AB’+A’B)(C+D’)

Page 41: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Self Task

• Implement the following Boolean express using only NAND gates

Y = ABC’ + ABC + A’BC

Y = AB + CDE + F

Y = ∑ (0,1,5)

Page 42: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Logic Operation with NOR gate

• NOR can also replace NOT, AND, OR

• Two representations of NOR:

–OR-invert and invert-AND

Page 43: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Converting to NOR Implementations

• Same rules as for NAND implementations

Page 44: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Self Task

• Implement the following Boolean express using only NOR gates

Y = (A’+B+C)(A + B)D

Y = ∏ (0,1,2,4,6)

Page 45: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Ex-OR/NOR function

X-OR X-NOR

Page 46: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Ex-OR implementations

• In fig.(b), the first NAND gate performs the operation (xy)’ = (x’ + y’).

xy’ + x’y = x ⊕ y

Page 47: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Odd function• Boolean expression of three-variable of the XOR:

A ⊕B ⊕C = (AB’ + A’B)C’ + (AB + A’B’)C

= AB’C’ + A’BC’ + ABC + A’B’C

=Σ(1, 2, 4, 7)

Page 48: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Odd and Even functions

• The 3-input odd function is implemented by means of 2-input exclusive-OR gates.

A ⊕B ⊕C = (AB’ + A’B)C’ + (AB + A’B’)C

Page 49: NAND & NOR Implementationdigitallogicdesign.weebly.com/.../3/5/4/13541180/lecture_nand_nor.pdf · Universal Gate –NAND I will demonstrate •The basic function of the NAND gate

Applications of Ex- OR/NOR

• Comparator

• Binary to Gray code convertor

• Adder & Subtractor circuits

• Parity generator

• And etc ...