Top Banner
• We know binary • We know how to add and subtract in binary – Same as in decimal • Next up: learn how apply this knowledge Boolean and Binary Inputs
34

We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Dec 28, 2015

Download

Documents

Jared Ellis
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: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

• We know binary

• We know how to add and subtract in binary– Same as in decimal

• Next up: learn how apply this knowledge

Boolean and Binary Inputs

Page 2: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

• Discrete voltages represented by 1 and 0

• For example: 0 = ground (GND) or 0 volts

1 = VDD or 5 volts

• What about 4.99 volts? Is that a 0 or a 1?

• What about 3.2 volts?

Boolean and Binary Inputs

Page 3: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Logic Levels

• Range of voltages for 1 and 0

• Different ranges for inputs and outputs to allow for noise

Page 4: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Logic Gates• Perform logic functions:

– inversion (NOT), AND, OR, etc.

• Single-input: – NOT gate, buffer

• Two-input: – AND, OR, etc.

Boolean and Binary Inputs

Page 5: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

The Static Discipline

• With logically valid inputs, every circuit element must produce logically valid outputs

• Use limited ranges of voltages to represent discrete values

Page 6: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application

Driver ReceiverForbidden

Zone

NML

NMH

Input CharacteristicsOutput Characteristics

VO H

VDD

VO L

GND

VIH

VIL

Logic HighInput Range

Logic LowInput Range

Logic HighOutput Range

Logic LowOutput Range

NMH = VOH – VIH

NML = VIL – VOL

Page 7: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - Transistors

g

s

d

g = 0

s

d

g = 1

s

d

OFF ON

• Logic gates built from transistors

• 3-ported voltage-controlled switch– 2 ports connected depending on voltage of 3rd– d and s are connected (ON) when g is 1

Page 8: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

8

Boolean algebra is based on the binary number system

George Boole(November 2, 1815 – December 8, 1864)

Page 9: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

9

Truth Tables

Boolean operations can be defined using a Truth Table.

Inversion:

A A

0 11 0

AND:A B A·B

0 0 00 1 01 0 01 1 1

OR:A B A+B

0 0 00 1 11 0 11 1 1

or justAB

Page 10: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

10

Truth Tables

Boolean operations can be defined using a Truth Table.

XOR:A B AB

0 0 00 1 11 0 11 1 0

NAND:A B A·B

0 0 10 1 11 0 11 1 0

NOR:A B A+B

0 0 10 1 01 0 01 1 0

Page 11: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

11

DeMorgan’s Theorems

A B A·B A·B A B A + B

0 0 0 1 1 1 10 1 0 1 1 0 11 0 0 1 0 1 11 1 1 0 0 0 0

A·B = A + B A+B = A · B

Proof:

A B A+B A+B A B A · B

0 0 0 1 1 1 10 1 1 0 1 0 01 0 1 0 0 1 01 1 1 0 0 0 0

Page 12: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

12

Example

A B C A BC AB BC BC AB F

0 0 0 1 1 1 0 0 0 0 00 0 1 1 1 0 0 0 1 0 10 1 0 1 0 1 0 1 0 1 10 1 1 1 0 0 0 0 0 1 11 0 0 0 1 1 1 0 0 0 11 0 1 0 1 0 1 0 1 0 11 1 0 0 0 1 0 1 0 0 11 1 1 0 0 0 0 0 0 0 0

F = AB + BC + BC + AB

Page 13: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

13

Another Example

F = AB + BC + BC + AC

A B C C AB BC BC AC F

0 0 0 1 0 0 0 0 00 0 1 0 0 0 0 0 00 1 0 1 0 1 0 0 10 1 1 0 0 0 1 0 11 0 0 1 0 0 0 0 01 0 1 0 0 0 0 1 11 1 0 1 1 1 0 0 11 1 1 0 1 0 1 1 1

Page 14: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

14

F = AB + BC + BC + AC

A B C C AB BC BC AC F

0 0 0 1 0 0 0 0 00 0 1 0 0 0 0 0 00 1 0 1 0 1 0 0 10 1 1 0 0 0 1 0 11 0 0 1 0 0 0 0 01 0 1 0 0 0 0 1 11 1 0 1 1 1 0 0 11 1 1 0 1 0 1 1 1

Is there a simpler way to determine how these inputs can produce these outputs?

Probably.

Page 15: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

15

Simplifying logical expression using Boolean algebra is not easy. Obscure identities must be applied in clever ways (this requires LOTS of practice).

There is a much easier (and more practical) way: Karnaugh maps

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Page 16: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

16

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F = _

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh maps

Karnaugh Maps - Rules of Simplification

Rule 1. Groups may not include any cell containing a zero

Page 17: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

17

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =_

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh maps

Karnaugh Maps - Rules of Simplification

Rule 2. Groups may be horizontal or vertical, but not diagonal.

Page 18: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

18

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh Maps - Rules of Simplification Rule 3. Groups must contain 1, 2, 4, 8, or in general 2n cells. That is if n = 1, a group will contain two 1's since 21 = 2. If n = 2, a group will contain four 1's since 22 = 4.

Page 19: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

19

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh Maps - Rules of Simplification

Rule 4. Each group should be as large as possible. Each cell containing a one must be in at least one group.

Page 20: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

20

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh Maps - Rules of Simplification Rule 5. Groups may overlap.

Page 21: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

21

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh Maps - Rules of Simplification Rule 6. Groups may wrap around the table. The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be grouped with the bottom cell.

Page 22: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

22

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh Maps - Rules of Simplification Rule 7. There should be as few groups as possible, as long as this does not contradict any of the previous rules.

Page 23: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

23

F =

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Karnaugh Maps - Rules of Simplification

Rule 7. There should be as few groups as possible, as long as this does not contradict any of the previous rules.

Rule 6. Groups may wrap around the table. The leftmost cell in a row may be grouped with the rightmost cell and the top cell in a column may be grouped with the bottom cell.

Rule 5. Groups may overlap.

http://www.youtube.com/watch?v=PA0kBrpHLM4

Rule 1. Groups may not include any cell containing a zero

Rule 4. Each group should be as large as possible. Each cell containing a one must be in at least one group.

Rule 3. Groups must contain 1, 2, 4, 8, or in general 2n cells. That is if n = 1, a group will contain two 1's since 21 = 2. If n = 2, a group will contain four 1's since 22 = 4.

Rule 2. Groups may be horizontal or vertical, but not diagonal.

Page 24: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Boolean Algebra

24

Simplifying logical expression using Boolean algebra is not easy. Obscure identities must be applied in clever ways (this requires LOTS of practice).

There is a much easier (and more practical) way: Karnaugh maps

A B C D F0 0 0 0 00 0 0 1 00 0 1 0 00 0 1 1 00 1 0 0 10 1 0 1 00 1 1 0 00 1 1 1 01 0 0 0 11 0 0 1 11 0 1 0 11 0 1 1 11 1 0 0 11 1 0 1 01 1 1 0 11 1 1 1 1

0123456789

101112131415

F = AC + AB + BCD___

0 1 3 2

4 5 7 6

12 13 15 14

8 9 11 10

0 0 0 01 0 0 0

1 0 1 1

1 1 1 1A

B

C

D

Page 25: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Implementing Logic with Switches

25

X

Y

0

1

1

0

X Y L0 0 00 1 11 0 11 1 0

XOR:A B AB

0 0 00 1 11 0 11 1 0

Page 26: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Logic Gates

26

Page 27: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

• Nicknamed “Mayor of Silicon Valley”

• Cofounded Fairchild Semiconductor in 1957

• Cofounded Intel in 1968• Co-invented the integrated

circuit• Figured out how to connect

multiple transistors on a silicon chip

Robert Noyce (1927-1990)

Page 28: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - MOS Transistors

n

p

gatesource drain

substrate

SiO2

nMOS

Polysilicon

n

gate

source drain

• Metal oxide silicon (MOS) transistors: – Polysilicon (used to be metal) gate

– Oxide (silicon dioxide) insulator

– Doped silicon

Page 29: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - Transistors: nMos

n

p

gatesource drain

substrate

n n

p

gatesource drain

substrate

n

GND

GND

VDD

GND

+++++++- - - - - - -

channel

Gate = 0

OFF (no connection between source and drain)

Gate = 1

ON (channel between source and drain)

Page 30: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - Transistors: pMOS

SiO2

n

gatesource drainPolysilicon

p p

gate

source drain

substrate

• pMOS transistor is opposite– ON when Gate = 0– OFF when Gate = 1

Page 31: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - Transistor Function

g

s

d

g = 0

s

d

g = 1

s

d

g

d

s

d

s

d

s

nMOS

pMOS

OFF ON

ON OFF

Page 32: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - nMOS vs pMOS

• nMOS: pass good 0’s, so connect source to GND

• pMOS: pass good 1’s, so connect source to VDD

pMOSpull-upnetwork

outputinputs

nMOSpull-downnetwork

VDD

GND

Page 33: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - CMOS Gates: nMOS

VDD

A Y

GND

N1

P1

NOT

Y = A

A Y0 11 0

A Y

A P1 N1 Y

0

1

Page 34: We know binary We know how to add and subtract in binary –Same as in decimal Next up: learn how apply this knowledge Boolean and Binary Inputs.

Practical Application - CMOS Gates: nMOS

VDD

A Y

GND

N1

P1

NOT

Y = A

A Y0 11 0

A Y

A P1 N1 Y

0 ON OFF 1

1 OFF ON 0