CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates”...

98
CSC258 Week 1 1

Transcript of CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates”...

Page 1: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

CSC258 Week 1

1

Page 2: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Instructors

Larry Zhang (coordinator)

Office: DH-3070

Email: [email protected]

Andrew Petersen

Office: DH-3096

Email: [email protected]

2

Page 3: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Today’s outline

§ WhyCSC258§ What is in CSC258§ How to do well in CSC258

§ Start learning

3

Page 4: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Why takeCSC258?

4

Page 5: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Learning the Magic

5

magic magic

CSC258 CSC369

magic

CSC358

Page 6: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

More specifically…

§ How do we express 1’s and 0’s using a piece of silicon?

§ How does the computer do everything with just 1’s and 0’s?

§ What is stored in that “fortnite.exe” file, what exactly happens when I double-click on it?

§ How does the CPU run an if-statement, or for loop, or recursion?

CSC258 has all the answers!

6

Page 7: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

After learning CSC258…

§ You’ll know everything about how a computer is physically built, and you can build one if you want.

§ With your hardware knowledge, you will be able to engineer the performance of your software like never before.

7

People who are really serious about software should make their own hardware.

-- Alan Kay

Page 8: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

What’s inCSC258?

8

Page 9: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

The architecture of a computer hardware, level by level, bottom-up

Assembly Language

Processors

Finite State Machines

Arithmetic Logic Units

Devices Flip-flops

Circuits

Gates

Transistors

compute stuffremember stuff

9

Page 10: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

We learn the whole real deal

§ Computing from the ground up: ú from atom level to assembly level

§ Above the assembly level is the Operating System, which virtualizes the hardware

§ Almost everything you learn from CS courses are virtualizations/illusions, except for CSC258

10

Page 11: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

We learn how to handle abstractions

§ At each level, we see how the previous layer is abstracted

§ In the end, we want to know how the underlying hardware affects us as programmers … so we can ignore the detail.

11

Page 12: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

How to do well in CSC258

12

Page 13: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

First of all …

Be interested

13

Page 14: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Course website

https://mcs.utm.utoronto.ca/~258/

All course materials are here.

14

Page 15: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Marking scheme

15

Page 16: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Labs (starting from Week 2)

§ Hands-on exercises in which you will build real pieces of hardware.

§ Prelabs are done individually, in-lab work is done in pairs.

§ ONLY go to the lab section that you are registered to on ACORN. If you want to switch lab section, find someone who is willing to switch and get permission from Larry/Andrew.

§ On the discussion board, use “Search Teammates” for finding a partner.

16

Page 17: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Prelab Reports

§ For most of the labs, you will be required to submit a prelab report (a PDF file) to MarkUs before the labs start.

§ Must be completed individually

§ Submission deadline is typically Tuesday 6pm

§ To get the mark for the prelab report

ú do your work and submit something meaningful

ú don’t plagiarize

ú not submitting anything would be much better than plagiarizing

17

Page 18: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

18

Page 19: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Lab software

§ We will use Logisim-Evolution§ The reference of the software has been posted on the course

website.§ Task for this week: download the software, read the reference,

and familiarize yourself with it.§ Note: I must be Logisim-Evolution downloaded at the link in

the reference. Do NOT use the original Logisim or its other variations.

19

Page 20: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Weekly Quizzes

§ We will use Quercus for online quizzes

§ Starting in Week 2

§ Useful practices for tests and exams.

§ Deadline for quizzes is every Sunday 10:00pm.

§ You’ll be told whether your answer is correct immediately, and you can try up to three times. We will record your highest score.

20

Page 21: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

New: Assembly Programming Project

§ This year, we’ll ask you to write a larger project in assembly than in prior years

§ The project will be due on the last day of class

§ You will be asked to write assembly code to build a gameú Memory (storing game state)ú Syscalls (to access input/output)

Page 22: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Tests

§ Midterm§ outside class!§ Mon, Feb 24, 7:10pm~8:40pm (90 minutes)§ Let Larry know by Jan 31 if you have a conflict.

§ Final exam§ Some time in April§ Must get >= 40%

22

Page 23: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Discussion board

https://mcsapps.utm.utoronto.ca/forum/c/csc258-spring-2020/11

§ All course announcements will be posted here.

§ Daily reading is required.

23

Page 24: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Office hours

Larry: Tuesday 5:10-6:10, Thursday 11:10-12:40Andrew: Monday 10:00-12:00, Wednesday 10:00-12:00

24

Office hours are helpful!

Page 25: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Student Feedback

§ Give us frequent (e.g., every week) feedbacks on how things are going. It is very useful for improving your learning experience in a timely manner.

§ Anonymous feedback form:ú link on the course website

§ Or even better, just drop by my office and have a chat.

2-25

Page 26: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Textbook: DDCA

Digital Design and Computer Architecture, 2nd edition, 2012by David Harris, Sarah Harris (1st edition also fine)

Available online at UofTlibrary (link in course info sheet)

26

Page 27: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A typical week of CSC258

§ Monday/Tuesday/Thursday: go the lectures.

§ By Tuesday 6pm: submit prelab report.

§ Tuesday/Wednesday: labs.

§ Thursday: Quiz released on Quercus. Start studying for it.

§ Thursday: next week’s lab handout released, start working on the prelab.

§ Friday/Saturday: keep studying…

§ Sunday by 10pm: complete the quiz.

27

Page 28: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

It will be a lot of work, and a lot of fun!

28

Page 29: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

29

Page 30: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

§ In-class pop quizzes. To participate, you’ll need:ú be in the lectureú have access to a browser (on a

phone, tablet or a laptop), or the Kahoot app

§ has nothing (directly) to do with your course grade

2-30

Page 31: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Let the learning begin

31

Page 32: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Basic Logic Gates

32

Page 33: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

You already know something…

33

Page 34: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Logic from math course

§ Create an expression that is true iff the variables A and B are true, or C and D are true.

G = (A & B) | (C & D)

34

Page 35: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

G = (A & B) | (C & D)

AB A&B

AND Gate

AB A|B

OR GateAB

CD

G

You just designed your first circuit in CSC258!35

Page 36: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Gates = Boolean logic

§ If we know the logical expression, we already know how to put logic gates together to form a circuit.

§ Just need to know which logic operations are represented by which gate!

Let’s meet all the gates.

36

Page 37: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A B Y

0 0 00 1 01 0 01 1 1

AB

Y

AND Gates

Truth table

37

Page 38: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A B Y

0 0 00 1 11 0 11 1 1

OR Gates

AB

Y

38

Page 39: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A Y

0 11 0

NOT Gates

A Y

39

Page 40: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A B Y

0 0 00 1 11 0 11 1 0

XOR Gates

AB

Y

40

Page 41: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Bill Gates

41

Page 42: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A B Y

0 0 10 1 11 0 11 1 0

AB

Y

NAND Gates

42

Page 43: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A B Y

0 0 10 1 01 0 01 1 0

AB

Y

NOR Gates

43

Page 44: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A Y

0 01 1

A Y

Buffer

This is not as silly as you might think now, as we’ll see later…

44

Page 45: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

AB

YAND Gate

This is just a symbol...What does it really look like, inside?How does it work, physically?

Y

+-

BA

R

Ground: low voltage (0V)

Power: high voltage (5V)

Resistor

What are these?

45

Page 46: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Y

+- R

BASwitches

When and only when both A are B are switched ON, Y has high voltage.

46

Page 47: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Y

+- R

BA Gates

• Gate is like a switch, but controlled by the voltage of the input signal, instead of by a finger.

• Gate A is switched ON when signal A is of high voltage.• When and only when both A and B have high voltage,

Y has high voltage.• High voltage is 1 (True), low voltage is 0 (False).• Y is True iff both A and B are True (Y = A & B).

47

Page 48: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

A Gate is switched ON when signal A is of

high voltage …

Why?

How? What does the inside of a gate look like?

Answer: There are transistors.48

Page 49: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Transistors

49

Page 50: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

One of the greatest inventions of the 20th century

§ Invented by William Shockley, John Bardeen and Walter Brattain in 1947, replacing previous vacuum-tube technology.ú Nobel Prize for Physics in

1956.

Building block for the hardware of all your computers and electronic devices.

50

Page 51: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

What do transistors do?§ Transistors connect Point A to Point B, based on

the value at Point C.ú If the value at Point C is high, A and B are connected.

ú And if the value at Point C is low, A and B are not.

ú Need to know a little about electricity now….

A B

C = 1

A B

C = 0

A B

A B

51

Page 52: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

52

Page 53: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Outline of the story

• Electricity, basic concepts

• Insulators, conductors, in between …, Semiconductors

• Impure semiconductors, p-type / n-type

• Put p-type and n-type together -- pn-junction

• Apply voltage to a pn-junction – principle of transistors

• A real-world manufacturing of transistor -- MOSFET

53

Page 54: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Electricity Basics

54

Page 55: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Everything is made out of atoms …

• Protons are big (hardly move) and positively charged.• Electrons are small

(easily move) and negatively changed.• Neutrons are big and

of course, neutral.• Overall, an atom is

neutral.55

Page 56: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

What is Electricity?

§ Electricity is the flow of charged particles (usually electrons) through a material.

56

Page 57: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

How do electrons flow?

They flow …

57

Page 58: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

How do electrons flow?

§ Electrons want to flow from regions of high electricalpotential (many electrons) to regions of low electrical potential (fewer electrons).ú Like water flows from high to low.

§ This potential is referred to as voltage (V).§ The rate of this flow is called the current (I).§ Resistance (I = V / R) is like how narrow the water pipe is.

58

Page 59: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Note

The direction of the current is opposite to the direction of the electron movement, because electrons are negatively charged.

59

Page 60: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

More on Resistance§ Electrical resistance indicates how well a

material allows electricity to flow through it:ú High resistance (aka insulators) don’t conduct

electricity at all.ú Low resistance (aka conductors) conduct

electricity well, and are generally used for wires.

§ Semiconductors are somewhere in between conductors and insulators, which makes it interesting…

60

Page 61: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Outline of the story

• Electricity, basic concepts• Insulators, conductors, in between …,

Semiconductors• Impure semiconductors, p-type / n-type• Put p-type and n-type together -- pn-

junction• Apply voltage to a pn-junction – principle

of transistors• A real-world manufacturing of transistor --

MOSFET61

Page 62: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Semiconductors

62

Page 63: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Here comes the chemistry

63

Page 64: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

silicon

Germanium

64

Page 65: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Conductivity of Semiconductors

§ Semiconductor materials (e.g., silicon and germanium) straddle the boundary between conductors and insulators, behaving like one or the other, depending on factors like temperature and impurities in the material.

65

Page 66: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Impurity

66

Page 67: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Pure semiconductor is pretty stable

§ Each atom has 4 valence electrons, forming bondswith other atoms, and the structure is pretty stable.

§ At room temperature, very close to insulator.

67

Page 68: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Encourage semiconductor’s conductivity

N-type:Add some atoms with 5valence electrons, such as Phosphorus.

An extra electron!P-type:Add some atoms with 3valence electrons, such as Boron. A missing electron, a.k.a., a

“hole”, like a positive electron!68

Page 69: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Encourage semiconductor’s conductivity

The extra electrons and the holes are charge carriers, which can move freely through the materials.

Thus the conductivity is encouraged.

This process of adding stuff is called doping, (n or p type).

69

Page 70: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Free electrons move like

Free holes move like

70

Page 71: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Outline of the story

• Electricity, basic concepts• Insulators, conductors, in between …,

Semiconductors• Impure semiconductors, p-type / n-type• Put p-type and n-type together -- pn-

junction• Apply voltage to a pn-junction – principle

of transistors• A real-world manufacturing of transistor --

MOSFET71

Page 72: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

PN-junctions

72

Page 73: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Bringing p and n together

§ What happens if you brought some p-type material into contact with some n-type material?

§ The electrons at the surface of the n-type material are drawn to the holes in the p-type.

Si Si

Si P

Si Si

Si Si

Si Si

Si Si

Si Si

B Si

Si

Si Si

Si

Si Si

Si

Si Si

Si Si

Si

Si Si

Si Si

Si

Si Si

Si

Si

Si Si

Si

P P P

P

B

B

B

B

-

----

--

--

-p-type

n-type

73

Page 74: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

p-n Junctions§ When left alone, the

electrons from the nsection of the junctionwill fill the holes of the p section, cancelling each other and create a section with no free carriers called the depletion layer.

§ Once this depletion layer is wide enough, the doping atoms that remain will create an electric field in that region.

74

Page 75: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Si Si

Si P

Si Si

Si Si

Si Si

Si Si

Si Si

B Si

Si

Si Si

Si

Si Si

Si

Si Si

Si Si

Si

Si Si

Si Si

Si

Si Si

Si

Si

Si Si

Si

P P P

P

B

B

B

B

-

----

--

--

-

p-type

n-typeBecause lost electron

Because gained electron

Electrons’ initial movement (attracted by holes)

75

Page 76: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

p-type

n-typeElectrons’ initial movement

(attracted by holes)

Electric field

Electron’s movement drawn by the electric field

“Diffusion”

“Drift”

Diffusion increases the width of depletion layer, and drift draws it back. An equilibrium is reached, when the depletion layer is of a certain width.

76

Page 77: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Analogy: Spring with weight

“Diffusion” “Drift”

Attracted by gravity (hole)

Drawn by spring force field

An equilibrium is reached when the spring is stretched by a certain length.

77

Page 78: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Summary of pn-junction

When we put p and n together, they will form a depletion layer with electric field in it.

The depletion layer grows up to a certain width, until equilibrium is reached.

NP

78

Page 79: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Outline of the story

• Electricity, basic concepts• Insulators, conductors, in between …,

Semiconductors• Impure semiconductors, p-type / n-type• Put p-type and n-type together -- pn-

junction• Apply voltage to a pn-junction – principle

of transistors• A real-world manufacturing of transistor --

MOSFET79

Page 80: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Apply voltage to a PN-junction

It could be applied in two possible directions

• Positive voltage to the P side

• Positive voltage to the N side

80

Page 81: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Forward Bias (Positive voltage to P)

P NNegative charges sucked

out of depletion layerPositive charges sucked

out of depletion layer

Depletion layer becomes narrower.81

Page 82: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Reverse Bias (Positive voltage to N)

P NNegative charges injected

into depletion layerPositive charges injected

into depletion layer

Depletion layer becomes wider.82

Page 83: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Apply forward bias• Depletion layer narrower• Easier to travel through• Better conductivity• Like switch connected

Apply reverse bias• Depletion layer wider• Harder to travel through• Worse conductivity• Like switch disconnected

That’s how transistors work!83

Page 84: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Outline of the story

• Electricity, basic concepts• Insulators, conductors, in between …,

Semiconductors• Impure semiconductors, p-type / n-type• Put p-type and n-type together -- pn-

junction• Apply voltage to a pn-junction – principle

of transistors• A real-world manufacturing of transistor --

MOSFET84

Page 85: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Creating transistors§ Transistors use the characteristics of p-n

junctions to create more interesting behaviour.

§ Three main types:ú Bipolar Junction Transistors (BJTs)ú Metal Oxide Semiconductor Field Effect Transistor

(MOSFET)ú Junction Field Effect Transistor (JFET)

§ The last two are part of the same family, but we’ll only look at the MOSFET for now.

85

Page 86: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Metal Oxide Semiconductor Field Effect Transistor

86

Page 87: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Source Drain

Gate

87

Page 88: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Metal Oxide

N-type P-type

GateSource Drain

InsulatorConductor, can apply electric charge to it

Semiconductors, doped

88

Page 89: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Put a MOSFET into a circuitGate

Source Drain

+ -- +or

Power: high voltage can be applied to

source or drain

89

Page 90: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Put it into a circuitGate

Source Drain

+ -- +

Metal Oxide N-type P-type

Two PN-junctions back-to-back, i.e, N-P-N. So, either source or drain has high voltage, one of the PN-junction must be reverse biased (circuit disconnected).

90

Page 91: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

But things change if we apply high voltage to Gate

Gate

Metal Oxide N-type P-type

Attract negative charges from p-substrate

Create n-type channel between source and drain, CIRCUIT CONNECTED

The wider the channel, the higher the current91

Page 92: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Two types of MOSFET

• nMOS (what we just describe)• N-P-N• Gate high, connected• Gate low, disconnected

• pMOS (opposite to nMOS)• P-N-P• Gate low, connected• Gate high, disconnected

92

Page 93: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Outline of the story• Electricity, basic concepts• Insulators, conductors, in between …,

Semiconductors• Impure semiconductors, p-type / n-type• Put p-type and n-type together -- pn-

junction• Apply voltage to a pn-junction – principle

of transistors• A real-world manufacturing of transistor –

MOSFET• Use transistors build Logic Gates

93

Page 94: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Transistors to Logic Gates

94

Page 95: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Create gates using a combination of transistors

A Y

A Y

NOT Gate

Physical data:ú “High” input = 5V

ú “Low” input = 0V

ú Switching time: ~20 picoseconds

ú Switching interval ~10 ns

95

Page 96: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Transistors into gates

Y

A

B

A

B

A

B

A

B

Vcc Vcc

A

B

Y

Vcc

A B

A B

A

Y

Vcc Vcc

B

AND ORXOR

96

Page 97: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

NAND is the most awesome logic gate• It’s cheaper to build• All other logic functions (AND,

OR, …) can be implemented using only NAND, i.e., it is functionally complete.

Challenge for home: implement AND, OR, NOT, XOR using only NAND.

97

Page 98: CSC258 Week 1258/files/larry/lec01.pdf · § On the discussion board, use “Search Teammates” for finding a partner. 16. Prelab Reports ... § The project will be due on the last

Next week:• Circuit creation

98