chapter 2: basic definitions bb inary operators ●a●and z = x y = x yz=1 if x=1 and y=1 ●o●or...

37
Chapter 2: Chapter 2:

Upload: kelly-summers

Post on 19-Jan-2016

247 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Chapter 2:Chapter 2:

Page 2: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Basic DefinitionsBasic Definitions

Binary Operators

● AND

z = x • y = x y z=1 if x=1 AND y=1

● OR

z = x + y z=1 if x=1 OR y=1

● NOT

z = x = x’ z=1 if x=0

Boolean Algebra

● Binary Variables: only ‘0’ and ‘1’ values

● Algebraic Manipulation

Page 3: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Boolean Algebra PostulatesBoolean Algebra Postulates

Commutative Law

x • y = y • x x + y = y + x

Identity Element

x • 1 = x x + 0 = x

Complement

x • x’ = 0 x + x’ = 1

Page 4: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Boolean Algebra TheoremsBoolean Algebra Theorems

Duality

● The dual of a Boolean algebraic expression is obtained by interchanging the AND and the OR operators and replacing the 1’s by 0’s and the 0’s by 1’s.

● x • ( y + z ) = ( x • y ) + ( x • z )

● x + ( y • z ) = ( x + y ) • ( x + z )

Theorem 1

● x • x = x x + x = x

Theorem 2

● x • 0 = 0 x + 1 = 1

Applied to a valid equation produces a valid equation

Page 5: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Boolean Algebra TheoremsBoolean Algebra Theorems

Theorem 3: Involution● ( x’ )’ = x ( x ) = x

Theorem 4: Associative & Distributive● ( x • y ) • z = x • ( y • z ) ( x + y ) + z = x + ( y + z )

● x • ( y + z ) = ( x • y ) + ( x • z )

x + ( y • z ) = ( x + y ) • ( x + z )

Theorem 5: DeMorgan● ( x • y )’ = x’ + y’ ( x + y )’ = x’ • y’

● ( x • y ) = x + y ( x + y ) = x • y

Theorem 6: Absorption● x • ( x + y ) = x x + ( x • y ) = x

Page 6: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Operator PrecedenceOperator Precedence

Parentheses

( . . . ) • ( . . .)

NOT

x’ + y

AND

x + x • y

OR

])([ xwzyx

])([

)(

)(

)(

)(

xwzyx

xwzy

xwz

xw

xw

Page 7: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

DeMorgan’s TheoremDeMorgan’s Theorem

)]([ edcba

)]([ edcba

))(( edcba

))(( edcba

))(( edcba

)( edcba

Page 8: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Boolean FunctionsBoolean Functions

Boolean Expression

Example: F = x + y’ z

Truth Table

All possible combinationsof input variables

Logic Circuit

x y z F

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

xyz

F

Page 9: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Algebraic ManipulationAlgebraic Manipulation

Literal:

A single variable within a term that may be complemented or not.

Use Boolean Algebra to simplify Boolean functions to produce simpler circuits

Example: Simplify to a minimum number of literals

F = x + x’ y ( 3 Literals)

= x + ( x’ y )

= ( x + x’ ) ( x + y )

= ( 1 ) ( x + y ) = x + y ( 2 Literals)

Distributive law (+ over •)

Page 10: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Complement of a FunctionComplement of a Function

DeMorgan’s Theorm

Duality & Literal Complement

CBAF

CBAF

CBAF

CBAF CBAF

CBAF

Page 11: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Standard FormsStandard Forms

• A Boolean function can be written algebraically in a variety of ways

• Standard form: is a standard algebraic expression of the function:• Help simplification procedures and frequently results in

more desirable logic circuits (e.g. less number of gates)

• Standard form: contains product terms and sum terms• Product term: X’Y’Z (logical product with AND)

• Sum term: X + Y + Z’ (logical sum with OR)

Page 12: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Minterms and MaxtermsMinterms and Maxterms

• A minterm: a product term in which all variables (or literals) of the function appear exactly once (complemented or not complemented)

• A maxterm: a sum term in which all the variables (or literals) of the function appear exactly once (complemented or not complemented)

• A function of n variables – have 2n possible minterms and 2n possible maxterms

• Example: for the function F(X,Y,Z),

• the term X’Y is not a minterm, but XYZ’ is a minterm

• The term X’+Z is not a maxterm, but X+Y’+Z’ is maxterm

Page 13: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

MintermsMinterms

Minterms for two variables F(X,Y)

X Y Product Terms

Symbol m0 m1 m2 m3

0 0 X’Y’ m0 1 0 0 0

0 1 X’Y m1 0 1 0 0

1 0 XY’ m2 0 0 1 0

1 1 XY m3 0 0 0 1

Variable complemented if 0

Variable uncomplemented if 1

mi indicated the ith minterm

For each binary combination of X and Y there is a minterm

The index of the minterm is specified by the binary combination

mi is equal to 1 for ONLY THAT combination

Page 14: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

MaxtermsMaxterms

Maxterms for two variables F(X,Y)

X Y Sum

TermsSymbol M0 M1 M2 M3

0 0 X+Y M0 0 1 1 1

0 1 X+Y’ M1 1 0 1 1

1 0 X’+Y M2 1 1 0 1

1 1 X’+Y’ M3 1 1 1 0

Variable complemented if 1

Variable not complemented if 0

Mi indicated the ith maxterm

For each binary combination of X and Y there is a maxterm

The index of the maxterm is specified by the binary combination

Mi is equal to 0 for ONLY THAT combination

Page 15: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

ExampleExample

• A Boolean function can be expressed algebraically from a give truth table by forming the logical sum of ALL the minterms that produce 1 in the function

Example:X Y Z m F0 0 0 m0 1

0 0 1 m1 0

0 1 0 m2 1

0 1 1 m3 0

1 0 0 m4 0

1 0 1 m5 1

1 1 0 m6 0

1 1 1 m7 1

Consider the function defined by the truth table

F(X,Y,Z) 3 variables 8 mintermsF can be written asF = X’Y’Z’ + X’YZ’ + XY’Z + XYZ, or = m0 + m2 + m5 + m7

= m(0,2,5,7)

Page 16: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Minterms and Maxterms Minterms and Maxterms

• In general, a function of n variables has• 2n minterms: m0, m1, …, m2

n-1

• 2n maxterms: M0, M1, …, M2n

-1

• mi’ = Mi or Mi’ = mi

Example: for F(X,Y): m2 = XY’ m2’ = X’+Y = M2

Page 17: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Example (Cont.)Example (Cont.)

• A Boolean function can be expressed algebraically from a give truth table by forming the logical product of ALL the maxterms that produce 0 in the function

X Y Z M F F’0 0 0 M0 1 0

0 0 1 M1 0 1

0 1 0 M2 1 0

0 1 1 M3 0 11 0 0 M4 0 11 0 1 M5 1 0

1 1 0 M6 0 1

1 1 1 M7 1 0

• Example:Consider the function defined by the

truth tableF(X,Y,Z) in a manner similar to

the previous example, F’ can be written as

F’ = m1 + m3 + m4 + m6

= m(1,3,4,6)Now apply DeMorgan’s rule F = F’’ = [m1 + m3 + m4 + m6]’ = m1’.m3’.m4’.m6’ = M1.M3.M4.M6

= M(1,3,4,6)

Note the indices in this list are those that are

missing from the previous list in m(0,2,5,7)

Page 18: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Expressing Functions with Minterms Expressing Functions with Minterms and Maxtermsand Maxterms

F = X . ( Y’ + Z)

X Y Z F=X. (Y’+Z)

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 0

1 1 1 1

F = XY’Z’ + XY’Z + XYZ

= m4 + m5 + m7

= m(4,5,7)

F = M(0,1,2,3,6)

Page 19: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

SummarySummary

• A Boolean function can be expressed algebraically as:• The logical sum of minterms• The logical product of maxterms

• Given the truth table, writing F as• mi – for all minterms that produce 1 in the table,

or Mi – for all maxterms that produce 0 in the table

• Another way to obtain the mi or Mi is to use ALGEBRA – see next example

Page 20: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

ExampleExample

• Write E = Y’ + X’Z’ in the form of mi and Mi?

• Solution: Method1 First construct the

Truth Table as shown

Second:E = m(0,1,2,4,5), andE = M(3,6,7)

X Y Z m M E0 0 0 m0 M0 1

0 0 1 m1 M1 1

0 1 0 m2 M2 1

0 1 1 m3 M3 0

1 0 0 m4 M4 1

1 0 1 m5 M5 1

1 1 0 m6 M6 0

1 1 1 m7 M7 0

Page 21: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Example (Cont.)Example (Cont.)

Solution: Method2_aE = Y’ + X’Z’

= Y’(X+X’)(Z+Z’) + X’Z’(Y+Y’)= (XY’+X’Y’)(Z+Z’) + X’YZ’+X’Z’Y’= XY’Z+X’Y’Z+XY’Z’+X’Y’Z’+ X’YZ’+X’Z’Y’= m5 + m1 + m4 + m0 + m2 + m0

= m0 + m1 + m2 + m4 + m5

= m(0,1,2,4,5)

To find the form Mi, consider the remaining indices

E = M(3,6,7)

Solution: Method2_bE = Y’ + X’Z’E’ = Y(X+Z)

= YX + YZ= YX(Z+Z’) + YZ(X+X’)= XYZ+XYZ’+X’YZ

E = (X’+Y’+Z’)(X’+Y’+Z)(X+Y’+Z’)= M7 . M6 . M3 = M(3,6,7)

To find the form mi, consider the remaining indices

E = m(0,1,2,4,5)

Page 22: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

SOP vs POSSOP vs POS

• Boolean function can be represented as Sum of Products (SOP) or as Product of Sums (POS) of their input variables• AB+CD = (A+C)(B+C)(A+D)(B+D)

• The sum of minterms is a special case of the SOP form, where all product terms are minterms

• The product of maxterms is a special case of the POS form, where all sum terms are maxterms

• SOP and POS are referred to as the standard forms for representing Boolean functions

Page 23: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

SOP vs POSSOP vs POS

SOP POS

F = AB + CD

= (AB+C)(AB+D)

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

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

Hint 1: Used X+YZ=(X+Y)(X+Z)

Hint 2: Factor

POS SOP

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

= (A’+BC)(C+D)

= A’C+A’D+BCC+BCD

= A’C+A’D+BC+BCD

= A’C+A’D+BCHint 1: Used (X+Y)(X+Z)=X+YZ

Hint 2: Multiply

Page 24: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Implementation of SOPImplementation of SOP

Any SOP expression can be implemented using 2-levels of gates

The 1st level consists of AND gates, and the 2nd level consists of a single OR gate

Also called 2-level Circuit

Page 25: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Implementation of POSImplementation of POS

Any POS expression can be implemented using 2-levels of gates

The 1st level consists of OR gates, and the 2nd level consists of a single AND gate

Also called 2-level Circuit

Page 26: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Implementation of SOPImplementation of SOP

• Consider F = AB + C(D+E)• This expression is NOT in the sum-of-

products form• Use the identities/algebraic manipulation to

convert to a standard form (sum of products), as in F = AB + CD + CE

• Logic Diagrams:

F

E

C

D

C

B

A

FC

B

A

E

D

3-level circuit 2-level circuit

Page 27: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Logic OperatorsLogic Operators

AND

NAND (Not AND) x y NAND0 0 10 1 11 0 11 1 0

x y AND0 0 00 1 01 0 01 1 1

xy

x • y

xy

x • y

Page 28: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Logic OperatorsLogic Operators

OR

NOR (Not OR)

x y OR0 0 00 1 11 0 11 1 1

x y NOR0 0 10 1 01 0 01 1 0

xy

x + y

xy

x + y

Page 29: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Logic OperatorsLogic Operators

XOR (Exclusive-OR)

XNOR (Exclusive-NOR) (Equivalence)

x y XOR0 0 00 1 11 0 11 1 0

x y XNOR0 0 10 1 01 0 01 1 1

xy

x Å yx � y

x y + x y

xy

x Å yx y + x y

Page 30: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

Logic OperatorsLogic Operators

NOT (Inverter)

Buffer

x NOT

0 1

1 0

x Buffer

0 0

1 1

x x

x x

Page 31: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

DeMorgan’s Theorem on GatesDeMorgan’s Theorem on Gates

AND Gate

● F = x • y F = (x • y) F = x + y

OR Gate

● F = x + y F = (x + y) F = x • y

Change the “Shape” and “bubble” all lines

Page 32: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

AssignmentsAssignments

Mano

● Chapter 2

♦ 2-4

♦ 2-5

♦ 2-6

♦ 2-8

♦ 2-9

♦ 2-10

♦ 2-12

♦ 2-15

♦ 2-18

♦ 2-19

Page 33: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

AssignmentsAssignments

Mano2-4 Reduce the following Boolean expressions to the indicated

number of literals:

(a) A’C’ + ABC + AC’ to three literals

(b) (x’y’ + z)’ + z + xy + wz to three literals

(c) A’B (D’ + C’D) + B (A + A’CD) to one literal

(d) (A’ + C) (A’ + C’) (A + B + C’D) to four literals

2-5 Find the complement of F = x + yz; then show thatFF’ = 0 and F + F’ = 1

Page 34: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

AssignmentsAssignments

2-6 Find the complement of the following expressions:

(a) xy’ + x’y (b) (AB’ + C)D’ + E

(c) (x + y’ + z) (x’ + z’) (x + y)

2-8 List the truth table of the function:F = xy + xy’ + y’z

2-9 Logical operations can be performed on strings of bits by considering each pair of corresponding bits separately (this is called bitwise operation). Given two 8-bit stringsA = 10101101 and B = 10001110, evaluate the 8-bit result after the following logical operations: (a) AND, (b) OR, (c) XOR, (d) NOT A, (e) NOT B.

Page 35: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

AssignmentsAssignments

2-10 Draw the logic diagrams for the following Boolean expressions:

(a) Y = A’B’ + B (A + C) (b) Y = BC + AC’

(c) Y = A + CD (d) Y = (A + B) (C’ + D)

2-12 Simplify the Boolean function T1 and T2 to a minimum number of literals.

A B C T1 T2

0 0 0 1 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 0 11 0 1 0 11 1 0 0 11 1 1 0 1

Page 36: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

AssignmentsAssignments

2-15 Given the Boolean functionF = xy’z + x’y’z + w’xy + wx’y + wxy

(a) Obtain the truth table of the function.(b) Draw the logic diagram using the original Boolean expression.(c) Simplify the function to a minimum number of literals using Boolean algebra.(d) Obtain the truth table of the function from the simplified expression and show that it is the same as the one in part (a)(e) Draw the logic diagram from the simplified expression and compare the total number of gates with the diagram of part (b).

Page 37: Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0

AssignmentsAssignments

2-18 Convert the following to the other canonical form:

(a) F (x, y, z) = ∑ (1, 3, 7)

(b) F (A, B, C, D) = ∏ (0, 1, 2, 3, 4, 6, 12)

2-19 Convert the following expressions into sum of products and product of sums:

(a) (AB + C) (B + C’D)

(b) x’ + x (x + y’) (y + z’)