week 2.2 canonical forms - university of waterloobasir/ece124/week2-2.pdf · 2012-01-15 ·...

20
WEEK 2.2 CANONICAL FORMS 1

Upload: others

Post on 17-Mar-2020

4 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

WEEK 2.2 CANONICAL FORMS

1

Page 2: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Canonical Sum-of-Products (SOP)

ECE 124 Digital Circuits and Systems Page 2

• Given a truth table, we can ALWAYS write a logic expression for the

function by taking the OR of the minterms for which the function is a 1.

– This representation of a function is a “sum of minterms” and is called a

canonical sum-of-products (SOP) representation of the function.

• Examples:

• Shortcut notation:

001 100 111

Page 3: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Sum-of-Products Implementations

• If implemented with gates, a SOP will always have the following form. – A plane of NOT gates (inverters to generate all literals), followed by…

– A plane of AND gates (to implement the minterms), followed by…

– A single OR gate (to take the “sum”).

ECE 124 Digital Circuits and Systems Page 3

Page 4: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Canonical Product-of-Sums (POS)

ECE 124 Digital Circuits and Systems Page 4

• Given a truth table, we can ALWAYS write a logic expression for the function

by taking the AND of the maxterms for which the function is a 0.

– This representation of a function is a “product of maxterms” and is called a canonical

product-of-sums (POS) representation of the function.

• Examples:

• Shortcut notation:

Page 5: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Product-Of-Sums Gate Implementations

• If implemented with gates, a POS will always have the form: – A plane of NOT gates (inverters to generate all literals), followed by…

– A plane of OR gates (to implement the maxterms), followed by…

– A single AND gate (to take the “product”).

ECE 124 Digital Circuits and Systems Page 5

Page 6: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

General Comments

• There are always two canonical representations for a function, the SOP or the POS.

• Sometimes, one implementation is simpler than the other implementation (in terms of its cost).

• SOP and POS implementations are often referred to as 2-level logic implementations.

– This is because we assume NOT gates at the input are free, so we see that there are two levels of gates (AND-OR for SOP and OR-AND for POS) required to implement the function.

ECE 124 Digital Circuits and Systems Page 6

Page 7: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Conversion between SOP and POS

• It is always possible to convert between a POS and SOP representation for a functin.

• Consider f1= (1,4,7) which can also be expressed as f1 = (0,2,3,5,6).

f1 = (1,4,7)

= m1+m4+m7

= !(!f1) // double inversion is okay

= ![ (m0 + m2 + m3 + m5 + m6) ] // !f1 is those minterms not in f1

= ![ !( (!m0)(!m2)(!m3)(!m5)(!m6) ) ]

= (M0)(M2)(M3)(M5)(M6)

= (0,2,3,5,6).

• Note: Quickly, we can change from minterms (maxterms) to maxterms (minterms) by changing () to () and list those indices of terms missing from the original list.

ECE 124 Digital Circuits and Systems Page 7

DeMorgan

(!m0)=(M0) DeMorgan

Page 8: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Standard Sum-Of-Products (1)

• A function described using a canonical SOP (minterms) is by no means minimal. It might require more gates/literals than required.

• Let us call any AND of literals a product term.

• We can then express logic functions in Standard Sum-Of-Products form where, instead of minterms, the AND terms are simply product terms.

• We can start with a canonical SOP and use Boolean algebra to simply the expression into something simpler.

ECE 124 Digital Circuits and Systems Page 8

Page 9: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Standard Sum-Of-Products (2)

ECE 124 Digital Circuits and Systems Page 9

• Let’s consider one of our previous functions in Canonical SOP.

• If we used Boolean algebra to simplify, we would find that f2 can also

be written as a Standard SOP using a sum of product terms:

This is not in minterm form

Page 10: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Standard Product-Of-Sums (1)

• A function described using a canonical POS (maxterms) is by no means minimal. It might require more gates/literals than required.

• Let us call any OR of literals a sum term.

• We can then express logic functions in Standard Product-Of-Sums form where, instead of maxterms, the OR terms are simply sum terms.

• We can start with a canonical POS and use Boolean algebra to simply the expression into something simpler.

ECE 124 Digital Circuits and Systems Page 10

Page 11: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Example of Standard Product-Of-Sums Forms

• Let’s consider one of our previous functions in Canonical POS.

ECE 124 Digital Circuits and Systems Page 11

• If we used Boolean algebra to simplify, we would find that f1 can also

be written as a Standard POS using a product-of-sum terms:

Page 12: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Other Logic Gates

• Although we can always implement any function we want using AND/OR/NOT, there are other types of logic gates that prove useful.

ECE 124 Digital Circuits and Systems Page 12

Page 13: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

NAND and NOR gates (2-inputs)

NAND gate performs a “NOT-AND” operation.

ECE 124 Digital Circuits and Systems Page 13

• NAND/NOR gates can be extended to multiple inputs, but the NAND/NOR gates are

not associative (explained later). We should always think of NAND as “NOT-AND”

and NOR as “NOT-OR”.

• NOR gate performs a “NOT-OR” operation.

Page 14: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

NAND and NOR gates (n-inputs)

• Think of multiple input NAND/NOR gates in terms of the operations they perform; i.e., NOT-AND (for a NAND) and NOT-OR (for a NOR).

• Example: 3-input versions:

ECE 124 Digital Circuits and Systems Page 14

Page 15: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

XOR and NXOR gates (2-inputs)

• XOR gate (with 2-inputs performs a “difference operation”):

ECE 124 Digital Circuits and Systems Page 15

• XOR/NXOR gates are incredibly useful for arithmetic operations like

addition/subtraction/multiplication. These gates can also be extended to multiple

inputs, but we need to be clear on their definitions with multiple inputs.

• NXOR gate (with 2-inputs performs a “equivalence operation”):

Page 16: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

XOR gates with multiple inputs.

• A XOR gate with > 2 inputs performs the “odd operation”; the output is a 1 whenever an odd number of inputs are 1.

• Example: 3-input versions:

ECE 124 Digital Circuits and Systems Page 16

• XOR gates are associative (explained later).

Page 17: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

NXOR gates with multiple inputs.

• A NXOR gate with > 2 inputs performs the “odd function”; the output is a 1 whenever an even number of inputs are 1.

• Example: 3-input versions:

ECE 124 Digital Circuits and Systems Page 17

• NXOR gates are non-associative (explained later).

Page 18: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Buffer (1-input)

• Does nothing logically; Used in implementation to “boost” a signal’s strength.

ECE 124 Digital Circuits and Systems Page 18

Page 19: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Associative and Non-Associative Gates

AND/OR gates are associative gates. This means that we can collapse

many smaller AND (OR) gates into a single AND (OR) gate with

multiple inputs.

Example:

ECE 124 Digital Circuits and Systems Page 19

• XOR gates are also associative. Not all types of logic gates are associative.

Page 20: WEEK 2.2 CANONICAL FORMS - University of Waterloobasir/ECE124/week2-2.pdf · 2012-01-15 · Canonical Sum-of-Products (SOP) ECE 124 Digital Circuits and Systems Page 2 • Given a

Non-Associative Gates

NAND/NOR and NXOR gates are not

associative.

ECE 124 Digital Circuits and Systems Page 20