Computer Organization and Design Transistors & Logic - I

24
Computer Organization and Computer Organization and Design Design Transistors & Logic - I Transistors & Logic - I Montek Singh Montek Singh Wed, Oct 10, 2012 Wed, Oct 10, 2012 Lecture 10 Lecture 10 1

description

Computer Organization and Design Transistors & Logic - I. Montek Singh Wed, Oct 10, 2012 Lecture 10. Today ’ s Topics. Why go digital? E ncoding bits using voltages D igital design primitives transistors and gates. Where are we in this course?. Things we know so far: - PowerPoint PPT Presentation

Transcript of Computer Organization and Design Transistors & Logic - I

Page 1: Computer Organization and Design Transistors & Logic - I

Computer Organization and Computer Organization and DesignDesign

Transistors & Logic - ITransistors & Logic - I

Montek SinghMontek Singh

Wed, Oct 10, 2012Wed, Oct 10, 2012

Lecture 10Lecture 10

1

Page 2: Computer Organization and Design Transistors & Logic - I

Today’s TopicsToday’s Topics Why go digital?Why go digital? Encoding bits using voltagesEncoding bits using voltages Digital design primitivesDigital design primitives

transistors and gatestransistors and gates

2

Page 3: Computer Organization and Design Transistors & Logic - I

Where are we in this course?Where are we in this course? Things we know so far:Things we know so far:

Computers process informationComputers process information Information is measured in bitsInformation is measured in bits Data can be represented as groups of bitsData can be represented as groups of bits Computer instructions are encoded as bitsComputer instructions are encoded as bits We, humans, donWe, humans, don’’t want to deal with bits…t want to deal with bits…

so we invent Assembly Language and Compilersso we invent Assembly Language and Compilers

But, what PROCESSES all these bits?But, what PROCESSES all these bits?

3

Page 4: Computer Organization and Design Transistors & Logic - I

A Substrate for ComputationA Substrate for Computation We can build devices for processing and We can build devices for processing and

representing bits using almost any physical representing bits using almost any physical phenomenonphenomenon currentscurrents voltagesvoltages tiny magnets (nanomagnets)tiny magnets (nanomagnets) quantum phenomena (quantum computing)quantum phenomena (quantum computing) sequences of DNA (DNA computing)sequences of DNA (DNA computing) ……

any physical phenomenon with at least 2 distinct states, any physical phenomenon with at least 2 distinct states, which can be measured and controlledwhich can be measured and controlled

4

Page 5: Computer Organization and Design Transistors & Logic - I

Using Electromagnetic Using Electromagnetic PhenomenaPhenomena Things like:Things like:

voltagesvoltages , phase, currents, frequency, phase, currents, frequency

Using voltages to encode informationUsing voltages to encode information Voltage pros:Voltage pros:

easy generation, detectioneasy generation, detectionvoltage changes can be very fastvoltage changes can be very fast lots of engineering knowledge alreadylots of engineering knowledge already

Voltage cons:Voltage cons:easily affected by environmenteasily affected by environmentneed wires everywhere to transmitneed wires everywhere to transmit

5

Page 6: Computer Organization and Design Transistors & Logic - I

Encoding using Voltage (example)Encoding using Voltage (example) Representation of each point (x, y) on a B&W Representation of each point (x, y) on a B&W

pic:pic: 0 volts: 0 volts: BLACKBLACK 1 volt:1 volt: WHITEWHITE 0.37 volts: 37% Gray, etc.0.37 volts: 37% Gray, etc.

Representation of a picture:Representation of a picture: scan points in some prescribedscan points in some prescribed

raster order…raster order… generate voltage waveformgenerate voltage waveform

How much informationat each point?

6

Page 7: Computer Organization and Design Transistors & Logic - I

Information Processing = Information Processing = ComputationComputation First, letFirst, let’’s introduce some processing blocks:s introduce some processing blocks:

(say, using a fancy (say, using a fancy photocopier/scanner/printer)photocopier/scanner/printer)

vCopyv

INVv 1-v

7

Page 8: Computer Organization and Design Transistors & Logic - I

LetLet’’s build a system!s build a system!

?

Copy INV

Copy INV

Copy INV

Copy INV

output

(In Theory) (Reality)

input

8

Page 9: Computer Organization and Design Transistors & Logic - I

Why Did Our System Fail?Why Did Our System Fail? Why doesnWhy doesn’’t reality match theory?t reality match theory?

COPY Operator doesnCOPY Operator doesn’’t work right?t work right? INVERSION Operator doesnINVERSION Operator doesn’’t work right?t work right? Theory is imperfect?Theory is imperfect? Reality is imperfect?Reality is imperfect? Our system architecture stinks?Our system architecture stinks?

ANSWER: all of the above! ANSWER: all of the above! Noise and inaccuracy are inevitableNoise and inaccuracy are inevitable We We cannotcannot reliably reproduce reliably reproduce infiniteinfinite information in information in

the presence of noisethe presence of noiseconsequence of Shannon’s theoremconsequence of Shannon’s theorem

Must design our system to tolerate some amount of Must design our system to tolerate some amount of error if it is to process information reliably!error if it is to process information reliably! 9

Page 10: Computer Organization and Design Transistors & Logic - I

The Key to System DesignThe Key to System Design A SYSTEM is a structure that is guaranteed to A SYSTEM is a structure that is guaranteed to

exhibit a specified behavior, assuming all of its exhibit a specified behavior, assuming all of its components obey their specified behaviors.components obey their specified behaviors.

How is this achieved? CONTRACTS!How is this achieved? CONTRACTS! Every system component will have clear obligations Every system component will have clear obligations

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

Much like object-oriented programming!Much like object-oriented programming!10

Page 11: Computer Organization and Design Transistors & Logic - I

Let’s go digital!Let’s go digital! Why DIGITAL?Why DIGITAL?

… … because it keeps the contracts SIMPLE!because it keeps the contracts SIMPLE!

The price we pay for this robustness?The price we pay for this robustness? All the information that we transfer between All the information that we transfer between

components is only 1 crummy bit!components is only 1 crummy bit! But, in exchange, we get a guarantee of a reliable But, in exchange, we get a guarantee of a reliable

system. system.

0 or 1

11

Page 12: Computer Organization and Design Transistors & Logic - I

The Digital AbstractionThe Digital Abstraction

Real World

“Ideal”Abstract World

Volts orElectrons or

Ergs or Gallons

Bits

0/1

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

Noise

ManufacturingVariations

12

Page 13: Computer Organization and Design Transistors & Logic - I

Types of Digital ComponentsTypes of Digital Components Two categories of componentsTwo categories of components

those whose output only depends on their current those whose output only depends on their current inputsinputscalled COMBINATIONALcalled COMBINATIONAL they are “memory-less”, don’t remember the pastthey are “memory-less”, don’t remember the past

those who output depends also on their past statethose who output depends also on their past statecalled SEQUENTIALcalled SEQUENTIAL they are “state-holding”, remember their pastthey are “state-holding”, remember their pastkey to building memorieskey to building memories

13

Page 14: Computer Organization and Design Transistors & Logic - I

TerminologyTerminology SystemSystem

a reasonably large assembly of componentsa reasonably large assembly of components division of a system into components is typically division of a system into components is typically

arbitrary but almost always hierarchicalarbitrary but almost always hierarchical

Component/ElementComponent/Element an individual part of a bigger systeman individual part of a bigger system clearly-defined function and interfaceclearly-defined function and interface implement it and put a black-box around itimplement it and put a black-box around it larger components created using smaller componentslarger components created using smaller components

CircuitCircuit a small (often leaf-level) component consisting of a a small (often leaf-level) component consisting of a

network of gatesnetwork of gates

14

Page 15: Computer Organization and Design Transistors & Logic - I

Combinational ComponentsCombinational Components A circuit is combinational if-and-only-if it has:A circuit is combinational if-and-only-if it has:

one or more digital one or more digital inputsinputs one or more digital one or more digital outputsoutputs a a functional specificationfunctional specification that details the value of that details the value of

each output for every possible combination of valid each output for every possible combination of valid input valuesinput valuesoutput depends only on the latest inputsoutput depends only on the latest inputs

a a timing specificationtiming specification consisting (at minimum) of an consisting (at minimum) of an upper bound upper bound ttpdpd on the time this circuit will take to on the time this circuit will take to produce the output value once stable valid input produce the output value once stable valid input values are appliedvalues are applied 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

15

Page 16: Computer Organization and Design Transistors & Logic - I

A Combinational Digital SystemA Combinational Digital System Theorem: A system of interconnected Theorem: A system of interconnected

elements is combinational if-and-only-if:elements is combinational if-and-only-if: each primitive circuit element is combinationaleach primitive circuit element is combinational every input is connected to exactly one output or every input is connected to exactly one output or

directly to a source of 0directly to a source of 0’’s or 1s or 1’’ss the circuit contains no directed cyclesthe circuit contains no directed cycles

no feedback (yet!)no feedback (yet!)

Proof: By inductionProof: By induction Start with the rightmost level of elementsStart with the rightmost level of elements

their output only depends on their inputs, which in turn are their output only depends on their inputs, which in turn are outputs of the level of element just to their leftoutputs of the level of element just to their left

and so on… until you arrive at the leftmost inputsand so on… until you arrive at the leftmost inputs

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

16

Page 17: Computer Organization and Design Transistors & Logic - I

Noise MarginsNoise Margins Key idea: Keep Key idea: Keep ““00””s distinct from the s distinct from the ““11””ss

say, say, ““00”” is represented by min voltage (e.g., 0 volts) is represented by min voltage (e.g., 0 volts) … … ““11”” is represented by high voltage (e.g., 1.8 volts) is represented by high voltage (e.g., 1.8 volts) use the same voltage representation throughout the use the same voltage representation throughout the

entire system!entire system!

For reliability, outlaw For reliability, outlaw ““close callsclose calls”” forbid a range of voltages between forbid a range of voltages between ““00”” and and ““11””

voltsForbidden Zone

Valid“0”

Valid“1”

Invalid

CONSEQUENCE: Notion of “VALID” and “INVALID” logic levels

Min Voltage Max Voltage

17

Page 18: Computer Organization and Design Transistors & Logic - I

AND

Digital Processing ElementsDigital Processing Elements Some digital processing elements occur so Some digital processing elements occur so

frequently that we give them special names frequently that we give them special names and symbolsand 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

18

Page 19: Computer Organization and Design Transistors & Logic - I

AND

Digital Processing ElementsDigital Processing Elements Some digital processing elements occur so Some digital processing elements occur so

frequently that we give them special names frequently that we give them special names and symbolsand symbols

A Y

A

BY OR

A

BY

A Y

A

BYXOR

buffer inverter

19

Page 20: Computer Organization and Design Transistors & Logic - I

From What Do We Make Digital From What Do We Make Digital Devices?Devices? Recall our common Recall our common

thread from Lecture thread from Lecture 2…2…A controllable switch A controllable switch

is a common link of is a common link of all computing all computing technologiestechnologies

How do you control How do you control voltages with a voltages with a switch?switch?By creating and By creating and

opening paths opening paths between higher and between higher and lower potentials lower potentials (voltages) (voltages)

Load

This symbol indicates a “low” or ground potential or 0V.

This symbol indicates a “high” potential, or the voltage of the power supply (e.g., 2V, 5V etc.)

20

Page 21: Computer Organization and Design Transistors & Logic - I

Most common technology todayMost common technology today … … is called CMOSis called CMOS

everything built using everything built using transistorstransistors a transistor is just a switcha transistor is just a switch

2 types of transistors2 types of transistors n-typen-type

called “NFET”, or “nMOS” or “n channel transistor” or “n called “NFET”, or “nMOS” or “n channel transistor” or “n transistor”transistor”

switch is on (i.e., conducts) when its control input is ‘1’switch is on (i.e., conducts) when its control input is ‘1’ p-typep-type

called “PFET”, or “pMOS”, or “p channel transistor” or “p called “PFET”, or “pMOS”, or “p channel transistor” or “p transistor”transistor”

switch is on (i.e., conducts) when its control input is ‘0’switch is on (i.e., conducts) when its control input is ‘0’ need both types to build useful gatesneed both types to build useful gates

21

Page 22: Computer Organization and Design Transistors & Logic - I

N-Channel Field-Effect Transistors N-Channel Field-Effect Transistors (NFETs)(NFETs)

D

G

S

D

G

S

+

+

- -VGS

VDS 0

Operating regions:

cut-off: VGS < VTH

linear: VGS VTH

VDS < VDsat

saturation: VGS VTH

VDS VDsat

S D

VGS - VTH

0.5V

S D

S D“ “

IDS

VDS

VGS

linear saturation

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

22

Page 23: Computer Organization and Design Transistors & Logic - I

P-Channel Field-Effect Transistors P-Channel Field-Effect Transistors (PFETs)(PFETs)

S

G

D

S

G

D

+--

+

VGS

VDS 0

Operating regions:

cut-off: VGS > VTH

linear: VGS VTH

VDS > VDsat

saturation: VGS VTH

VDS VDsat

S D

VGS - VTH

–0.5V

S D

S D“ “

-IDS

-VDS

-VGS

linearsaturation

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

23

Page 24: Computer Organization and Design Transistors & Logic - I

Next timeNext time Build gates using transistorsBuild gates using transistors Build larger circuits using gatesBuild larger circuits using gates

24