transistors and logic - computer sciencegb/comp411fall2011/media/l08-transistorslogic.pdf · comp...

111
L08 Transistors and Logic 1 Comp 411 Transistors and Logic A B 1) The digital contract 2) Encoding bits with voltages 3) Processing bits with transistors 4) Gates 5) Truth-table SOP Realizations 6) Multiplexer Logic

Upload: others

Post on 14-Oct-2019

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 1Comp 411

Transistors and Logic

A

B

1) The digital contract2) Encoding bits with voltages3) Processing bits with transistors4) Gates5) Truth-table SOP Realizations6) Multiplexer Logic

Page 2: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 2Comp 411

Where Are We?

Things we know so far -1) Computers process information2) Information is measured in bits3) Data can be represented as groups of bits4) Computer instructions are encoded as bits5) Computer instructions are just data

6) We, humans, don‟t want to deal with bits…So we invent ASSEMBLY Languageeven that is too low-level so we inventCOMPILERs, and they are too rigid so …

But, what PROCESSES all these bits?

Page 3: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 3Comp 411

A Substrate for Computation

We can build devices for processing and representing bits using almost any physical phenomenon

neutrino fluxtrained elephantsengraved stone tabletsorbits of planetssequences of amino acidspolarization of a photon

Wait! Those last onesmight have potential...

1 0 1 0 0

1 1 0 1 00 1

Page 4: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 4Comp 411

Using Electromagnetic Phenomena

Things like:voltages phasecurrents frequency

For today let‟s discuss using voltages to encode information.Voltage pros:

easy generation, detectionvoltage changes can be very fastlots of engineering knowledge

Voltage cons:easily affected by environmentneed wires everywhere

Page 5: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 5Comp 411

Representing Information with Voltage

Representation of each point (x, y) on a B&W Picture:

0 volts: BLACK1 volt: WHITE0.37 volts: 37% Grayetc.

Representation of a picture:Scan points in some prescribedraster order… generate voltagewaveform

Page 6: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 6Comp 411

Representing Information with Voltage

Representation of each point (x, y) on a B&W Picture:

0 volts: BLACK1 volt: WHITE0.37 volts: 37% Grayetc.

Representation of a picture:Scan points in some prescribedraster order… generate voltagewaveform

Page 7: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 7Comp 411

Representing Information with Voltage

Representation of each point (x, y) on a B&W Picture:

0 volts: BLACK1 volt: WHITE0.37 volts: 37% Grayetc.

Representation of a picture:Scan points in some prescribedraster order… generate voltagewaveform

How much informationat each point?

Page 8: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 8Comp 411

Information Processing = Computation

First, let‟s introduce some processing blocks:(say, using a fancy photocopier/scanner/printer)

vCopyv

INVv 1-v

Page 9: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 9Comp 411

Let‟s build a system!

?

Copy INV

Copy INV

Copy INV

Copy INV

output

input

Page 10: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 10Comp 411

Let‟s build a system!

?

Copy INV

Copy INV

Copy INV

Copy INV

output

(In Theory)input

Page 11: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 11Comp 411

Let‟s build a system!

?

Copy INV

Copy INV

Copy INV

Copy INV

output

(In Theory)(Reality)

input

Page 12: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 12Comp 411

Why Did Our System Fail?

Why doesn‟t reality match theory?1. COPY Operator doesn‟t work right

2. INVERSION Operator doesn‟t work right

3. Theory is imperfect

4. Reality is imperfect

5. Our system architecture stinks

ANSWER: all of the above! Noise and inaccuracy are inevitable; we can‟t reliably reproduce infinite information-- we must design our system to tolerate some amount of error if it is to process information reliably.

Page 13: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 13Comp 411

The Key to System Design

A SYSTEM is a structure that is guaranteed to exhibit a specified behavior, assuming all of its components obey their specified behaviors.

How is this achieved?

Page 14: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 14Comp 411

The Key to System Design

A SYSTEM is a structure that is guaranteed to exhibit a specified behavior, assuming all of its components obey their specified behaviors.

How is this achieved? Contracts

Every system component will have clear obligations and responsibilities. If these are maintained we have every right to expect the system to behave as planned. If contracts are violated all bets are off.

Page 15: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 15Comp 411

The Digital Panacea ...

Why DIGITAL?

… because it keeps the contracts SIMPLE!

The price we pay for this robustness?

All the information that we transferbetween components is only 1 crummy bit!

But, in exchange, we get a guarantee of a reliable system.

0 or 1

Page 16: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 16Comp 411

The Digital Panacea ...

Why DIGITAL?

… because it keeps the contracts SIMPLE!

The price we pay for this robustness?

All the information that we transferbetween components is only 1 crummy bit!

But, in exchange, we get a guarantee of a reliable system.

0 or 1

Page 17: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 17Comp 411

The Digital Abstraction

Real World

“Ideal”Abstract World

Volts orElectrons orErgs or Gallons

Bits

0/1

Keep in mind, the world is not digital, we engineer it to behave that way. We must use real physical phenomena to implement digital designs!

Noise

ManufacturingVariations

Page 18: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 18Comp 411

A Digital Processing Element

• A combinational device is a circuit element that has– one or more digital inputs

– one or more digital outputs

– a functional specification that details the value of each output for every possible combination of valid input values output depends only on the latest inputs

– a timing specification consisting (at minimum) of an upper bound tpd on the time the device will take to produce the output value from stable valid input values

Page 19: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 19Comp 411

A Digital Processing Element

• A combinational device is a circuit element that has– one or more digital inputs

– one or more digital outputs

– a functional specification that details the value of each output for every possible combination of valid input values output depends only on the latest inputs

– a timing specification consisting (at minimum) of an upper bound tpd on the time the device will take to produce the output value from stable valid input values

input A

input B

input C

Page 20: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 20Comp 411

A Digital Processing Element

• A combinational device is a circuit element that has– one or more digital inputs

– one or more digital outputs

– a functional specification that details the value of each output for every possible combination of valid input values output depends only on the latest inputs

– a timing specification consisting (at minimum) of an upper bound tpd on the time the device will take to produce the output value from stable valid input values

input A

input B

input C

output Y

Page 21: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 21Comp 411

A Digital Processing Element

• A combinational device is a circuit element that has– one or more digital inputs

– one or more digital outputs

– a functional specification that details the value of each output for every possible combination of valid input values output depends only on the latest inputs

– a timing specification consisting (at minimum) of an upper bound tpd on the time the device will take to produce the output value from stable valid input values

Output a “1” if at least 2 out of 3 ofmy inputs are a “1”.

Otherwise, output “0”.

input A

input B

input C

output Y

Page 22: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 22Comp 411

A Digital Processing Element

• A combinational device is a circuit element that has– one or more digital inputs

– one or more digital outputs

– a functional specification that details the value of each output for every possible combination of valid input values output depends only on the latest inputs

– a timing specification consisting (at minimum) of an upper bound tpd on the time the device will take to produce the output value from stable valid input values

Output a “1” if at least 2 out of 3 ofmy inputs are a “1”.

Otherwise, output “0”.

I will generate a validoutput in no more than

2 minutes after seeing valid inputs

input A

input B

input C

output Y

Page 23: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 23Comp 411

A Digital Processing Element

• A combinational device is a circuit element that has– one or more digital inputs

– one or more digital outputs

– a functional specification that details the value of each output for every possible combination of valid input values output depends only on the latest inputs

– a timing specification consisting (at minimum) of an upper bound tpd on the time the device will take to produce the output value from stable valid input values

StaticDiscipline

Output a “1” if at least 2 out of 3 ofmy inputs are a “1”.

Otherwise, output “0”.

I will generate a validoutput in no more than

2 minutes after seeing valid inputs

input A

input B

input C

output Y

Page 24: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 24Comp 411

A Combinational Digital System

• A system of interconnected elements is combinational if– each circuit element is combinational

– every input is connected to exactly one outputor directly to a source of 0‟s or 1‟s

– the circuit contains no directed cycles

• But, in order to realize digital processingelements we have one more requirement!

Page 25: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 25Comp 411

A Combinational Digital System

• A system of interconnected elements is combinational if– each circuit element is combinational

– every input is connected to exactly one outputor directly to a source of 0‟s or 1‟s

– the circuit contains no directed cycles

• But, in order to realize digital processingelements we have one more requirement!

No feedback (yet!)

Page 26: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 26Comp 411

Noise Margins

Key idea: Don‟t allow “0” to be mistaken for a “1” or vice versa

Use the same “uniform representation convention”, for every component in our digital system

To implement devices with high reliability, we outlaw “close calls” via a representation convention which forbids a range of voltages between “0” and “1”.

Page 27: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 27Comp 411

Noise Margins

Key idea: Don‟t allow “0” to be mistaken for a “1” or vice versa

Use the same “uniform representation convention”, for every component in our digital system

To implement devices with high reliability, we outlaw “close calls” via a representation convention which forbids a range of voltages between “0” and “1”.

voltsForbidden Zone

Valid“0”

Valid“1”

Invalid

Min Voltage Max Voltage

Page 28: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 28Comp 411

Noise Margins

Key idea: Don‟t allow “0” to be mistaken for a “1” or vice versa

Use the same “uniform representation convention”, for every component in our digital system

To implement devices with high reliability, we outlaw “close calls” via a representation convention which forbids a range of voltages between “0” and “1”.

voltsForbidden Zone

Valid“0”

Valid“1”

Invalid

CONSEQUENCE:

Notion of “VALID” and “INVALID” logic levels

Min Voltage Max Voltage

Page 29: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 29Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

I will only outputa „1‟ if all myinputs are „1‟

A

BY OR

I will output a „1‟ if any of myinputs are „1‟

A

BY

A Y

A

BYXOR

I will only output a „1‟ if an odd numberof my inputs are „1‟

buffer inverter

I will output thecomplement of

my input

I will copy andrestore my input

to my output

Page 30: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 30Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

I will only outputa „1‟ if all myinputs are „1‟

A

BY OR

I will output a „1‟ if any of myinputs are „1‟

A

BY

A Y

A

BYXOR

I will only output a „1‟ if an odd numberof my inputs are „1‟

buffer inverter

I will output thecomplement of

my input

Page 31: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 31Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

I will only outputa „1‟ if all myinputs are „1‟

A

BY OR

I will output a „1‟ if any of myinputs are „1‟

A

BY

A Y

A

BYXOR

I will only output a „1‟ if an odd numberof my inputs are „1‟

buffer inverter

Page 32: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 32Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

A

BY OR

I will output a „1‟ if any of myinputs are „1‟

A

BY

A Y

A

BYXOR

I will only output a „1‟ if an odd numberof my inputs are „1‟

buffer inverter

Page 33: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 33Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

A

BY OR

A

BY

A Y

A

BYXOR

I will only output a „1‟ if an odd numberof my inputs are „1‟

buffer inverter

Page 34: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 34Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

A

BY OR

A

BY

A Y

A

BYXOR

buffer inverter

Page 35: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 35Comp 411

AND

Digital Processing Elements

Some digital processing elements occur so frequently that we give them special names and symbols

A Y

A

BY OR

A

BY

A Y

A

BYXOR

buffer inverter

In honor of the richestman in the world we willhenceforth refer todigital processingelements as “GATES”

Page 36: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 36Comp 411

From What Do We Make Digital Devices?

• Recall our common thread from Lecture 2…

• A controllable switch is a common link of all computing technologies

• How do you control voltages with a switch?

• By creating and opening paths between higher and lower potentials

Load

Page 37: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 37Comp 411

From What Do We Make Digital Devices?

• Recall our common thread from Lecture 2…

• A controllable switch is a common link of all computing technologies

• How do you control voltages with a switch?

• By creating and opening paths between higher and lower potentials

Load

This symbol indicates a “low” or ground potential

Page 38: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 38Comp 411

From What Do We Make Digital Devices?

• Recall our common thread from Lecture 2…

• A controllable switch is a common link of all computing technologies

• How do you control voltages with a switch?

• By creating and opening paths between higher and lower potentials

Load

This symbol indicates a “low” or ground potential

This symbol indicates a “high” potential, or the voltage of the power supply

Page 39: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 39Comp 411

N-Channel Field-Effect Transistors (NFETs)

D

G

S

D

G

S+

+

- -VGS

VDS 0

Operating regions:

cut-off: VGS < VTH

linear:VGS VTHVDS < VDsat

saturation:VGS VTHVDS VDsat

S D

VGS - VTH

0.8V

S D

S D“ “

IDS

VDS

VGS

linear saturation

When the gate voltage is high, the switch “closes” (connects). Good at pulling things “low”.

Page 40: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 40Comp 411

P-Channel Field-Effect Transistors (PFETs)

S

G

D

S

G

D

+--

+

VGS

VDS 0

Operating regions:

cut-off: VGS > VTH

linear:VGS VTHVDS > VDsat

saturation:VGS VTHVDS VDsat

S D

VGS - VTH

–0.8V

S D

S D“ “

-IDS

-VDS

-VGS

linearsaturation

When the gate voltage is low, the switch “closes” (connects). Good at pulling things “high”.

Page 41: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 41Comp 411

Finally… Using Transistors to Build Logic Gates!

VDD

VIN VOUT

pullup: make this connectionwhen VIN is near 0 so that VOUT = VDD

Logic Gate recipe:

Page 42: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 42Comp 411

Finally… Using Transistors to Build Logic Gates!

VDD

VIN VOUT

pullup: make this connectionwhen VIN is near 0 so that VOUT = VDD

Logic Gate recipe:

pulldown: make this connectionwhen VIN is near VDD so that VOUT = 0

Page 43: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 43Comp 411

Finally… Using Transistors to Build Logic Gates!

VDD

VIN VOUT

pullup: make this connectionwhen VIN is near 0 so that VOUT = VDD

Logic Gate recipe:

pulldown: make this connectionwhen VIN is near VDD so that VOUT = 0

We‟ll usePFETs here

Page 44: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 44Comp 411

Finally… Using Transistors to Build Logic Gates!

VDD

VIN VOUT

pullup: make this connectionwhen VIN is near 0 so that VOUT = VDD

Logic Gate recipe:

pulldown: make this connectionwhen VIN is near VDD so that VOUT = 0

We‟ll usePFETs here

and, NFETshere

Page 45: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 45Comp 411

CMOS Inverter

Vin Vout

Vin

Vout

Page 46: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 46Comp 411

CMOS Inverter

Vin Vout

Vin

Vout

“1” “0”

“0” “1”

Page 47: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 47Comp 411

CMOS Inverter

Vin Vout

Vin

Vout

“1” “0”

“0” “1”

Page 48: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 48Comp 411

CMOS Inverter

Vin Vout

Vin

Vout

only a narrow rangeof input voltages result in “invalid” output values. (this diagram is greatly exaggerated)

Valid “1”

Valid “0”

Invalid

“1” “0”

“0” “1”

Page 49: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 49Comp 411

CMOS Inverter

Vin Vout

Vin

Vout

A Yinverter

only a narrow rangeof input voltages result in “invalid” output values. (this diagram is greatly exaggerated)

Valid “1”

Valid “0”

Invalid

“1” “0”

“0” “1”

Page 50: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 50Comp 411

CMOS ComplementsWhat a niceVOH you have...

Thanks. It runsin the family...

conducts when A is high conducts when A is low

A A

Page 51: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 51Comp 411

CMOS ComplementsWhat a niceVOH you have...

Thanks. It runsin the family...

conducts when A is high conducts when A is low

conducts when A is highand B is high: A.B

A

BA B

conducts when A is lowor B is low: A+B = A.B

A A

Series N connections:

Parallel P connections:

Page 52: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 52Comp 411

CMOS ComplementsWhat a niceVOH you have...

Thanks. It runsin the family...

conducts when A is high conducts when A is low

conducts when A is highand B is high: A.B

A

BA B

conducts when A is lowor B is low: A+B = A.B

conducts when A is highor B is high: A+B

A

BA B

conducts when A is lowand B is low: A.B = A+B

A A

Series N connections:

Parallel N connections:

Parallel P connections:

Series P connections:

Page 53: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 53Comp 411

A Two Input Logic Gate

What function doesthis gate compute?

A B C

0 00 11 01 1

A

B

C

Page 54: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 54Comp 411

Here‟s Another…

What function doesthis gate compute?

A B C

0 00 11 01 1

A

B

C

Page 55: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 55Comp 411

CMOS Gates Like to Invert

OBSERVATION: CMOS gates tend to be inverting!

Precisely, one or more “0” inputs are necessary to generate a “1” output, and one or more “1” inputs are necessary to generate a “0” output. Why?

A

B

C

Page 56: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 56Comp 411

General CMOS Gate Recipe

Step 1. Figure out pulldown network that does what you want (i.e the set of conditions where the output is „0‟)

e.g., F = A*(B+C)

A

B C

Page 57: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 57Comp 411

General CMOS Gate Recipe

Step 1. Figure out pulldown network that does what you want (i.e the set of conditions where the output is „0‟)

e.g., F = A*(B+C)

A

B C

Step 2. Walk the hierarchy replacing nfets with pfets, series subnets with parallel subnets, and parallel subnets with series subnets

AB

C

Page 58: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 58Comp 411

General CMOS Gate Recipe

Step 1. Figure out pulldown network that does what you want (i.e the set of conditions where the output is „0‟)

e.g., F = A*(B+C)

A

B C

Step 2. Walk the hierarchy replacing nfets with pfets, series subnets with parallel subnets, and parallel subnets with series subnets

AB

C

Step 3. Combine pfet pullup network from Step 2 with nfet pulldownnetwork from Step 1 to form fully-complementary CMOS gate.

But isn‟t ithard to wireit all up?

AB

C

A

B C

Page 59: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 59Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Page 60: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 60Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

Page 61: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 61Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA

Page 62: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 62Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA B

C

Page 63: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 63Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA B

C

Step 2: The complementary pull-upnetwork

Page 64: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 64Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA B

C

Step 2: The complementary pull-upnetwork

VddA

Page 65: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 65Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA B

C

Step 2: The complementary pull-upnetwork

VddA

B C

Page 66: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 66Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA B

C

Step 2: The complementary pull-upnetwork

VddA

B C

Step 3: Combine and Verify

A B C F

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

Page 67: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 67Comp 411

One Last Exercise

Lets construct a gate to compute:

F = A+BC = NOT(OR(A,AND(B,C)))

Step 1: The pull-down network

FA B

C

Step 2: The complementary pull-upnetwork

VddA

B C

Step 3: Combine and Verify

A B C F

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

11100000

Page 68: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 68Comp 411

Now We‟re Ready to Design Stuff!

We need to start somewhere -- usually it‟s the functional specification

A

B YIf C is 1 thencopy B to Y,

otherwise copyA to YC

If you are like most engineers you’d rather see a table, or formula than parse a logic puzzle. The fact is, any combinational function can be expressed as a table.

These “truth tables” are a concise description of the combinational system’s function. Conversely, any computation performed by a combinational system can expressed as a truth table.

Argh… I’m tired of word games

Page 69: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 69Comp 411

Now We‟re Ready to Design Stuff!

We need to start somewhere -- usually it‟s the functional specification

A

B YIf C is 1 thencopy B to Y,

otherwise copyA to YC

If you are like most engineers you’d rather see a table, or formula than parse a logic puzzle. The fact is, any combinational function can be expressed as a table.

These “truth tables” are a concise description of the combinational system’s function. Conversely, any computation performed by a combinational system can expressed as a truth table.

Argh… I’m tired of word games

C B A Y

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Truth Table

Page 70: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 70Comp 411

Where Do We Start?

We have a bag of gates.

We want to build a computer.What do we do?Did I mention wehave gates?

We need… a systematic approach for designing logic

A

B

Page 71: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 71Comp 411

A Slight Diversion

Are we sure we have all the gates we need?

How many two-input gates are there?

Hum… all of these have 2-inputs (no surprise)

… 2 inputs have 4 possible values

How many possible patterns for 4 outputs are there? ___

AB Y

00 0

01 0

10 0

11 1

ANDAB Y

00 0

01 1

10 1

11 1

ORAB Y

00 1

01 1

10 1

11 0

NANDAB Y

00 1

01 0

10 0

11 0

NOR

Page 72: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 72Comp 411

A Slight Diversion

Are we sure we have all the gates we need?

How many two-input gates are there?

Hum… all of these have 2-inputs (no surprise)

… 2 inputs have 4 possible values

How many possible patterns for 4 outputs are there? ___

AB Y

00 0

01 0

10 0

11 1

ANDAB Y

00 0

01 1

10 1

11 1

ORAB Y

00 1

01 1

10 1

11 0

NANDAB Y

00 1

01 0

10 0

11 0

NOR

24

Page 73: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 73Comp 411

A Slight Diversion

Are we sure we have all the gates we need?

How many two-input gates are there?

Hum… all of these have 2-inputs (no surprise)

… 2 inputs have 4 possible values

How many possible patterns for 4 outputs are there? ___

AB Y

00 0

01 0

10 0

11 1

ANDAB Y

00 0

01 1

10 1

11 1

ORAB Y

00 1

01 1

10 1

11 0

NANDAB Y

00 1

01 0

10 0

11 0

NOR

24

Generalizing, there are 2 , N-input gates!2N

Page 74: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 74Comp 411

There Are Only So Many Gates

There are only 16 possible 2-input gates… some we know already, others are just silly

Do we need all of these gates?

I

N

P

U

T

AB

Z

E

R

O

A

N

D

A

>

B

A

B

>

A

B

X

O

R

O

R

N

O

R

X

N

O

R

N

O

T

„B‟

A

<=

B

N

O

T

„A‟

B

<=

A

N

A

N

D

O

N

E

00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Page 75: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 75Comp 411

There Are Only So Many Gates

There are only 16 possible 2-input gates… some we know already, others are just silly

Do we need all of these gates?

I

N

P

U

T

AB

Z

E

R

O

A

N

D

A

>

B

A

B

>

A

B

X

O

R

O

R

N

O

R

X

N

O

R

N

O

T

„B‟

A

<=

B

N

O

T

„A‟

B

<=

A

N

A

N

D

O

N

E

00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Nope. After all, we describe them all using AND, OR, and NOT.

Page 76: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 76Comp 411

There Are Only So Many Gates

There are only 16 possible 2-input gates… some we know already, others are just silly

Do we need all of these gates?

I

N

P

U

T

AB

Z

E

R

O

A

N

D

A

>

B

A

B

>

A

B

X

O

R

O

R

N

O

R

X

N

O

R

N

O

T

„B‟

A

<=

B

N

O

T

„A‟

B

<=

A

N

A

N

D

O

N

E

00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Nope. After all, we describe them all using AND, OR, and NOT.

How many of these gates can be implemented using a single CMOS gate?

Page 77: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 77Comp 411

There Are Only So Many Gates

There are only 16 possible 2-input gates… some we know already, others are just silly

Do we need all of these gates?

I

N

P

U

T

AB

Z

E

R

O

A

N

D

A

>

B

A

B

>

A

B

X

O

R

O

R

N

O

R

X

N

O

R

N

O

T

„B‟

A

<=

B

N

O

T

„A‟

B

<=

A

N

A

N

D

O

N

E

00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Nope. After all, we describe them all using AND, OR, and NOT.

How many of these gates can be implemented using a single CMOS gate?

Page 78: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 78Comp 411

There Are Only So Many Gates

There are only 16 possible 2-input gates… some we know already, others are just silly

Do we need all of these gates?

I

N

P

U

T

AB

Z

E

R

O

A

N

D

A

>

B

A

B

>

A

B

X

O

R

O

R

N

O

R

X

N

O

R

N

O

T

„B‟

A

<=

B

N

O

T

„A‟

B

<=

A

N

A

N

D

O

N

E

00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Nope. After all, we describe them all using AND, OR, and NOT.

How many of these gates can be implemented using a single CMOS gate?

Page 79: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 79Comp 411

There Are Only So Many Gates

There are only 16 possible 2-input gates… some we know already, others are just silly

Do we need all of these gates?

I

N

P

U

T

AB

Z

E

R

O

A

N

D

A

>

B

A

B

>

A

B

X

O

R

O

R

N

O

R

X

N

O

R

N

O

T

„B‟

A

<=

B

N

O

T

„A‟

B

<=

A

N

A

N

D

O

N

E

00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

01 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

10 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

11 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Nope. After all, we describe them all using AND, OR, and NOT.

How many of these gates can be implemented using a single CMOS gate?

Page 80: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 80Comp 411

We Can Make Most Gates Out of Others

How many different gates do we really need?

AB Y

00 0

01 1

10 0

11 0

B>A

A

By

AB Y

00 0

01 1

10 1

11 0

XOR

AB

Y

AB

Y

Page 81: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 81Comp 411

One Will Do!

NANDs and NORs are universal

Ah!, but what if we want more than 2-inputs

Page 82: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 82Comp 411

One Will Do!

NANDs and NORs are universal

Ah!, but what if we want more than 2-inputs

=

=

=

Page 83: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 83Comp 411

One Will Do!

NANDs and NORs are universal

Ah!, but what if we want more than 2-inputs

=

=

=

=

=

=

Page 84: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 84Comp 411

Stupid Gate Tricks

Suppose we have some 2-input XOR gates:

And we want an N-input XOR:

A1

A3 A4 AN

A2

A

BC

A0011

B0101

C0110

tpd = 1

tpd = O( ___ ) -- WORST CASE.

output = 1iff number of 1sinput is ODD(“ODD PARITY”)

Can we compute N-input XOR faster?

Page 85: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 85Comp 411

Stupid Gate Tricks

Suppose we have some 2-input XOR gates:

And we want an N-input XOR:

A1

A3 A4 AN

A2

A

BC

A0011

B0101

C0110

tpd = 1

tpd = O( ___ ) -- WORST CASE.

output = 1iff number of 1sinput is ODD(“ODD PARITY”)

Can we compute N-input XOR faster?

N

Page 86: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 86Comp 411

I Think That I Shall Never Seea Gate Lovely as a ...

A1

A2

A4

A3

AN

N-input TREE has O( ______ ) levels...

Signal propagation takes O( _______ ) gate delays.

Page 87: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 87Comp 411

I Think That I Shall Never Seea Gate Lovely as a ...

A1

A2

A4

A3

AN

N-input TREE has O( ______ ) levels...

Signal propagation takes O( _______ ) gate delays.

21

Page 88: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 88Comp 411

I Think That I Shall Never Seea Gate Lovely as a ...

A1

A2

A4

A3

AN

N-input TREE has O( ______ ) levels...

Signal propagation takes O( _______ ) gate delays.

2122

Page 89: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 89Comp 411

I Think That I Shall Never Seea Gate Lovely as a ...

A1

A2

A4

A3

AN

N-input TREE has O( ______ ) levels...

Signal propagation takes O( _______ ) gate delays.

21222

log2N

Page 90: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 90Comp 411

I Think That I Shall Never Seea Gate Lovely as a ...

A1

A2

A4

A3

AN

N-input TREE has O( ______ ) levels...

Signal propagation takes O( _______ ) gate delays.

log N

21222

log2N

Page 91: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 91Comp 411

I Think That I Shall Never Seea Gate Lovely as a ...

A1

A2

A4

A3

AN

N-input TREE has O( ______ ) levels...

Signal propagation takes O( _______ ) gate delays.

log N

log N

21222

log2N

Page 92: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 92Comp 411

Here‟s a Design Approach

1) Write out our functional spec as a truth table

2) Write down a Boolean expression for every „1‟ in the output

3) Wire up the gates, call it a day, and go home!

This approach will always give us logic expressions in a particular form:

SUM-OF-PRODUCTS

C B A Y

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Truth Table

CBAACBBACABCY

Page 93: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 93Comp 411

Here‟s a Design Approach

1) Write out our functional spec as a truth table

2) Write down a Boolean expression for every „1‟ in the output

3) Wire up the gates, call it a day, and go home!

This approach will always give us logic expressions in a particular form:

SUM-OF-PRODUCTS

C B A Y

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Truth Table

-it‟s systematic!-it works!-it‟s easy!-we get to go home!

CBAACBBACABCY

Page 94: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 94Comp 411

Straightforward Synthesis

We can implement

SUM-OF-PRODUCTS

with just three levels of

logic.

INVERTERS/AND/OR

ABC

ABC

ABC

ABC

Y

Page 95: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 95Comp 411

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

“Pushing Bubbles”

Page 96: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 96Comp 411

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

AB=A+B “Pushing Bubbles”

Page 97: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 97Comp 411

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

AB=A+B “Pushing Bubbles”

Page 98: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 98Comp 411

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

AB=A+B “Pushing Bubbles”

Page 99: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 99Comp 411

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

C

A

B

Y

AB=A+B “Pushing Bubbles”

Page 100: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 100Comp 411

AB=A+B

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

C

A

B

Y

AB=A+B “Pushing Bubbles”

Page 101: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 101Comp 411

AB=A+B

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

C

A

B

Y

AB=A+B “Pushing Bubbles”

Page 102: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 102Comp 411

AB=A+B

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

C

A

B

Y

yxyx

C

A

B

Y

AB=A+B “Pushing Bubbles”

Page 103: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 103Comp 411

AB=A+B

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

C

A

B

Y

yxyx

C

A

B

Y

C

A

B

Y

AB=A+B “Pushing Bubbles”

Page 104: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 104Comp 411

AB=A+B

Useful Gate Structures

NAND-NAND

NOR-NOR

C

A

B

Y

C

A

BY

C

A

B

Y

zyxxyz

C

A

B

Y

yxyx

C

A

B

Y

C

A

B

Y

AB=A+B “Pushing Bubbles”

DeMorgan‟s Laws

Page 105: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 105Comp 411

An Interesting 3-Input Gate

Based on C, select the A or B input to be copied to the output Y.

C B A Y

0 0 0 0

0 0 1 1

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 1

Truth Table

A

BY

C

If C is 1 thencopy B to Y,

otherwise copyA to Y

2-input Multiplexer

B

C

A

Y

A

B

C

0

1

schematic

Gatesymbol

Page 106: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 106Comp 411

MUX Shortcuts

0101S

0101S

0101S

I0I1

I2I3

Y

S0 S1

A 4-input Mux(implemented as

a tree)

Page 107: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 107Comp 411

MUX Shortcuts

0101S

0101S

0101S

I0I1

I2I3

Y

S0 S1

A 4-input Mux(implemented as

a tree)

ABCDS

0123

Y

Page 108: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 108Comp 411

MUX Shortcuts

0101S

0101S

0101S

I0I1

I2I3

Y

S0 S1

A 4-input Mux(implemented as

a tree)

0101S

0101S

A2

B2

A3

B3

Y0

S

0101S

0101S

A0

B0

A1

B1Y1

Y2

Y3

A 4-bit wide Mux

ABCDS

0123

Y

Page 109: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 109Comp 411

MUX Shortcuts

0101S

0101S

0101S

I0I1

I2I3

Y

S0 S1

A 4-input Mux(implemented as

a tree)

0101S

0101S

A2

B2

A3

B3

Y0

S

0101S

0101S

A0

B0

A1

B1Y1

Y2

Y3

A 4-bit wide Mux

ABCDS

0123

YA0-3

B0-3

S

Y0-3

Page 110: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 110Comp 411

Mux Logic Synthesis

Consider implementation of some arbitrary Boolean function, F(A,B)

... using a MULTIPLEXERas the only circuit element:

A B Cin Cout

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

Full-AdderCarry Out Logic

01234567

A,B,Cin

Cout

Page 111: Transistors and Logic - Computer Sciencegb/Comp411Fall2011/media/L08-TransistorsLogic.pdf · Comp 411 L08 –Transistors and Logic 1 Transistors and Logic A B 1) The digital contract

L08 – Transistors and Logic 111Comp 411

Mux Logic Synthesis

Consider implementation of some arbitrary Boolean function, F(A,B)

... using a MULTIPLEXERas the only circuit element:

A B Cin Cout

0 0 0 0

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

Full-AdderCarry Out Logic

01234567

A,B,Cin

Cout

00010111