137
Andrew H. Fagg: Embedded Real-Time Systems: Digital Logic 1 Last Time Introduction to embedded systems – Properties – Examples Class structure

–Properties –Examples

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

1

Last Time

• Introduction to embedded systems– Properties

– Examples

• Class structure

Page 2: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

2

Administrivia

Lab hours proposal

• Monday/Wednesday: 1-5

• Tuesday/Thursday: 10:30-12:30 and 1:30-4:30

Lab location: EL 124

• If you do not find the lab open, find one ofus (in 141 or 152)

Page 3: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

3

AdministriviaOffice hours (until lab opens):

• Andrew Fagg (EL 152):– Monday: 1-2

– Wednesday: 4-5

– Or by appointment

• Mark Woehrer (EL 141):– Tuesday: 10:30-11:30

– Wednesday: 3:30-4:30

– Or by appointment

Page 4: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

4

Schedule Notes

• Our class schedule is fluid– Changes will be announced in class and on

the Blackboard

Page 5: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

5

Today: Introduction to Digital Logic

• Binary encoding

• Boolean algebra

• Transistors to logic gates

Page 6: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

6

Encoding Information

In your ‘circuits and sensors’ class: how didyou encode information?

• e.g., the acceleration measured by youraccelerometer?

• or the rate of bend of a piezoelectricdevice?

Page 7: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

7

Encoding Information

Following some form of (implementationdependent) analog conditioning:

• Acceleration (or bend rate) is encoded inthe voltage that is output from the circuit

• As acceleration increases, the voltagealso increases

Page 8: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

8

Encoding Information

Following some form of (implementationdependent) analog conditioning:

• Acceleration (or bend rate) is encoded inthe voltage that is output from the circuit

• As acceleration increases, the voltagealso increases

• We say that this is an analog orcontinuous encoding of the information

Page 9: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

9

Analog Encoding

What is the problem with analog encoding?

Page 10: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

10

Analog Encoding

What is the problem with analog encoding?

• Small injections of noise – either in thesensor itself or from external sources – willaffect this analog signal

• This leads to errors in how we interpret thesensory data

How do we fix this?

Page 11: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

11

Digital Encoding

How do we fix this?

• At any instant, a single signal encodesone of two values:– A voltage around 0 (zero) Volts is interpreted

as one value

– A voltage around +5 V is interpreted asanother value

Page 12: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

12

Binary Encoding

• Binary digits can have one of two values:0 or 1

• We call 0V a binary “0” (or FALSE)

• And +5V a binary “1” (or TRUE)

Page 13: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

13

Binary Encoding

• Exactly what these levels are depends onthe technology that is used (it is commonnow to see +1.8V as a binary 1 in low-power processors)

• This encoding is much less sensitive tonoise: small changes in voltage do notaffect how we interpret the signal

Page 14: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

14

Transistors

What do transistors do for us?

Page 15: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

15

Transistors

What do transistors do for us?

• They act as current amplifiers

• But if we operate below the threshold andabove the saturation level, we can usethem to process digital signals

Page 16: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

16

Transistors to Digital Processing

Consider the following circuit:

• What is the output given an input of 0V?

• An input of +5V?

Page 17: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

17

Transistors to Digital Processing

• Input: 0V -> Output +5V

• Input: +5V -> Output 0V

• We call this a “NOT” gate

Page 18: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

18

The NOT Gate

• Logical Symbol:

• Algebraic Notation: B = A

• Truth Table:

01

10

BA

Page 19: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

19

A Two-Input Gate

What does thiscircuit compute?

- A and B are inputs

- C is the output

Page 20: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

20

The “NAND” Gate

011

101

110

100

CBA

• Logical Symbol:

• Algebraic Notation: C = A*B = AB

• Truth Table:

Page 21: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

21

The “AND” Gate

111

001

010

000

CBA

• Logical Symbol:

• Algebraic Notation: C = A*B = AB

• Truth Table:

Page 22: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

22

Yet Another Gate

What doesthis circuitcompute?

Page 23: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

23

The “NOR” Gate

• Logical Symbol:

• Algebraic Notation: C = A+B

• Truth Table:

011

001

010

100

CBA

Page 24: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

24

The “OR” Gate

• Logical Symbol:

• Algebraic Notation: C = A+B

• Truth Table:

111

101

110

000

CBA

Page 25: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

25

N-Input Gates

Gates can have anarbitrary number ofinputs (2,3,4,8,16 arecommon)

Page 26: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

26

Exclusive OR (“XOR”) Gates

• Logical Symbol:

• Algebraic Notation: C = A+B

• Truth Table:

011

101

110

000

CBA How would weimplement thiswithAND/OR/NOTgates?

Page 27: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

27

An XOR Implementation

Page 28: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

28

An Example

Problem: implement an alarm system• There are 3 inputs:

– Door open (1 represents open)– Window open– Alarm active (1 represents active)

• And one output:– Siren is on (1 represents on) when either the door or

window are open – but only if the alarm is active

What is the truth table?

Page 29: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

29

Alarm Example: Truth Table

1111

0011

1101

0001

1110

0010

0100

0000

SirenAWD

+

+

D W A

D W A

D W A

Page 30: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

30

Alarm Example: Circuit

Siren = D W A + D W A + D W A

Page 31: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

31

Alarm Example: Circuit

Is a simpler circuit possible?

Page 32: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

32

Alarm Example: Truth Table

1111

0011

1101

0001

1110

0010

0100

0000

SirenAWD

Page 33: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

33

Alarm: An Alternative Circuit

Page 34: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

34

Next Time

• Some notes on Boolean Algebra

• DeMorgan’s Laws

• Multiplexers

• Demultiplexers

• Circuit reduction with Karnaugh Maps

Page 35: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

35

Last Time

• Transistors to digital logic

• Basic gates: AND, OR, NOT

• Other gates: XOR, NOR, NAND

Page 36: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

36

Today

Circuit reduction tools:

• Boolean Algebra

• DeMorgan’s Laws

• Karnaugh Maps

Page 37: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

37

Administrivia

• Project 1 is delayed until next week

• You should have received the test email tothe class mailing list: if not we need to fix itASAP

Page 38: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

38

Administrivia

Lab hours

• Monday/Wednesday: 9-11 and 2-5

• Tuesday/Thursday: 10:30-12:30 and 1:30-4:30

Until lab is handed out next week:

• Fagg: Monday: 10-11, Wednesday: 4-5

• Woehrer: Tuesday: 10:30-11:30, Thursday:3:30-4:30

Page 39: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

39

Boolean Algebra

• There are exactly two numbers in BooleanSystem: “0” and “1”

• You are already familiar with the “integers”:{… -2, -1, 0, 1, 2, …}– (and Integer Algebra)

Page 40: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

40

Boolean Algebra

• Like the integers, Boolean Algebra has thefollowing operators:

NOTnegationinverse

ANDproduct*

ORaddition+

BooleanIntegers

Page 41: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

41

NOT Operator

Definition:

• 0 = 0’ = 1

• 1 = 1’ = 0

Suppose that “X” is a Boolean variable,then:

• X = X’’ = X

NOTE: this is identical to our truthtable (just a slightly differentnotation)

Page 42: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

42

OR (+) Operator

Definition:

• 0+0 = 0

• 0+1 = 1

• 1+0 = 1

• 1+1 = 1

Page 43: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

43

OR (+) Operator

Suppose “X” is a Boolean variable, then:

• 0 + X = X

• 1 + X = 1

• X + X = X

• X + X’ = 1

Page 44: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

44

AND (*) Operator

Definition:

• 0*0 = 0

• 0*1 = 0

• 1*0 = 0

• 1*1 = 1

Page 45: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

45

AND (*) Operator

Suppose “X” is a Boolean variable, then:

• 0 * X = 0

• 1 * X = X

• X * X = X

• X * X’ = 0

Page 46: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

46

Boolean Algebra Rules:Precedence

The AND operator applies before the ORoperator:

A * B + C = (A * B) + C

A + B * C = A + (B * C)

Page 47: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

47

Boolean Algebra Rules:Association Law

If there are several AND operations, it doesnot matter which order they are applied in:

A * B * C = (A * B) * C = A * (B * C)

Page 48: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

48

Boolean Algebra Rules:Association Law

Likewise for the OR operator:

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

Page 49: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

49

Boolean Algebra Rules:Distributive Law

AND distributes across OR:

A * (B + C) = (A * B) + (A * C)

A + (B * C) = (A + B) * (A + C)

Page 50: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

50

Boolean Algebra Rules:Commutative Law

Both AND and OR are symmetric operators(the order of the variables does notmatter):

A + B = B + A

A * B = B * A

Page 51: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

51

DeMorgan’s Laws

(A * B)’ = A’ + B’

How do we convince ourselves that this istrue?

Page 52: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

52

Proof by Truth Table

0011

1101

1110

1100

A’ + B’(A * B)’BA

NOTE:change inthe NOTnotation

Page 53: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

53

DeMorgan’s Laws (cont)

(A + B)’ = A’ * B’

Page 54: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

54

Proof by Truth Table

0011

0001

0010

1100

A’ * B’(A + B)’BA

Page 55: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

55

Alarm Example: Truth Table

1111

0011

1101

0001

1110

0010

0100

0000

SirenAWD

+

+

D’ W A

D W’ A

D W A

Page 56: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

56

Reduction with Algebra

X + X’ = 1= 1* W A + 1* DA

AssociativeLaw

= (D’ + D) WA + (W’ + W) DA

“= D’ WA + DWA + W’DA + WDA

Commutative

Law

= D’ WA + DWA + DW’A + DWA

X + X = X= D’ W A + D W’ A + DWA + DWA

D’ W A + D W’ A + DWA

Page 57: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

57

Reduction with Algebra (cont)

AssociativeLaw

= (W + D) * A

X * 1 = X= WA + DA

1* W A + 1* DA

We have the same circuit as before!

Page 58: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

58

Karnaugh Maps

Geometric technique for reducing circuits

• Step 1: Construct the map

• Step 2: Fill in the output

• Step 3: Identify “clusters” in the map

• Step 4: Read out the terms

Page 59: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

59

Suppose We Have the FollowingTruth Table:

1111

1011

0101

0001

1110

1010

1100

0000

DCBA

3 Inputs

1 Output

Page 60: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

60

Karnaugh MapsStep 1: Construct Map

1

0

10110100ABC

Page 61: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

61

Karnaugh MapsStep 1: Construct Map

1

0

10110100ABC

C

B A

Page 62: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

62

Karnaugh MapsStep 1: Construct Map

1

0

10110100ABC

C

B A

A*B*C

Page 63: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

63

Karnaugh MapsStep 1: Construct Map

1

0

10110100ABC

C

B A

A’ B C’

Page 64: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

64

Karnaugh MapsStep 2: Insert Output Values

1111

1011

0101

0001

1110

1010

1100

0000

DCBA

Enter outputvalues intomap

Page 65: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

65

Karnaugh Maps Step 2: Insert Output Values

01111

01100

10110100ABC

C

B A

Page 66: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

66

Karnaugh MapsStep 3: Identify Clusters of 1’s

01111

01100

10110100ABC

C

B A

A’ B C

Page 67: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

67

Karnaugh MapsStep 3: Identify Clusters of 1’s

01111

01100

10110100ABC

C

B A

A’ B

Page 68: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

68

Karnaugh MapsStep 3: Identify Clusters of 1’s

01111

01100

10110100ABC

C

B A

C B

Page 69: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

69

Karnaugh MapsStep 3: Identify Clusters of 1’s

01111

01100

10110100ABC

C

B A

B

Page 70: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

70

Karnaugh MapsStep 3: Identify Clusters of 1’s

Clustering Rules:

• A cluster may not contain a ‘0’

• All ‘1’s must be covered

• But: it is OK for a ‘1’ to be covered bymore than one cluster

Page 71: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

71

Karnaugh MapsStep 3: Identify Clusters of 1’s

01111

01100

10110100ABC

C

B A

B A’ C

Page 72: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

72

Karnaugh MapsStep 4: Read Out the Terms

“OR” the clusters together

Resulting logical rule:

B + A’C

Page 73: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

73

The Alarm Example (again)

1111

0011

1101

0001

1110

0010

0100

0000

SirenAWD

+

+

D’ W A

D W’ A

D W A

Page 74: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

74

Karnaugh Maps Step 1: Construct Map

1

0

10110100DWA

A

W D

Page 75: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

75

Karnaugh Maps Step 2: Insert Output Values

11101

00000

10110100DWA

A

W D

Page 76: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

76

Karnaugh Maps

Step 3: Identify Clusters of 1’s

11101

00000

10110100DWA

A

W D

W A D A

Page 77: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

77

Karnaugh MapsStep 4: Read Out the Terms

Resulting logical rule:

WA + DA

Page 78: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

78

Karnaugh MapsStep 4: Read Out the Terms

Resulting logical rule:

WA + DA

Which can be simplified to:

A * (W + D)

Page 79: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

79

Next Time

• More on Karnaugh Maps

• Multiplexers

• Demultiplexers

Page 80: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

80

A New K-Map Example

• Four input variables: A, B, C, D

• One output variable: E

Page 81: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

81

Truth Table

1

1

1

1

1

1

1

1

A

0111

0011

0101

1001

1110

0010

1100

0000

EDCB

0

0

0

0

0

0

0

0

A

1111

1011

0101

0001

1110

1010

1100

0000

EDCB

Page 82: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

82

Step 1: Construct Map

10

11

01

00

10110100ABCD

C

B A

D

Page 83: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

83

Step 2: Insert Output Values

001110

101111

100101

010000

10110100ABCD

C

B A

D

Page 84: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

84

Step 3: Identify Clusters

001110

101111

100101

010000

10110100ABCD

C

B A

D

C A’

Page 85: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

85

Step 3: Identify Clusters

001110

101111

100101

010000

10110100ABCD

C

B A

D

?

Page 86: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

86

Step 3: Identify Clusters

001110

101111

100101

010000

10110100ABCD

C

B A

D

B’ D

Page 87: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

87

Step 3: Identify Clusters

001110

101111

100101

010000

10110100ABCD

C

B A

D

ABD’C’

Page 88: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

88

Step 4: Read Out the Terms

C A’ + B’ D + A B D’ C’

What does the circuit look like?

Page 89: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

89

Resulting CircuitC A’ + B’ D + A B D’ C’

Page 90: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

90

“Don’t Care” Cases

• For some functions that we will implement,some of the input cases will never occur

• How does this affect our Karnaugh Map?

Page 91: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

91

Modified Truth Table

1

1

1

1

1

1

1

1

A

0111

0011

X101

1001

1110

X010

1100

0000

EDCB

0

0

0

0

0

0

0

0

A

1111

1011

0101

0001

1110

1010

1100

0000

EDCB

Page 92: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

92

Step 2: Insert Output Values

X01110

101111

1X0101

010000

10110100ABCD

C

B A

D

Page 93: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

93

Step 3: Identify Clusters

X01110

101111

1X0101

010000

10110100ABCD

C

B A

D

ABD’C’

Page 94: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

94

Step 3: Identify Clusters

X01110

101111

1X0101

010000

10110100ABCD

C

B A

D

ABC’

Page 95: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

95

Last Time

• Boolean Algebra

• Karnaugh Maps

Page 96: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

96

Today

• More on Karnaugh Maps

• Multiplexers

• Demultiplexers

• Tristate buffers

Page 97: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

97

Administrivia

Current office hours:

• Fagg: Monday: 10-11, Wednesday: 4-5

• Woehrer: Tuesday: 10:30-11:30, Thursday:3:30-4:30

Page 98: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

98

Step 3: Identify Clusters

X01110

101111

1X0101

010000

10110100ABCD

C

B A

D

ABC’

Page 99: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

99

Step 4: Read Out the Terms

C A’ + B’ D + A B C’

The resulting circuit is simpler (but just alittle in this case)

Page 100: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

100

A Diagonal Example

01011

10100

10110100ABC

C

B A

Page 101: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

101

Working Through the Algebra…

“=A B C

XORDefinition

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

DeMorgan=(A’B + AB’)’C + (A B)C’

Commutative

Law; XOR

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

AssociativeLaw

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

A’B’C + ABC + A’BC’ + AB’C’

+

+

+ +

+ +

Page 102: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

102

Diagonal Example II

01101

10100

10110100ABC

C

B A

Page 103: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

103

Diagonal Example IIBA’ + CB + AB’C’

Can we get away with fewerterms?

Page 104: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

104

Diagonal Example II

01101

10100

10110100ABC

C

B A

Page 105: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

105

Diagonal Example IICB + C’(A XOR B)

We can also arrive at this through algebraicmanipulation of our previous solution.How?

Page 106: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

106

Diagonal Example II

X + 1 = 1= CB + C’ (B XOR A)

Distributive Law= CB(A’ + 1) + C’(B XOR A)

XOR Definition= BA’C + CB + C’(B XOR A)

“= BA’C + CB + C’(BA’ + AB’)

Distributive Law= BA’C + BA’C’ + CB + AB’C’

X + X’ = 1= BA’(C + C’) + CB + AB’C’

BA’ + CB + AB’C’

Page 107: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

107

Multiple Output Variables

Suppose we have a function with multipleoutput variables?

• How do we handle this with KarnaughMaps?

Page 108: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

108

Multiple Output Variables

How do we handle this with KarnaughMaps?

• We produce one Karnaugh Map for eachoutput variable

• But: in the final implementation, some sub-circuits may be shared

Page 109: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

109

Karnaugh Maps: Final Notes

• Always use clusters that are as large aspossible

• Possible to extend technique to 5 and 6inputs (and more), but it starts to get hairy– Tend to make use of circuit design

“assistants”

Page 110: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

110

More Logical Components

• Multiplexer

• Demultiplexer

• Tristate buffer

Page 111: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

111

Multiplexer

A multiplexer is a devicethat selects between twoinput lines

• A & B are the inputs

• S is the selection signal(also an input)

• C is a copy of A if S=0

• C is a copy of B if S=1

Page 112: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

112

Multiplexer Truth Table

What would theKarnaugh map looklike?

1111

0011

1101

0001

1110

1010

0100

0000

CBAS

Page 113: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

113

Multiplexer K-Map

01101

11000

10110100ABS

S

B A

Page 114: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

114

Multiplexer Implementation

C = S’A + SB

Page 115: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

115

N-Input Multiplexer

Suppose we want toselect from betweenN different inputs.

• This requires morethan one select line.How many?

Page 116: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

116

N-Input Multiplexer

How many select lines?

• M = log2N

or

• N = 2M

What would the N=8implementation looklike?

Page 117: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

117

8-Input Multiplexer Implementation

C = I0S’2S’1S’0 + I1S’2S’1S0 + I2S’2S1S’0 +I3S’2S1S0 + I4S2S’1S’0 + I5S2S’1S0 +I6S2S1S’0 + I7S2S1S0

Note that we have one of eachpossible select line combination(or addressing terms)

Page 118: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

118

Last Time

• Karnaugh Maps

• Multiplexers

Page 119: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

119

Today

• Demultiplexers

• Tristate buffers

• Practical issues in digital logicimplementation

• Project 1

Page 120: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

120

Administrivia

Make sure you fill out and hand-in groupplacement forms today

Page 121: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

121

What Is It?

Page 122: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

122

A Mechanical Implementationof an OR Gate

goldfish.ikaruga.co.uk/logic.html

Page 123: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

123

A Mechanical Implementationof an OR Gate

Page 124: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

124

A Mechanical Implementationof an OR Gate

Page 125: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

125

A Mechanical Implementationof an OR Gate

Page 126: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

126

Demultiplexer

• The multiplexer reducesN signals down to 1 (withM select lines)

• A demultiplexer routes adata input (D) to one of Noutput lines (As)– Which A depends on the

select lines

Page 127: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

127

2-Input DemultiplexerTruth TableInputs Outputs

0001111

0000011

0010101

0000001

0100110

0000010

1000100

0000000

A0A1A2A3DS0S1

Page 128: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

128

Demultiplexer Implementation

• What does it look like?

Page 129: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

129

DemultiplexerImplementation

Page 130: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

130

M-Input (Select) Demultiplexer

• Will have 2M output lines

• Useful for converting a binary address intoselect lines for devices and memoryelements– (more on binary soon)

Page 131: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

131

Tristate Buffers

• Until now: the output line(s) of each deviceare driven either high or low– So the line is either a source or a sink of

current

• Tristate buffers can do this or leave theline floating (as if it were not connected toanything)

Page 132: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

132

Tristate Buffers

111

001

floating10

floating00

BAS

How are tristatebuffers useful?

Page 133: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

133

Tristate Buffers

We can wire the outputs ofmultiple tristate bufferstogether without any otherlogic

Page 134: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

134

Tristate Buffers

• We must guarantee that only one selectline is active at any one time

• Tristate buffers will turn out to be usefulwhen we start building data and addressbuses

Page 135: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

135

Another Tristate Buffer

What does the truth table look like?

Page 136: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

136

Another Tristate Buffer

floating11

floating01

110

000

BAS

Page 137: –Properties –Examples

Andrew H. Fagg: EmbeddedReal-Time Systems: Digital Logic

137

Next Time

• Practical issues in digital logicimplementation

• Project 1 details