Top Banner
Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II ١ NAND gates and NOR gates In this section we will define NAND and NOR gates. Logic designer frequently use NAND and NOR gates because they are faster and use fewer components than AND or OR gates. Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II ٢
21

Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Mar 15, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Lecture (02)NAND and NOR 

Gates

By:

Dr. Ahmed ElShafee

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١

NAND gates and NOR gates

• In this section we will define NAND and NOR gates. 

• Logic designer frequently use NAND and NOR gates because they are faster and use  fewer  components than AND or ORgates.

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢

Page 2: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣

Toshiba announced NAND flash at the 1987 International Electron Devices Meeting. It has reduced erase and write times, and requires less chip area per cell, thus allowing greater storage density and lower cost per bit than NOR flash; it also has up to ten times the endurance of NOR flash.

A USB memory

NAND gates

• Figure (a) shows a three-input NAND gate. The small circle (or “bubble”) at the gate output indicates inversion, so the NAND gate is equivalent to an AND gate followed by an inverter, as shown in Figure (b). The gate output is

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٤

F = (ABC)′ = A′ + B′ + C′

Page 3: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

NOR gates

• Figure (a) shows a three-input NOR gate. The small circle at the gate output indicates inversion, so the NOR gate is equivalent to an OR gate followed by an inverter. The gate output is

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٥

F = (A + B + C)′ = A′B′C′

Functionally Complete Set of Gates• AND and NOT are a functionally complete set of gates

because OR can also be realized using AND and NOT:

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٦

Page 4: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

• Similarly, any function can be realized using only NAND gates (Similarly, any function can be realized using only NOR gates)

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٧ NAND Gate Realization of NOT, AND, and OR

Design of Two-Level NAND-Gate Circuits• A two-level circuit composed of AND and OR gates is

easily converted to a circuit composed of NAND gates or NORE gates using F = (F′)′ and then applying DeMorgan′s laws:

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٨

(X1 + X2 + … + Xn)′ = X1′ X2′…Xn′

(X1 X2…Xn)′ = X1′ + X2′ + … + Xn′

Page 5: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Design of Two-Level NAND-Gate Circuits• The following example illustrates conversion of a

minimum sum-of-products form to several other two-level forms:

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٩

F = A + BC′ + B′CD = [(A + BC′ + B′CD)′ ]′ AND-OR

= [A′ • (BC′)′ • (B′CD)′]′ NAND-NAND

= [A′ • (B′ + C) • (B + C′ + D′)]′ OR-NAND

= A + (B′ + C)′ + (B + C′ + D′)′ NOR-OR

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٠

Page 6: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Design of Two-Level NOR-Gate Circuits• If we want a two-level circuit containing only NOR gates,

we should start with the minimum product-of-sums form for F instead of the minimum sum-of-products.

• After obtaining the minimum product-of-sums from a Karnaugh map, F can be written in the following two-level forms:

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١١

F = (A + B + C)(A + B′ + C′)(A + C′ + D) OR-AND

= {[(A + B + C)(A + B′ + C′)(A + C′ + D)]′ }′

= [(A + B + C)′ + (A + B′ + C′)′ + (A + C′ + D)′]′ NOR-NOR

= (A′B′C′ + A′BC + A′CD′)′ AND-NOR

= (A′B′C′)′ • (A′BC)′ • (A′CD′)′ NAND-AND

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٢

Page 7: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

• Consider, for example, the following NAND-NOR circuit:

• From this example, it is clear that the NAND-NOR form can realize only a product of literals and not a sum of products.

• NAND and NOR gates are readily available in IC form .So two commonly used circuit is NAND‐NAND or NOR‐NOR.Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٣

Design of Minimum Two-Level NAND-NAND CircuitsAND‐OR to NAND‐NAND Transformation

• Procedure for designing a minimum two-level NAND-NAND circuit:

• 1. Find a minimum sum-of-products expression for F.

• 2. Draw the corresponding two-level AND-OR circuit.

• 3. Replace all gates with NAND gates leaving the gate interconnection unchanged. If the output gate has any single literals as inputs, complement these literals.

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٤

Page 8: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٥

F = l1 + l2 + • • • + P1 + P2 + • • •

F = (l1′l2′ • • • P1′P2′ • • •)′

Design of Minimum Two-Level NOR-NOR Circuit• Procedure for designing a minimum two-level NOR-

NOR circuit:• 1. Find a minimum products-of-sum expression for F.

• 2. Draw the corresponding two-level OR-AND circuit.

• 3. Replace all gates with NOR gates leaving the gate interconnection unchanged. If the output gate has any single literals as inputs, complement these literals.

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٦

Page 9: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Design of Multi-Level NAND-and NOR-Gate Circuits• The following procedure may be used to design multi‐level 

NAND‐gate circuits:

1. Simplify the switching function to be realized.

2. Design a multi-level circuit of AND and OR gates. The output gate must be OR. AND gate outputs cannot be used as AND-gate inputs; OR-gate outputs cannot be used as OR-gate inputs.

3. Number the levels starting with the output gate as level 1. Replace all gates with NAND gates, leaving all interconnections between gates unchanged, leave the inputs to levels 2,4,6,… unchanged. Invert any literals which appear as inputs to levels 1,3,5,…

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٧

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٨

Multi‐Level Circuit Conversion to NAND Gates

EX: F1= a′ [b′+c(d+e′)+f′g′]+hi′j+k

Steps: 1.Realize the function

with AND-OR2.Replacing all gate with

NAND3.2,4,6,…leave unchanged

1,3,5… invert literals

Page 10: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Alternative Gate Symbols

• Logic designers who design complex digital systems often find it convenient to use more than one representation for a given type of gate. For example, an inverter can be represented by

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II١٩

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٠

Equivalent gate symbols based on DeMorgan′sLaws

Page 11: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

NAND Gate Circuit Conversion: From NAND‐NAND to OR‐AND •

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢١

Conversion to NOR Gates

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٢

Page 12: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

If AND and OR gates don’t alternate? EX: AND‐OR Circuit to NAND Gates

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٣

Design of Two-Level, Multiple-Output Circuits• Solution of digital design problems often requires the

realization of several functions of the same variables.

• Although each function could be realized separately, the use of some gates in common between two or more functions sometimes leads to a more economical realization.

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٤

Page 13: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Example

• Design a circuit with four inputs and three outputs which realizes the functions

• F1(A, B, C, D) = Ʃ m(11, 12, 13, 14, 15)

• F2(A, B, C, D) = Ʃ m(3, 7, 11, 12, 13, 15)

• F3(A, B, C, D) = Ʃ m(3, 7, 12, 13, 14, 15)

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٥

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٦

F1(A, B, C, D) = Ʃ m(11, 12, 13, 14, 15)

F2(A, B, C, D) = Ʃ m(3, 7, 11, 12, 13, 15)

F3(A, B, C, D) = Ʃ m(3, 7, 12, 13, 14, 15)

Page 14: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Realization of Equations (The cost is 9 gates and 21 inputs ) •

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٧

Realization of functions separately (9 Gates)

Multiple‐Output Realization of Equations:  A reduced circuit •

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٨

Realization of functions with shared gates (lower overall cost) (7 Gates)

1. AB in common2. CD in common

Page 15: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Another example of sharing gates among multiple outputs to reduce cost.(From K-map)•

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٢٩

f1 = Ʃ m(2, 3, 5, 7, 8, 9, 10, 11, 13, 15)

f2 = Ʃ m(2, 3, 5, 6, 7, 10, 11, 14, 15)

f3 = Ʃ m(6, 7, 8, 9, 13, 14, 15)

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٠

f1 = a′bd + abd +ab′c′ + b′c

f2 = c + a′bd f3 = bc + ab′c′ +abd

Minimal Solution

12 gates 28 gate inputs

8 gates 22 gate inputs

After reduced

Page 16: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣١

In this example, the best solution is obtained by not combining the circled 1 with adjacent 1’s.

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٢

The solution with the maximum number of common terms is not necessarily the best solution, as illustrated by this example.

Page 17: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٣

Multi‐Level Circuit Conversion to NOR Gates

The procedure for design of single-output, multi-level NAND- and NOR-gate circuits also applies to multiple-output circuits

Example

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٤

Find a circuit of AND and OR gates to realize

Consider solutions with two levels of gates and three levels of gates. Try to minimize the number of gates and the total number of gate inputs. Assume that all variables and their complements are available as inputs.

First, simplify f by using a Karnaugh map.

f (a, b, c, d) = Ʃ m(1, 5, 6, 10, 13, 14)

Page 18: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٥

f (a, b, c, d) = Ʃ m(1, 5, 6, 10, 13, 14)

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٦

This leads directly to a

two-level AND-OR gate

circuit.

Page 19: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٧

Factoring yields

f = c′d(a′ + b) + cd′(a + b)

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٨

Both of these solutions have an OR gate at the output. A solution with an AND gate at the output might have fewer gates or gate inputs. A two-level OR-AND circuit corresponds to a product-of-sums expression for the function. This can be obtained from the 0′s on the Karnaugh map as follows:

Equation (2) leads directly to a two-level OR-AND circuit.

f ′ = c′d + ab′c′ + cd + a′b′c (1)

f = (c + d)(a′ + b + c)(c′ + d′)(a + b + c′) (2)

Page 20: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٣٩

(c + d)(a′ + b + c)(c′ + d′)(a + b + c′)

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٤٠

To get a three-level circuit with an AND gate output, we partially multiply out Equation (7-4) using (X + Y)(X + Z) = X + Y Z:

Equation (1) would require four levels of gates to realize; however, if we multiply out d′(a + b) and d(a′ + b), we get

which leads directly to a three-level AND-OR-AND circuit.

f = [c + d(a′ + b)][c′ + d′(a + b)] (2 )

f = (c + a′d + bd)(c′ + ad′ + bd′) ( )

(c + d)(a′ + b + c)(c′ + d′)(a + b + c′)

Page 21: Lecture (02) NAND and NOR Gatesdraelshafee.net/Spring2018/cse303-logic-design-ii... · 2018-03-09 · Lecture (02) NAND and NOR Gates By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II٤١

f = (c + a′d + bd)(c′ + ad′ + bd′)

Thanks,..

Dr. Ahmed ElShafee, ACU : Spring 2018, CSE303 Logic design II

٤٢