Top Banner
+ CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2
29

+ CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

Jan 04, 2016

Download

Documents

Tyrone Miles
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: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+ CS 325: CS Hardware and SoftwareOrganization and Architecture

Gates and Boolean Algebra

Part 2

Page 2: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Outline

Sum of Products (SOP)

Fan-in, Fan-out

Cascading to Reduce Inputs

Boolean Algebra Laws

Gate Reduction using Boolean Algebra

Page 3: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Circuits from SOP Functions

Why simplify circuits? NAND and NOR gates are simpler (faster, smaller) than NOT

AND and NOT OR.

Reduction in complexity when using a small number of gate types.

Goal: To implement circuit using a small complete set of operators. NAND and NOR are both complete since any Boolean

function can be implemented with either.

Faster to use small number of inputs to a gate (fan-in), and small number of gate inputs from a gate output (fan-out) Typically, fan-in and fan-out < 10.

Page 4: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Logic Gate Fan-n and Fan-out

Page 5: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Gate Cascading to Reduce InputsImplementing 3-input AND and OR functions with 2-input gates

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

Implementing a 3-input NAND function with 2-input gates.

NO!Correct

Page 6: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Page 7: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Page 8: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Page 9: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Page 10: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Commutative Law

Page 11: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Commutative Law

Associative Law

Page 12: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Commutative Law

Associative Law

Distributive Law

Page 13: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Commutative Law

Associative Law

Distributive Law

Absorption Law

Page 14: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Commutative Law

Associative Law

Distributive Law

Absorption Law

De Morgan’s Law

Page 15: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can

be used to make simpler circuits.

Example: AB + AC Three gates = A(B + C), Distributive Law Two gates

Name AND Form OR Form

Identity Law

Null Law

Idempotent Law

Commutative Law

Associative Law

Distributive Law

Absorption Law

De Morgan’s Law

Page 16: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Gate Reduction AB + AC Three gates

= A(B + C), Distributive Law Two gates

Page 17: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Equivalent Gates/Symbols Using Boolean Laws (identities), alternative symbols for

some gates can be derived:

Page 18: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Functionally Complete Sets of Gates

Not all gate types are typically implemented in circuit design. Simpler if only 1 or 2 types of gates are used.

A functionally complete set of gates means that any Boolean function can be implemented using only the gates in that set.

Examples of functionally complete sets: AND, OR, NOT AND, NOT OR, NOT NAND NOR

Page 19: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+NAND and NOR Completeness

Page 20: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Implement XOR with NANDs

Exclusive-OR (XOR) example: Step 1: build truth table

Step 2: find SOP and build circuit using AND and OR.

A B

0 0 0

0 1 1

1 0 1

1 1 0

𝑨⊕𝑩=𝑨𝑩+𝑨𝑩

Page 21: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Implement XOR with NANDs

Apply Boolean Algebra rules:

so,

De Morgan’s Law:

so,

The last formula is 3 NAND gates.

Page 22: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Implement XOR with NANDs

Logic circuits implementing XOR:

𝑨⊕𝑩=𝑨𝑩+𝑨𝑩

Page 23: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Simplification Boolean functions, and therefore circuits, can usually

be manipulated using Boolean laws into simpler functions.

Distributive Law

Inverse Law

Distributive Law

Inverse Law

Idempotent Law

Identity Law

How to check for correctness?

Page 24: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Checking Logic for Correctness We can check our solution using a truth table

Checking

0 0 0 1 0 0

0 1 1 0 0 0

1 0 1 1 1 1

1 1 1 1 1 1

Page 25: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Checking Logic for Correctness We can check our solution using a truth table

Checking

Correct

0 0 0 1 0 0

0 1 1 0 0 0

1 0 1 1 1 1

1 1 1 1 1 1

Page 26: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Another Example Draw the logic gate diagram for the following Boolean

function:

Circuit Reduction:

Distributive Law

Idempotent Law

Idempotent Law

Distributive Law

Check with Truth table for correctness.

Page 27: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Checking Logic for Correctness We can check our solution using a truth table

Checking

0 0 0 0 0 0 0 0

0 0 1 0 0 0 0 0

0 1 0 0 0 0 0 0

0 1 1 0 1 1 1 1

1 0 0 0 0 0 0 0

1 0 1 0 0 0 0 0

1 1 0 1 0 0 1 1

1 1 1 1 1 1 1 1

Page 28: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Checking Logic for Correctness We can check our solution using a truth table

Checking

Correct

0 0 0 0 0 0 0 0

0 0 1 0 0 0 0 0

0 1 0 0 0 0 0 0

0 1 1 0 1 1 1 1

1 0 0 0 0 0 0 0

1 0 1 0 0 0 0 0

1 1 0 1 0 0 1 1

1 1 1 1 1 1 1 1

Page 29: + CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.

+Another Example Draw the logic gate diagram for the following Boolean function:

Circuit Reduction:

Distributive Law

Idempotent Law

Absorption Law

Distributive Law

Idempotent Law

Absorption Law

Absorption Law

Check with Truth table for correctness.