CSCE 211 Digital Logic Design ChinTser Huang huangctcse

  • Slides: 47
Download presentation
CSCE 211: Digital Logic Design Chin-Tser Huang huangct@cse. sc. edu University of South Carolina

CSCE 211: Digital Logic Design Chin-Tser Huang huangct@cse. sc. edu University of South Carolina

Chapter 2: Combinational Systems

Chapter 2: Combinational Systems

Objectives n n Develop the tools to specify combinational systems Develop an algebraic approach

Objectives n n Develop the tools to specify combinational systems Develop an algebraic approach for the description, simplification, and implementation of combinational systems 08/27/2015 3

Continuing Examples CE 1. A system with four inputs, A, B, C, and D,

Continuing Examples CE 1. A system with four inputs, A, B, C, and D, and one output, Z, such that Z=1 if three of the inputs are 1. CE 2. A single light (that can be on or off) that can be controlled by any one of three switches. One switch is the master on/off switch. If it is off, the light is off. When the master switch is on, a change in the position of one of the other switches (from up to down or from down to up) will cause the light to change state. CE 3. A system to do 1 bit of binary addition. It has three inputs (the 2 bits to be added plus the carry from the next lower order bit) and produces two outputs, a sum bit and a carry to the next higher order position. 08/27/2015 4

Continuing Examples CE 4. A system that has as its input the code for

Continuing Examples CE 4. A system that has as its input the code for a decimal digit, and produces as its output the signals to drive a seven-segment display, such as those on most digital watches and numeric displays (more later). CE 5. A system with nine inputs, representing two 4 -bit binary numbers and a carry input, and one 5 -bit output, representing the sum. (Each input number can range from 0 to 15; the output can range from 0 to 31. ) 08/27/2015 5

Design Process for Combinational Systems Step 1: Represent each of the inputs and output

Design Process for Combinational Systems Step 1: Represent each of the inputs and output in binary. Step 1. 5: If necessary, break the problem into smaller subproblems. Step 2: Formalize the design specification either in the form of a truth table or of an algebraic expression. Step 3: Simplify the description. Step 4: Implement the system with the available components, subject to the design objectives and constraints. 08/27/2015 6

Gate n n n A gate is a network with one output Gate is

Gate n n n A gate is a network with one output Gate is the basic component for implementation For example, an OR gate is shown as follows 08/27/2015 7

Don’t Care Conditions n n n For some input combinations, it doesn’t matter what

Don’t Care Conditions n n n For some input combinations, it doesn’t matter what the output is Represented as X Examples of don’t cares n n Some input combinations never occur When one system is designed to drive a second system, some input combination of the first system will make the second system behave the same way 08/27/2015 8

Example with Don’t Cares n If for some combination of A, B, C, System

Example with Don’t Cares n If for some combination of A, B, C, System Two behaves the same way no matter J is 0 or 1, then J is a don’t care in this case 08/27/2015 9

Development of Truth Table n n Should be straightforward once the inputs are coded

Development of Truth Table n n Should be straightforward once the inputs are coded into binary! The number of inputs determines the number of rows 08/27/2015 10

How to Develop Truth Table for CE 4? 08/27/2015 11

How to Develop Truth Table for CE 4? 08/27/2015 11

Switching Algebra n Need an algebra to n n n Obtain the output in

Switching Algebra n Need an algebra to n n n Obtain the output in terms of the input according to the specification of a network of gates Simplify the expression Implement networks of gates 08/27/2015 12

Operators of Switching Algebra OR (written as +) a + b (read a OR

Operators of Switching Algebra OR (written as +) a + b (read a OR b) is 1 if and only if a = 1 or both. AND (written as · or simply two variables catenated) a · b = ab (read a AND b) is 1 if and only if a = 1 and b = 1. NOT (written as ´) a´ (read NOT a) is 1 if and only if a = 0. Can you construct the truth table for OR, AND, and NOT? 08/27/2015 13

AND, OR, and NOT Gates 08/27/2015 14

AND, OR, and NOT Gates 08/27/2015 14

Basic Properties of Switching Algebra Commutative P 1 a. a + b = b

Basic Properties of Switching Algebra Commutative P 1 a. a + b = b + a P 1 b. ab = ba Associative P 2 a. a + (b + c) = (a + b) + c P 2 b. a(bc) = (ab)c This can be generalized: a + b + c + d + … is 1 if any of the operands is 1 and is 0 only if all are 0 abcd … is 1 if all of the operands are 1 and is 0 only if any is 0 08/27/2015 15

08/27/2015 16

08/27/2015 16

Order of Precedence n n Without parentheses, order of precedence is NOT AND OR

Order of Precedence n n Without parentheses, order of precedence is NOT AND OR With parentheses, expressions inside the parentheses are evaluated first 08/27/2015 17

Basic Properties of Switching Algebra Identity P 3 a. a + 0 = a

Basic Properties of Switching Algebra Identity P 3 a. a + 0 = a P 3 b. a · 1 = a Null P 4 a. a + 1 = 1 P 4 b. a · 0 = 0 Complement P 5 a. a + a´ = 1 P 5 b. a · a´ = 0 P 3 aa. 0 + a = a P 4 aa. 1 + a = 1 P 5 aa. a´ + a = 1 P 3 bb. 1 · a = a P 4 bb. 0 · a = 0 P 5 bb. a´ · a = 0 08/27/2015 18

Basic Properties of Switching Algebra Idempotency P 6 a. a + a = a

Basic Properties of Switching Algebra Idempotency P 6 a. a + a = a P 6 b. a · a = a Involution P 7. (a´)´ = a Distributive P 8 a. a (b + c) = ab + ac 08/27/2015 P 8 b. a + bc = (a + b)(a + c) 19

Definitions of Terminology A literal is the appearance of a variable or its complement.

Definitions of Terminology A literal is the appearance of a variable or its complement. A product term is one literal or more literals connected by AND operators. A standard product term, also called minterm, is a product term that includes each variable of the problem, either uncomplemented or complemented. A sum of products expression (often abbreviated SOP) is one product term or more product terms connected by OR operators. A canonical sum or sum of standard product terms is just a sum of products expression where all of the terms are standard product terms. 08/27/2015 20

Definitions of Terminology A minimum sum of products expression is one of those SOP

Definitions of Terminology A minimum sum of products expression is one of those SOP expressions for a function that has the fewest number of product terms. If there is more than one expression with the fewest number of terms, then minimum is defined as one or more of those expressions with the fewest number of literals. For example, which of the following equivalent expressions is the minimum SOP expression? (1) x´yz´ + x´yz + xy´z´ + xy´z + xyz 5 terms, 15 literals (2) x´y + xy´ + xyz 3 terms, 7 literals (3) x´y + xy´ + xz 3 terms, 6 literals (4) x´y + xy´ + yz 3 terms, 6 literals 08/27/2015 21

Definitions of Terminology A sum term is one literal or more literals connected by

Definitions of Terminology A sum term is one literal or more literals connected by OR operators. A standard sum term, also called a maxterm, is a sum term that includes each variable of the problem, either uncomplemented or complemented. A product of sums expression (POS) is one sum term or more sum terms connected by AND operators. A canonical product or product of standard sum terms is just a product of sums expression where all of the terms are standard sum terms. 08/27/2015 22

Examples SOP: x´y + xy´ + xyz POS: (x + y´)(x´ + y)(x´ +

Examples SOP: x´y + xy´ + xyz POS: (x + y´)(x´ + y)(x´ + z´) Both: x´ + y + z or xyz´ Neither: x(w´ + yz) or z´ + wx´y + v(xz + w´) 08/27/2015 23

More Properties of Switching Algebra Adjacency P 9 a. ab + ab´ = a

More Properties of Switching Algebra Adjacency P 9 a. ab + ab´ = a P 9 b. (a + b)(a + b´) = a Simplification P 10 a. a + a´b = a + b 08/27/2015 P 10 b. a(a´ + b) = ab 24

More Properties of Switching Algebra De. Morgan P 11 a. (a + b)´ =

More Properties of Switching Algebra De. Morgan P 11 a. (a + b)´ = a´b´ P 11 b. (ab)´ = a´ + b´ Note that (ab)´ ≠ a´b´ ! De. Morgan can be extended to more than two operands: P 11 aa. (a + b + c …)´ = a´b´c´… P 11 bb. (abc…)´ = a´ + b´ + c´ + … 08/27/2015 25

From Truth Table to Algebraic Expressions f is 1 if a = 0 AND

From Truth Table to Algebraic Expressions f is 1 if a = 0 AND b = 1 OR if a = 1 AND b = 0 OR if a = 1 AND b = 1 f is 1 if a´ = 1 AND b = 1 OR if a = 1 AND b´ = 1 OR if a = 1 AND b = 1 f is 1 if a´b = 1 OR if ab´ = 1 OR if ab = 1 f = a´b + ab´ + ab 08/27/2015 26

From Truth Table to Algebraic Expressions n Can use minterm numbers since the product

From Truth Table to Algebraic Expressions n Can use minterm numbers since the product terms are minterms n n Must include variable names if minterm numbers are used For example, the previous function can be written as f(a, b) = m 1 + m 2 + m 3 f(a, b) = ∑m(1, 2, 3) n If the function includes don’t cares, use a separate ∑ to represent don’t care terms 08/27/2015 27

Number of Functions of n Variables 08/27/2015 28

Number of Functions of n Variables 08/27/2015 28

Implementation using AND, OR, and NOT Gates f = x’yz’ + x’yz + xy’z’

Implementation using AND, OR, and NOT Gates f = x’yz’ + x’yz + xy’z’ + xy’z + xyz 08/27/2015 29

Implementation using AND, OR, and NOT Gates Can you draw a diagram of circuit

Implementation using AND, OR, and NOT Gates Can you draw a diagram of circuit for a minimum SOP of the same function, f = x’y + xy’ + xz ? This, and the previous diagram, are two-level circuit 08/27/2015 30

Implementation using AND, OR, and NOT Gates Can you draw a diagram of circuit

Implementation using AND, OR, and NOT Gates Can you draw a diagram of circuit for a minimum POS of the same function, f = (x + y)(x’ + y’ + z) ? 08/27/2015 31

Implementing Functions that are not in SOP or POS form h = z’ +

Implementing Functions that are not in SOP or POS form h = z’ + wx’y + v(xz + w’) 08/27/2015 32

Three More Types of Gates: NAND, NOR, and Exclusive-OR n Why do we use

Three More Types of Gates: NAND, NOR, and Exclusive-OR n Why do we use NAND and NOR gates rather than AND, OR, and NOT gates? 1. 2. 08/27/2015 Using NAND or NOR is more convenient: need less number of gates More importantly, NAND and NOR are functionally complete: they can be used to implement AND, OR, and NOT so we need less types of gates! (How? ) 33

NAND and NOR Gates 08/27/2015 34

NAND and NOR Gates 08/27/2015 34

Use NAND to Implement AND, OR, and NOT 08/27/2015 35

Use NAND to Implement AND, OR, and NOT 08/27/2015 35

Implementation using NAND 08/27/2015 36

Implementation using NAND 08/27/2015 36

Exclusive-OR and Exclusive-NOR Gates 08/27/2015 37

Exclusive-OR and Exclusive-NOR Gates 08/27/2015 37

Useful Properties of Exclusive-OR 08/27/2015 38

Useful Properties of Exclusive-OR 08/27/2015 38

Simplification of Algebraic Expression Primary tools: P 9 a. ab + ab´ = a

Simplification of Algebraic Expression Primary tools: P 9 a. ab + ab´ = a P 10 a. a + a´b = a + b P 9 b. (a + b)(a + b´) = a P 10 b. a(a´ + b) = ab Other useful properties: P 6 a. a + a = a P 6 b. a · a = a P 8 a. a (b + c) = ab + ac P 8 b. a + bc = (a + b)(a + c) Another useful property when the function is not in SOP or POS form: Absorption P 12 a. a + ab = a P 12 b. a(a + b) = a 08/27/2015 39

Simplification Examples n Can you simplify (1) to each of (2), (3), and (4)?

Simplification Examples n Can you simplify (1) to each of (2), (3), and (4)? (1) x´yz´ + x´yz + xy´z´ + xy´z + xyz (2) x´y + xy´ + xyz (3) x´y + xy´ + xz (4) x´y + xy´ + yz 08/27/2015 40

Simplification Examples n Can you simplify the following functions? xyz + x’y’ = ?

Simplification Examples n Can you simplify the following functions? xyz + x’y’ = ? wx + wxy + w’yz + w’y’z + w’xyz’ = ? 08/27/2015 41

Consensus n n Denoted as ¢ For any two product terms where exactly one

Consensus n n Denoted as ¢ For any two product terms where exactly one variable appears uncomplemented in one and complemented in the other, the consensus is defined as the product of the remaining literals. If no such variable exists or if more than one such variable exists, then the consensus is undefined. If we write one term as at 1 and the second as a’t 2 (where t 1 and t 2 represent product terms), then, if the consensus is defined, at 1 ¢ a’t 2 = t 1 t 2 08/27/2015 42

Consensus Property Consensus P 13 a. at 1 + a´t 2 + t 1

Consensus Property Consensus P 13 a. at 1 + a´t 2 + t 1 t 2 = at 1 + a´t 2 P 13 b. (a + t 1)(a´ + t 2)(t 1 + t 2)= (a + t 1)(a´ + t 2) 08/27/2015 43

Simplification with Consensus n Can you simplify the following functions? bc’ + abd +

Simplification with Consensus n Can you simplify the following functions? bc’ + abd + acd = ? c’d’ + ac’ + ad + bd’ + ab = ? 08/27/2015 44

Convert SOP to Sum of Minterms n Two approaches n n n By developing

Convert SOP to Sum of Minterms n Two approaches n n n By developing a truth table By using P 9 a. (adjacency) to add variables to a term To convert POS to product of maxterms, use P 9 b. 08/27/2015 45

Examples n Can you convert the following SOP to sum of minterms? bc’ +

Examples n Can you convert the following SOP to sum of minterms? bc’ + ab’c + a’b = ? n Can you convert the following POS to product of maxterms? (a + b’ + c)(a’ + c’ ) = ? 08/27/2015 46

Convert between SOP and POS n § POS SOP: Use the following 3 properties

Convert between SOP and POS n § POS SOP: Use the following 3 properties (in this order) P 8 b. a + bc = (a + b)(a + c) P 14 a. ab + a’c = (a + c)(a’ + b) P 8 a. a (b + c) = ab + ac SOP POS: Reverse the order (w + x’ + y)(w + x + z)(w’ + y’ + z) = ? wxy’ + xyz + w’x’z’ = ? 08/27/2015 47