Switch Closed x = 1 A switch has two states Open Closed/On x = - - PowerPoint PPT Presentation

switch
SMART_READER_LITE
LIVE PREVIEW

Switch Closed x = 1 A switch has two states Open Closed/On x = - - PowerPoint PPT Presentation

Switch Closed x = 1 A switch has two states Open Closed/On x = 0 Open/Off Symbol S x William Sandqvist william@kth.se Implementation of logic functions The switchen can be used to implement logic functions S Power Light x


slide-1
SLIDE 1

Switch

William Sandqvist william@kth.se

A switch has two states

– Closed/On – Open/Off

x 1 = x = S x

Closed Open Symbol

slide-2
SLIDE 2

Implementation of logic functions

William Sandqvist william@kth.se

The switchen can be used to implement logic functions

Power supply S Light

x

   = On Light 1 Off Light ) (x L

L(x) is a logic function x is a logic variabel

slide-3
SLIDE 3

The operation AND

William Sandqvist william@kth.se

AND-operation (•) is achieved by switches that are connected in series

2 1 1 2

) , ( x x x x L ⋅ =

S Power supply S Light x1 x2

slide-4
SLIDE 4

The operation OR

William Sandqvist william@kth.se

OR-operation (+) is achieved by switches connected in parallel

S Power supply S Light x1 x2

2 1 1 2

) , ( x x x x L + =

slide-5
SLIDE 5

Te operation NOT

William Sandqvist william@kth.se

NOT-operation inverts the logic value

S Light Power supply R

x

x x L = ) (

slide-6
SLIDE 6

Truth Table

William Sandqvist william@kth.se

A logical function can also be described by a truth table

1 stands for true 0 stands for false

AND OR

slide-7
SLIDE 7

Logic gates AND-gate

William Sandqvist william@kth.se

A B Y 1 1 1 1 1

B A Y ⋅ =

&

A B Y A B Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

slide-8
SLIDE 8

Logic gates OR-gate

William Sandqvist william@kth.se

1

A B Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

A B Y 1 1 1 1 1 1 1

B A Y + =

A B Y

slide-9
SLIDE 9

Logic gates inverter NOT

William Sandqvist william@kth.se

A Y 1 1

A Y =

1

A Y A Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

Inverter

slide-10
SLIDE 10

What function has this gate circuit?

William Sandqvist william@kth.se

x2 x1 f

A B

slide-11
SLIDE 11

Timing Diagram

William Sandqvist william@kth.se 1 1 1 1 1 x 1 x 2 A B f Time

x2 x1 f

A B

slide-12
SLIDE 12

Truth Table

William Sandqvist william@kth.se

x

1 x 2 f x 1

x

2

, ( ) 1 1 1 1 1 1 1

A B 1 0 1 0 0 0 0 1

x2 x1 f

A B

slide-13
SLIDE 13

Multiple gate circuits can implement the same functionality!

William Sandqvist william@kth.se

a)

f =x

1 + x1⋅ x2

x2 x1 f

A B

slide-14
SLIDE 14

Multiple gate circuits can implement the same functionality!

William Sandqvist william@kth.se

a)

x2 x1 g

b)

g = x

1 + x2

f =x

1 + x1⋅ x2

x2 x1 f

A B f = g

2 1

1 1 1 1 1 1 1 1 1 1 x x f g

slide-15
SLIDE 15

Boolean algebra

William Sandqvist william@kth.se

  • As several gate circuits can implement

the same functionality, you want to find the most cost effective implementation

  • The gate circuits can be very large
  • A mathematical base is needed so that

the automation of gate minimizing can be implemented with computers

slide-16
SLIDE 16

Boolean algebra axiom

William Sandqvist william@kth.se

slide-17
SLIDE 17

Venn-diagram

William Sandqvist william@kth.se

Venn-diagram could be used to illustrate logic operations

slide-18
SLIDE 18

Venn-diagram

William Sandqvist william@kth.se

y z x x⋅ y x y x⋅ y + z

Venn-diagram could be used to illustrate logic operations

slide-19
SLIDE 19

Boolean algebra with Venn-diagram

William Sandqvist william@kth.se

1+A=1 0A=0 A’+A=1 AA’=0 A+A=A AA=A

slide-20
SLIDE 20

Boolean algebra simple rules

William Sandqvist william@kth.se

With the axiom as a base one can formulate new theorems

slide-21
SLIDE 21

The duality principle

William Sandqvist william@kth.se

If you have a valid boolean theorem, you get another valid theorem by simultaneously replacing

– all 0 with 1 and all 1 with 0 – all AND with OR and all OR with AND

slide-22
SLIDE 22

Two- and Three- Variable Properties

William Sandqvist william@kth.se

slide-23
SLIDE 23

Example

William Sandqvist william@kth.se

Prove the consensus theorem (17a)

– with algebraic manipulation

slide-24
SLIDE 24

Proof of consensus

William Sandqvist william@kth.se

17 a) z x z y y x z x y x ⋅ + ⋅ + ⋅ = ⋅ + ⋅ side) left ( ) ( ) ( ) ( ) ( ) ( side) right ( = ⋅ + ⋅ = ⋅ + ⋅ ⋅ + + ⋅ ⋅ = ⋅ ⋅ + ⋅ ⋅ + ⋅ ⋅ + ⋅ ⋅ = ⋅ ⋅ + ⋅ ⋅ + ⋅ ⋅ + ⋅ ⋅ + ⋅ ⋅ + ⋅ ⋅ = ⋅ + ⋅ + ⋅ ⋅ + + + ⋅ ⋅ = = ⋅ + ⋅ + ⋅ z x y x y y z x z z y x z y x z y x z y x z y x z y x z y x z y x z y x z y x z y x z y y x z y x x z z y x z x z y y x

slide-25
SLIDE 25

Notation Options

William Sandqvist william@kth.se

Different authors use different notations!

slide-26
SLIDE 26

William Sandqvist william@kth.se

slide-27
SLIDE 27

Analysis and Synthesis

William Sandqvist william@kth.se

Synthesis

– Construction of a gate circuit that implements a given logic function

Analysis

– Analysing the logical operation of an existing gate circuit

slide-28
SLIDE 28

How can the following truth table be implemented with logic gates?

William Sandqvist william@kth.se

slide-29
SLIDE 29

Faucet

  • pen/closed 1/0

Pressure

  • n/off 1/0

Blind guess: Warn if pressure is on at the same time as the faucet is closed.

OK OK OK not OK

( Why this truth table? )

William Sandqvist william@kth.se

Gismo …

slide-30
SLIDE 30

How can the following truth table be implemented with logic gates?

William Sandqvist william@kth.se

  • 1. Logic function

f = x

1x 2 + x 1x2 + x1x2

slide-31
SLIDE 31

How can the following truth table be implemented with logic gates?

William Sandqvist william@kth.se

f = x

1x 2 + x 1x2 + x1x2

f x

1

x

2

  • 2. Making a direct implementation of the logic function.
slide-32
SLIDE 32

How can the following truth table be implemented with logic gates?

William Sandqvist william@kth.se

  • 2. (Better) Minimize the logic function

2 1 (8b) 2 1 (12a)

  • n

Distributi 2 1 1 2 2 1 (7b) 2 1 term redundant addl 2 1 2 1 2 1 2 1 2 1 2 1 2 1

1 1 ) ( ) ( x x x x x x x x x x x x x x x x x x x x x x x x f

x x

+ = ⋅ + ⋅ = + + + = + + + = + + =

slide-33
SLIDE 33

How can the following truth table be implemented with logic gates?

William Sandqvist william@kth.se

  • 3. Implement the minimized function

f = x

1 + x2

f x

2

x

1

Much simpler implementation!

slide-34
SLIDE 34

Discussion: Algebraic Manipulation

William Sandqvist william@kth.se

  • Algebraic manipulation of logical

expressions can lead to efficient implementations

  • But: For large networks, it may be

very difficult to identify possible

  • ptimizations

We need a method that works for all combinational network!

slide-35
SLIDE 35

Minterms and Maxterms

William Sandqvist william@kth.se

  • A minterm is a product term for a

logical function with all the variables of the logic function represented

  • A maxterm is a summary term for a

logical function with all the variables of the logic function represented

slide-36
SLIDE 36

Minterm and Maxterm

William Sandqvist william@kth.se

= 1 = 0

slide-37
SLIDE 37

Introduktion SoP och PoS

William Sandqvist william@kth.se

The following logic function should be described by a Boolean expression

slide-38
SLIDE 38

Sum of Products SoP

William Sandqvist william@kth.se

m1 m4 m5 m6

f = x

1x 2x3 + x1x 2x 3 + x1x 2x3 + x1x2x 3 =

m(1,4,5,6)

slide-39
SLIDE 39

Sum - of - Products

William Sandqvist william@kth.se

A sum of products (sum-of-products) is a logic function f that is formed by summing the product terms so that f becomes 1 if one of the product terms becomes 1.

  • The following abbreviations are used SOP (English)

and SP (Swedish) In SOP-normal form, all product terms are minterms, it is also named disjunctive normal form.

slide-40
SLIDE 40

Products - of - Sums

William Sandqvist william@kth.se

M0 M2 M3 M7

= + + ⋅ + + ⋅ + + ⋅ + + = ) 7 , 3 , 2 , ( ) ( ) ( ) ( ) (

3 2 1 3 2 1 3 2 1 3 2 1

M x x x x x x x x x x x x f

slide-41
SLIDE 41

Products - of - Sums

William Sandqvist william@kth.se

A product of sums (product-of-sums) is a logic function f which is formed by the product of the sum

  • f terms such that f is 0 if one of sumterms is 0.
  • The following abbreviations are used POS (English)

and PS (Swedish) In POS-normal form all sumterms are maxterms

  • It is also referred to as conjunctive normal form
slide-42
SLIDE 42

Duality between Minterms and Maxterms and between SP and PS

William Sandqvist william@kth.se

  • To each minterm there is a corresponding

maxterm

i i

M m f = =

15a) DeMorgan (use

3 2 1 3 2 1 3 2 1

x x x x x x x x x m M + + = + + = ⋅ ⋅ = =

  • To each SP there is a corresponding PS

f = m(1,4,5,6) = M(0,2,3,7)

∏ ∑

slide-43
SLIDE 43

William Sandqvist william@kth.se

slide-44
SLIDE 44

Logic gates NAND-gate

William Sandqvist william@kth.se

A B Y 1 1 1 1 1 1 1

B A Y ⋅ =

&

A B Y A B Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

slide-45
SLIDE 45

Logic gates NOR-gate

William Sandqvist william@kth.se

1

A B Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

A B Y 1 1 1 1 1

B A Y + =

A B Y

slide-46
SLIDE 46

Only one type of gate is needed!

William Sandqvist william@kth.se

= = = NOT AND OR

For implementing a Boolean function requires only NAND or NOR gates

slide-47
SLIDE 47

DeMorgans theorem – bubble gates

William Sandqvist william@kth.se

x

1

x

2

x

1

x

2

x

1

x

2

x

1

x

2

x

1

x

2

x

1

x

2

x

1

x

2

x

1 x 2

+ =

(a)

x

1 x 2

+ x

1

x

2

=

(b)

Inverted inputs (DeMorgan (15a)) (DeMorgan (15b))

A NOR is a bubble-AND A NAND is a bubble-OR

slide-48
SLIDE 48

Inverter with NAND

William Sandqvist william@kth.se

A Y A Y

=

Y =A = A⋅ A

slide-49
SLIDE 49

AND-gate with NAND-gates

William Sandqvist william@kth.se

=

A B Y A B Y

Y = A⋅ B = A⋅ B

slide-50
SLIDE 50

OR-gate with NAND-gates

William Sandqvist william@kth.se

A A B Y B Y

Y = A + B = A + B = A⋅ B = A⋅ A⋅ B⋅ B

slide-51
SLIDE 51

Logic functions with only NAND

William Sandqvist william@kth.se

x

1

x

2

x

3

x

4

x

5

x

1

x

2

x

3

x

4

x

5

x

1

x

2

x

3

x

4

x

5

AND-OR function BubleOR= NAND

slide-52
SLIDE 52

Universal sets of gates

William Sandqvist william@kth.se

A set of gates is universal or complete if all kombinatorical systems can be described with this set. Example of universal sets of gates:

{AND, OR, NOT} -> (DeMorgan) -> {AND,NOT} -> {NAND} {OR, AND, NOT} -> (DeMorgan) -> {OR,NOT} -> {NOR}

slide-53
SLIDE 53

William Sandqvist william@kth.se

slide-54
SLIDE 54

Logic gates XOR-gate

William Sandqvist william@kth.se

1

A B Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

A B Y 1 1 1 1 1 1

B A B A B A Y ⋅ + ⋅ = ⊕ =

A B Y Exclusive OR

slide-55
SLIDE 55

Logic gates XNOR-gate

William Sandqvist william@kth.se

1

A B Y

Traditional (American) Symbol IEC Symbol (International Electrotechnical Commission)

A B Y 1 1 1 1 1 1

B A B A B A Y ⋅ + ⋅ = ⊕ =

A B Y

slide-56
SLIDE 56

William Sandqvist william@kth.se

slide-57
SLIDE 57

Example: Three-way light control

William Sandqvist william@kth.se

Brown/Vranesic: 2.8.1

Suppose that we need to be able to turn on / off the light from three different places. x1 x2 x3 f x1 x2 x3 f

slide-58
SLIDE 58

Three-way light control

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1 1 1 1 1

3 2 1

f x x x

x1 x2 x3 f One should always be able to change the light by changing any switch.

slide-59
SLIDE 59

Three-way light control

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3 2 1

f x x x

x1 x2 x3 f One should always be able to change the light by changing any switch.

slide-60
SLIDE 60

Three-way light control

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3 2 1

f x x x

x1 x2 x3 f One should always be able to change the light by changing any switch.

slide-61
SLIDE 61

Three-way light control

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3 2 1

f x x x

x1 x2 x3 f One should always be able to change the light by changing any switch.

slide-62
SLIDE 62

Three-way light control

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3 2 1

f x x x

x1 x2 x3 f The truth table now corresponds with the specifications! One should always be able to change the light by changing any switch.

slide-63
SLIDE 63

Three-way light control

William Sandqvist william@kth.se

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3 2 1

f x x x

x1 x2 x3 f m1 m2 m4 m7 M0 M3 M5 M6

) ( ) ( ) ( ) ( ) 6 , 5 , 3 , (

3 2 1 3 2 1 3 2 1 3 2 1

x x x x x x x x x x x x M f + + ⋅ + + ⋅ + + ⋅ + + = = =∏ 3 2 1 3 2 1 3 2 1 3 2 1

) 7 , 4 , 2 , 1 ( x x x x x x x x x x x x m f + + + = = = ∑

eller

slide-64
SLIDE 64

Three-way light control

William Sandqvist william@kth.se

x1 x2 x3 f

3 2 1 3 2 1 3 2 1 3 2 1

) 7 , 4 , 2 , 1 ( x x x x x x x x x x x x m f + + + = = ∑

slide-65
SLIDE 65

Three-way light control

William Sandqvist william@kth.se

x1 x2 x3 f

) ( ) ( ) ( ) ( ) 6 , 5 , 3 , (

3 2 1 3 2 1 3 2 1 3 2 1

x x x x x x x x x x x x M f + + ⋅ + + ⋅ + + ⋅ + + = =∏

slide-66
SLIDE 66

Summary

William Sandqvist william@kth.se

  • Logic functions can be described with

boolean algebra

  • There are logic gates for the usual

boolean functions

  • A logic function can be expressed with

boolean algebra as:

  • SOP-form (Sum of min-terms) or
  • POS-form (Product of max-terms)
slide-67
SLIDE 67

William Sandqvist william@kth.se