lecture 1 tuesday, january 15, 2002 welcome to ece 291! spring 2002

39
Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Welcome to ECE 291! Spring 2002 Spring 2002

Upload: frank-robertson

Post on 18-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Lecture 1

Tuesday, January 15, 2002

Welcome to ECE 291!Welcome to ECE 291!Spring 2002Spring 2002

Page 2: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

People at a Glance:People at a Glance:

• Cource directorCource director: Prof. C. Polychronopoulos: Prof. C. Polychronopoulos• InstructorInstructor: Prof. Dimitri Nikolopoulos: Prof. Dimitri Nikolopoulos• TAs:TAs:

• Michael Urman Michael Urman • Justin Quek Justin Quek • Ajay Ladsaria Ajay Ladsaria • Ryan ChmielRyan Chmiel

• You: The ECE 291 students!You: The ECE 291 students!

Page 3: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

What will ECE 291 teach you?

• You will learn how to harness the power of microprocessors

• You will learn how the “brains”, “memory” and “sensors” of a computer work together to perform powerful tasks

• You will learn how to “speak” (write) the language of hardware to get them to perform complex tasks

Page 4: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Lecture Outline

• How to navigate for success in ECE 291!• Course Syllabus• Highlights in the history of computers• Number systems review• Hints for MP0

Page 5: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Course Director

• Prof. Constantine Polychronopoulos• Office: 463-CSL• Tel.: 244-4144• e-mail: [email protected]

Page 6: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Instructor

• Dr. Dimitrios S. Nikolopoulos– Visiting Research Assistant Professor

• Office: 443-CSL• Tel. 244-5225• E-mail: [email protected] (I do read my e-mail…)• Office hours: Tu&Th 1-3pm, and/or by appointment

Page 7: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Teaching Assistants

• Michael Urman ([email protected])• Justin Quek ([email protected])• Ajay Ladsaria ([email protected])• Ryan Chmiel ([email protected])

TA Office hours will be posted at the LAB and TA Office hours will be posted at the LAB and online by Thursdayonline by Thursday

Page 8: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Lectures

• Lectures: 151 Everitt Lab, Tuesday&Thursday 10.30 a.m. – 11.50 a.m.

Notes will be made available online

Notes are not a substitute for lecture attendance!

Page 9: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Laboratory Etiquette

• Location: 238 Everitt Lab• Open 24-7 • Staffed most of the time during weekdays• Keycards for 24-7 access at 153 EL• Only for ECE291 students• You are expected to keep the place neat and clean

– No food or drink– Do not move things– Do not touch screens

Page 10: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Laboratory Etiquette

• Accounts– Reset your password at http://accounts.ad.uiuc.edu

• Home directories are in W: drive– It is stored in a server and shared among computers, you

will be able to access it from any computer in the lab

• You can access your home directory via ftp– elalpha.ece.uiuc.edu

• You can use the lab printers to print ECE291 material ONLY!– There is a100 pages/month quota,– Anything beyond that is 7¢ a page

Page 11: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Laboratory Etiquette

• Do not write anything in the C: drive!• Do not install anything in the lab computers

– Things like ICQ, Netscape,Real Player etc. are STRICTLY forbidden!

• Always logoff when you are done• Do not lock your screens after you finish your

work

Page 12: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Resources

• The ECE291 web site is your most valuable resource– my.ece.uiuc.edu– Schedule, lectures, assignments, reading material, tools,

archives– Online submission and grading of homework– Your grades

• Newsgroup: uiuc.classes.ece291– For Q&A – Share ideas, please don’t share code!

• Announcements: uiuc.classes.ece291.announce• Lab notes available as hardcopy for a small charge

and online as PDF and HTML files

Page 13: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

The course at a glance

• Computer Engineering II• The bridge between your logic design classes and

your high-level programming classes• Assembly language programming• Organization of a real microprocessor• Interface to external hardware devices • A lot of work• A lot of fun• One of the best classes in UIUC

Page 14: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Objectives of ECE291

• To become the best assembly language programmers!• Learn and manage the resources of a microprocessor• Learn the principles of machine-level programming• Organize and write large programs• Program the devices connected to a computer• Develop your engineering skills

– Design flows– Time management– Work as hard as required to make your deadlines

• And…have fun!

Page 15: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Evaluation

• Homework (6 sets) 100 points• Machine problems (5 sets) 325 points• Final project 175 points• Two exams in class(mid-final) 400 pointsTotal 1000 points

min. A is 0.95(avg. top 10%) if (0.95(avg. top 10%) > 900) then min.A = 900min. B is min. A – 100min. C is min. B – 100etc…

Page 16: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Evaluation

• You can all get an A!• A+ rewarded to the top few of those with an A• +/- rewarded 10-20 points below the grade

base• E.g. if A base is 875, 868 is A-, 859 is B+,

854 is B etc. • I hope you all get an A

Page 17: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Machine problems

• MP0 will introduce you to NASM and the tools you’ll use for the MP’s and final project

• MP1 - simple programming constructs like loops and subroutines

• MP2 – recursion, algorithms, math• MP3 – interrupts, text-mode graphics, serial communication• MP4 – advanced graphics, protected mode• Final project

– Combines what you’ve learned in all MPs– Groups of 3-4 people– Work approx. equivalent to the work of MP4 per person– You propose and we approve projects

Page 18: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers

• 1945 John Von Neumann proposes the stored program architecture

• 1948 Bardeen, Brattain and Shockley invent the transistor

• 1958 Jack Kilby (UI alumni) introduces the IC (integrated circuit) and opens the road for computing on chips

• 1960 Computers start to use transistors • 1965 Gordon Moore claims that the capacity of chips

doubles every 18 months with associated improvements in performance

Page 19: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers

• 1971 Intel introduces its first microprocessor, the 4004, which contained 2250 transistors

Courtesy of Intel’s microprocessor hall of fame

Page 20: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers History of Computers

• 1974 Intel introduces the 8080, which later became the heart of 1974 Intel introduces the 8080, which later became the heart of the first personal computer, a $379 kit named Altairthe first personal computer, a $379 kit named Altair

Courtesy of Intel’s microprocessor hall of fameCourtesy of Intel’s microprocessor hall of fame

Page 21: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers

• In 1965 Gordon Moore predicted that the number of transistors in a microprocessor will double every 18 months and this trend will hold till 1975…

Page 22: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers History of Computers

• Moore’s law is good for the last 26 years!Moore’s law is good for the last 26 years!1971: 4004 2,250 transistors

1972: 8008 2,500 transistors

1974: 8080 5,000 transistors

1978: 8086 29,000 transistors

1982: 80286 120,000 transistors

1985: 80386 275,000 transistors

1989: 80486 DX 1,180,000 transistors

1993: Pentium 3,100,000 transistors

1997: Pentium II 7,500,000 transistors

1999: Pentium III 24,000,000 transistors

2000: Pentium IV 42,000,000 transistors

Page 23: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers

• 1974 William H. Gates and Paul Allen write a BASIC interpreter

• 1981 IBM introduces the fist PC, with a 16-bit 8088 running at 4.77 MHz, using cassettes, optional floppy and a BAD operating system called DOS

• 1983 First “affordable” PCs • 1984 Introduction of the Windows interface

(work pioneered at Xerox labs)• 1985 First 32-bit microprocessor (80386)

Page 24: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

History of Computers

• 1989 80486, math co-processor included• 1992 Pentium (64-bit memory bus)• 1996 Pentium Pro (RISC core for the x86

ISA)• 1997 Pentium II, MMX• 1999 Pentium III, IA-64 (explicitly parallel

processor)

Page 25: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Current trends

• Parallelism in microprocessors– Multithreaded execution– SIMD parallelism – Explicit instruction-level parallelism

• Low-power portable computing– Reducing the energy consumed by microprocessors – Computing in laptops, handheld devices, watches

(check out IBM’s Linux watch!), sensors

• Internetworking and ubiquity– Services available over wired or wireless networks

Page 26: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Systems Review

• You should be familiar with Boolean algebra, basic arithmetic operations on binary numbers and the following material from your earlier logic classes

• The numbers we’re using are in base10 representation

dn (0…9)

dndn-1…d0 = dn10n+ dn-110n-1 +…+ do100

Example:

982310 = 9*103+8*102+2*101+3*100

Page 27: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Systems Review

• Computers use binary numbers dn (0,1)

dndn-1…d0 = dn2n+ dn-12n-1 +…+ do20

Example:

1101012 = 1*25+1*24+0*23+1*22 +0*21 +1*20 = 32+16+0+4+0+1=53

Page 28: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Systems Review

•  We use hexadecimal (hex) representation of binary numbers for convenience– Easy conversion, each hex digit is 4 bits– More compact representation

Example:

9E716= 1001 1110 01112 = 9*162+14*161+ 7*160 = 2535

Page 29: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Base Conversion

• Division/remainder method • Assume we convert n to base b• We divide n with the largest power of b which

is less than n, to obtain the first digit• If r is the remainder we repeat with the largest

power of b which is less than r, to obtain the second digit and so on…

• Class Example : Convert 19310 to binary

Page 30: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Representation

• The size of a number in digits defines the range of numbers we can represent

• Popular sizes – Bits: a binary digit– Bytes: 8 binary digits– Words: 16 binary digits (for the purposes of this

class)– Double words: 32 binary digits (for the purposes of

this class)

Page 31: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Representation

• The numbers we can represent depend on the size of the representation

• With 8 bits (a byte) we can represent numbers from 0 through 25510 (1111 11112 or FF16)

• With 16 bits (a word) we can represent numbers from 0 through 65535 (FFFF16)

• How do we represent negative numbers ?

Page 32: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Representation

• Easy solution: use the first bit as the sign bit• 0 is positive (+), 1 is negative (-)• Examples:

83 = 01010011

-71 =10100111• Is this a good idea ?

– Two representations of 0 (+0,-0)– Difficult to process positive and negative numbers

simultaneously– Can you think why ?

Page 33: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Number Representation

• Use two’s complement arithmetic• First bit still represents the sign• If –n is the number we want to represent

– Invert the bits of +n, then add 1– Or, scan n from right to left, copy leading 0s and the first 1,

invert the rest of the bits

• Example –109

10910=011011012

-109= 10010011

Page 34: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Why two’s complement ?

• Easy to handle positive and negative numbers!– Check how easy it is to compute A-B– A+(-B)– Example:

83 = 01010011

-71 =10111001

(1) 00001100

Page 35: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Things to remember

• With n bits you can represent the number from –2n to +2n-1

• -1 is a string of 1s• –2n is 1 and the rest 0s• +2n is invalid, unless you move to a larger register

(i.e. a representation of a larger size)

Page 36: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Sign extension and contraction

• Whenever you move from a m-bit to a n-bit representation, n > m, just copy the sign bit to all the additional bits in the extended representation

• Examples:• 7710 = 0100 11012 = 0000 0000 0100 1101 (16-bit)• -71 =1011 10012 = 1111 1111 1011 1001 (16-bit)• Contraction is the opposite to extension• You cannot sign contract a n-bit number to a m-bit

number unless the high order (n-m) bits are all 0’s or 1’s

Page 37: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Real numbers in binary

• Integer conversion goes on for the fractional parts

dndn-1…d0 d-1 d-2… = dn10n+ dn-110n-1 +…+ do100 + d-110-

1+ d-210-2…• Example 40.63 = 4*102 + 0*101 + 0*100 + 6*10-1 + 3*10-2

• Same thing for binary numbers• Example: Convert 10111.011 to decimal• 1*24 + 0*23 + 1*22 + 1*21 + 1*20 + 0*2-1 + 1*2-2 + 1*2-3 =

23.375• For signed unsigned you just add the sign bit in the front

of the number

Page 38: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Hints for MP0 (25 easy points)

• Edit, assemble, debug and execute a simple program• We provide you a template file• You will have to edit the template file

– Your instructor has been using vi and he’s happy with it for the last 11 years or so

– We recommend you gVim Easy (start menu option)

• You will assemble and link your program using the make utility– During your career as a programmer learning how to read and write

make files is an invaluable skill

• You will execute your program from the command line• You will learn how to use the Turbo Debugger (TD) to track

down your logical errors

Page 39: Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002

Final notes

• Activate your keycards at 153 EL• Setup your lab accounts

– accounts.ad.uiuc.edu

• Get the lab manual and start reading • Visit the ECE291 web site• Start HW0 due Friday noon• Start MP0