lecture (02) multi level gate circuits (1)draelshafee.net/spring2020/cse303-logic-design-ii... ·...

18
Lecture (02) MultiLevel Gate Circuits (1) By: Dr. Ahmed ElShafee Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II 1 Multi-Level Gate Circuits In this lecture, we will use the following terminology: 1. AND-OR circuit means a two-level circuit composed of a level of AND gates followed by an OR gate at the output. Sum-of-products(SOP): AB’+ACD+ABC’…… 2. OR-AND circuit means a two-level circuit composed of a level of OR gates followed by an AND gate at the output. Product-of-sums(POS): (A+B’)(A+C+D)(A+B+C’)…… 3. OR-AND-OR circuit means a three-level circuit composed of a level of OR gates followed by a level of AND gates followed by an OR gate at the output. 4. Circuit of AND-AND-OR gates implies no particular ordering of the gates; the output gate may be either AND or OR. Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II 2

Upload: others

Post on 26-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Lecture (02)Multi‐Level Gate 

Circuits (1)By:

Dr. Ahmed ElShafee

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II1

Multi-Level Gate Circuits

• In this lecture, we will use the following terminology:

1. AND-OR circuit means a two-level circuit composed of a level of AND gates followed by an OR gate at the output.

• Sum-of-products(SOP): AB’+ACD+ABC’……

2. OR-AND circuit means a two-level circuit composed of a level of OR gates followed by an AND gate at the output.

• Product-of-sums(POS): (A+B’)(A+C+D)(A+B+C’)……

3. OR-AND-OR circuit means a three-level circuit composed of a level of OR gates followed by a level of AND gates followed by an OR gate at the output.

4. Circuit of AND-AND-OR gates implies no particular ordering of the gates; the output gate may be either AND or OR.

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II2

Page 2: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

• What’s the concerned issues from a logic designers:

1. Number of gates

2. Gate inputs

3. Level of a circuit

– a. Cascaded circuit will increase the gate‐delay

– b. and also the cost.

– c. gate‐delay will slow down the operation of a digital system

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II3

Tree Diagrams

• Each node on a tree diagram represents a gate, and the number of gate inputs is written beside each node.

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II4

Page 3: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II54 level, 6 gates, 13 gate inputs

6 3 level, 6 gates, 19 gate inputs

Page 4: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Example

Find a circuit of AND-AND-OR gates to realize

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

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.

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II7

• First, simplify f by using a Karnaugh map.

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II8

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

OR gate at the output

Page 5: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II9

This leads directly to a two-level AND-OR gate circuit.

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II10

Factoring yields

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

Page 6: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II11

AND gate at the output

• 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:

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

leads directly to a two-level OR-AND circuit

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II12

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

Page 7: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II13

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

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

Equation 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)]

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

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

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II14

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

Page 8: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II15

AND gate output

OR gate output

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

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

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

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II16

For this particular example, the best two-level solution had an AND gate at the output, and the best three-level solution had an OR gate at the output. In general, to be sure of obtaining a minimum solution, one must find both the circuit with the AND-gate output and the one with the OR-gate output.

Page 9: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

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 2020, CSE303 Logic Design II17

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II18

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

Page 10: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

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 2020, CSE303 Logic Design II19

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

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 2020, CSE303 Logic Design II20

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

Page 11: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

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 2020, CSE303 Logic Design II21

• 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 2020, CSE303 Logic Design II22 NAND Gate Realization of NOT, AND, and OR

Page 12: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

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 2020, CSE303 Logic Design II23

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II24

Equivalent gate symbols based on DeMorgan′s Laws

Page 13: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Nand = and not 

Nor =  or not 

From demorgans’

And = not nor = not or not

Or = not nand = not and not

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II25

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 2020, CSE303 Logic Design II26

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

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

Page 14: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

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 2020, CSE303 Logic Design II27

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 2020, CSE303 Logic Design II28

Nor = or not= not and not not

Nand = and not= not or not not

Nand = and not= not or not not

Or = not and not

Page 15: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

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 2020, CSE303 Logic Design II29

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 2020, CSE303 Logic Design II30

And = and not= not or not not

Nor = or not= not and not not

Nor = or not= not and not not

And = not or not

Page 16: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

• 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 2020, CSE303 Logic Design II31

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 2020, CSE303 Logic Design II32

Page 17: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II33

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 2020, CSE303 Logic Design II34

Page 18: Lecture (02) Multi Level Gate Circuits (1)draelshafee.net/Spring2020/cse303-logic-design-ii... · 11 Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II AND gate at the

Thanks,..

See you next week (ISA),…

Dr. Ahmed ElShafee, ACU : Spring 2020, CSE303 Logic Design II

35