<<

Gates and Circuits Functional Completeness Sections 5.6 and 5.4

Prof. Sandy Irani Circuits

A circuit is built from electrical devices called gates.

A gate computes a simple

Input1 0 or 1 Output 0 or 1

Input2 0 or 1 Gates We will use three types of gates which compute the three Boolean operations

x = 0/1 x = 0/1 x+y xy x 푥ҧ y = 0/1 y = 0/1

OR gate AND gate inverter Sample Circuit

x = 0 y = 1 z = 0 Circuit to Boolean Function

x y z Boolean Function to Circuit 푥푦 + 푧푥ҧ Boolean Circuits to Functions *

Select the Boolean expression that computes the same function as the circuit depicted below: x y

z

A) (푥 + 푦)(푥ҧ + 푧) C) (푥 + 푦)(푥 + 푧ҧ)

B) ( 푥 + 푦 )(푥ҧ + 푧) D) ( 푥 + 푦 )(푥 + 푧ҧ) Circuit Design

1. Build an input/output table with the desired circuit behavior

2. Construct a Boolean expression that computes the function described in the input/output table

3. Optional: Simplify the Boolean expression using the laws of

4. Construct a Boolean Expression that realizes the Boolean Expression Circuit Design x y z f(x,y,z) 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 Circuit Design x y z f(x,y,z) 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 Functional Completeness

• A of operations is functionally complete if every Boolean function is equivalent to a Boolean expression that uses only operations in the set.

• {Addition, Multiplication, Complement} is a functionally complete set: – For any input/output table, express the function with a sum of minterms expression – The sum of minterms expression uses only Addition, Multiplication, and Complement operations.

• Are there other functionally complete sets of operations? Eliminating Addition

An addition operation can be replaced by applying De Morgan’s Law:

푥 + 푦 = 푥 + 푦 = 푥ҧ푦ത

Can use this rule to eliminate any addition operation in a Boolean expression:

(x + y)z =

xy + z = Eliminating Addition

An addition operation can be replaced by applying De Morgan’s Law:

푥 + 푦 = 푥 + 푦 = 푥ҧ푦ത

The set {Multiplication, Complement} is functionally complete:

Equivalent Equivalent Input/Output Boolean Boolean table expression expression defining a with no addition that is a Boolean Eliminate addition operations – sum of functions operations using only minterms De Morgan’s Law {Mult, Comp} Eliminating Addition x y f(x,y) f(x, y) = 푥ҧy + 푥푦ത 0 0 0 0 1 1 1 0 1 1 1 0 Eliminating Addition Operations * Select the expression that is equivalent to:

풙 풚ഥ + 풛ത + 풙풚

A) 푥 푦ത 푧ҧ ∙ 푥푦 C) 푥 푦푧 ∙ 푥푦

B) 푥 푦ത 푧ҧ ∙ 푥푦 D) 푥 푦푧 ∙ 푥푦 More Functionally Complete Sets

Is the set {Addition, Complement} functionally complete?

Can eliminate Multiplication operations using the other version of De Morgan’s Law: 풙풚 = 풙풚 = 풙ഥ + 풚ഥ

Can use this rule to eliminate any addition operation in a Boolean expression:

(x + y)z = xy + z = More Functionally Complete Sets

Is the set {Addition, Complement} functionally complete?

Can eliminate Multiplication operations using the other version of De Morgan’s Law: 풙풚 = 풙풚 = 풙ഥ + 풚ഥ

Equivalent Equivalent Input/Output Boolean Boolean table expression expression defining a with no mult that is a Boolean Eliminate multiplication operations – sum of functions operations using only minterms De Morgan’s Law {Add, Comp} Eliminating Multiplication x y f(x,y) f(x, y) = 푥ҧy + 푥푦ത 0 0 0 0 1 1 1 0 1 1 1 0 Eliminating Multiplication Operations* Select the expression that is equivalent to:

풙 풚ഥ + 풛ത + 풙풚

A) 푥ҧ + ( 푦 + 푧 ) + ( 푥ҧ + 푦ത ) B) 푥ҧ + ( 푦 + 푧 ) + 푥ҧ + 푦ത C) 푥ҧ + ( 푦ത + 푧ҧ ) + 푥ҧ + 푦ത D) 푥ҧ + 푦ത + 푧ҧ + 푥ҧ + 푦ത Is the set {Addition, Multiplication} functionally complete?

No…can’t express 풙ഥ using only Addition or Multiplication:

x + x = x x  x = x

Is there a single operation that is functionally complete?

None of Multiplication, Addition, or Complement is functionally complete by itself.

So we need a new operation….. The NAND Operation (think “Not-AND”) x y x  y x NAND y = 푥 ↑ 푦 = 푥푦 0 0 1 0 1 1 1 0 1 1 1 0 Proving Functional Completeness To show that operations {,,} is functionally complete: Take any functionally complete set F For example, {Add, Compl} Show each operation in F and be computed using only operations in {,,} x + y = (expression using {,,}) 푥ҧ = (expression using {,,})

Equivalent Equivalent Input/Output Boolean table Boolean expression expression defining a that uses Boolean that uses Replace each addition and only functions Only complement operation using {Add, Com} the equivalent expressions {,,} above. Proving Functional Completeness* Which set of equations prove that {  } is functionally complete?

A) xy = 푥푦 C) xy = (xy)  (xy)

xy = xy xത = xx

B) xy = (xy)  (xy) D) xy = (xy)  (xy)

xy = xy x + y = (xx)(yy) Check that: xy = (xy)  (xy) xത = xx x y xy xy (xy)(xy) 0 0 0 1 1 0 1 1

x 풙ഥ xx 0 1 Express 푥 + 푦 using only NAND operations.

• First eliminate addition: a+b = 푎ത푏ത • The eliminate multiplication: ab = (ab)  (ab) • Then eliminate compliment: 푎ത = aa Sometimes it’s easier to use 푥푦 = x  y directly:

푥ҧy + 푧ഥ= The NOR Operation (think “Not-OR”) x y x  y x NOR y = 푥푦 = 푥 + 푦 0 0 1 0 1 0 1 0 0 1 1 0 Proving Functional Completeness* Which set of equations prove that {  } is functionally complete?

A) x+y = (xy)(xy) C) xy = 푥 + 푦

xത = xx xy = x+y

B) x+y = (xy)(xy) D) x+y = (xy)(xy)

xy = x+y xy = (xx)(yy) Check that: x+y = (xy)(xy) xത = xx x y x+y x  y (xy) (xy) 0 0 0 1 1 0 1 1

x 풙ഥ xx 0 1