ECE291 Lecture 0 All about ECE291. ECE 291 Lecture 0Page 2 of 45 Staff info – Me! Josh Potts Office phone: 244-8032 Office address: 242 Everitt Email:

Slides:



Advertisements
Similar presentations
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Advertisements

Representing Numbers: Integers
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
The Binary Numbering Systems
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
COMP3221: Microprocessors and Embedded Systems--Lecture 1 1 COMP3221: Microprocessors and Embedded Systems Lecture 3: Number Systems (I)
Using MyMathLab Features You must already be registered or enrolled in a current class.
COMP3221 lec05-numbers-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 5: Number Systems – I
General information Course web page: html Office hours:- Prof. Eyal.
CS 61C L02 Number Representation (1)Harvey / Wawrzynek Fall 2003 © UCB 8/27/2003  Brian Harvey ( John Wawrzynek  (Warznek) (
Data Representation Computer Organization &
Data Representation COE 205
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Introduction to Microprocessors Number Systems and Conversions No /6/00 Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Dr. Bernard Chen Ph.D. University of Central Arkansas
1 ECE243 Computer Organization Prof. Greg Steffan.
CENG 311 Machine Representation/Numbers
Simple Data Type Representation and conversion of numbers
CS105 Lab 1 – Introduction Section: ??? TA: ??? ??? Announcements CITES Accounts Compass Netfiles Other Administrative Information CS105 Fall
Computers Organization & Assembly Language
SLIR Computer Lab: Orientation and Training December 16, 1998.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Topics Introduction Hardware and Software How Computers Store Data
Computer Arithmetic Nizamettin AYDIN
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
IT253: Computer Organization
Computing Systems Basic arithmetic for computers.
ACOE2511 ACOE251/AEEC335 -Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
1 Introduction Chapter 1 n What is Assembly Language? n Data Representation.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Why does it matter how data is stored on a computer? Example: Perform each of the following calculations in your head. a = 4/3 b = a – 1 c = 3*b e = 1.
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
CSC 221 Computer Organization and Assembly Language
COP3502: Introduction to Computer Science Yashas Shankar.
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Data Representation, Number Systems and Base Conversions
ACOE2511 Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Fixed & Floating Number Format Dr. Hugh Blanton ENTC 4337/5337.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 2: Number Systems & x86 Instructions Constantine D. Polychronopoulos Professor, ECE Office: 463.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
Lecture 1 Tuesday, January 15, 2002 Welcome to ECE 291! Spring 2002.
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
CDA 3100 Fall2009. Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
CDA 3100 Fall Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Computer Architecture and Number Systems
Lec 3: Data Representation
Topics Introduction Hardware and Software How Computers Store Data
Microprocessor Systems Design I
Logistics Always read the Calendar at
March 2006 Saeid Nooshabadi
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Chapter One: Introduction
CDA 3100 Summer 2013.
Topics Introduction Hardware and Software How Computers Store Data
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
COMS 361 Computer Organization
Presentation transcript:

ECE291 Lecture 0 All about ECE291

ECE 291 Lecture 0Page 2 of 45 Staff info – Me! Josh Potts Office phone: Office address: 242 Everitt Office hours: whenever you see me and I don’t blow you off Sense of humor: present but very bad

ECE 291 Lecture 0Page 3 of 45 Staff info – the TA’s Michael Urman Ajay Ladsaria Ryan Chmiel Justin Quek David Du George Lu

ECE 291 Lecture 0Page 4 of 45 Lecture outline Course overview Lab etiquette Design flow Number systems review Assignments

ECE 291 Lecture 0Page 5 of 45 Course overview What is ECE291? Computer Engineering II Assembly language programming Emphasis on hardware and device programming The glue between your logic design classes and your high-level programming classes A lot of work The best class at UIUC

ECE 291 Lecture 0Page 6 of 45 Course goals You will become proficient in assembly language programming You will learn to organize large programs You will learn how to interface with hardware devices in your computer You will develop excellent time management skills or you will die

ECE 291 Lecture 0Page 7 of 45 Structure and evaluation 6 Home work sets125 points 5 Machine problems300 points 2 Exams400 points 1 Final project175 points Total1000 points

ECE 291 Lecture 0Page 8 of 45 Structure and evaluation 2 Grading scale Minimum A = 95% x AVG(Top 10%) Minimum A = 95% x AVG(Top 10%) Minimum B = Minimum A – 100 Minimum B = Minimum A – 100 Minimum C = Minimum B – 100 Minimum C = Minimum B – 100 Etc. Etc. If Minimum A as calculated above is > 900 then 900 is the minimum A

ECE 291 Lecture 0Page 9 of 45 Structure and evaluation 3 The top “few” people will get A+’s unless everyone in the class really sucked + and - grades will be dolled out just below letter grade break points. So if the minimum A is 900, 890 to 899 will get an A-, 880 to 889 will get a B+. I have no quotas on grades. I hope you all get A’s!

ECE 291 Lecture 0Page 10 of 45 Miscellaneous The 291 website is your most important source of information Home works are completed online at the website All lecture notes, schedule changes, handouts, etc, are available on the website.

ECE 291 Lecture 0Page 11 of 45 Miscellaneous 2 The lab notes may be purchased in the IEEE bookstore in the basement for aproximately $11. They have been extensively revised and updated over the summer and should be very useful. You may obtain PDF or HTML versions from the 291 Web Site.

ECE 291 Lecture 0Page 12 of 45 Miscellaneous 3 The 291 newsgroup is used heavily throughout the semester to answer questions uiuc.classes.ece291 Don’t post code to the newsgroup Post questions and answers to questions, but don’t tell people how to code their MP’s. Be civil. No flaming. Flaming will be punished. We also have an announcements newsgroup that only TA’s and myself can post to uiuc.classes.ece291.announce

ECE 291 Lecture 0Page 13 of 45 Miscellaneous 4 Review the following documents available on the 291 website Syllabus Syllabus Class outline and lecture schedule Class outline and lecture schedule Lab staffing schedule Lab staffing schedule Homework 0 Homework 0 Machine problem 0 Machine problem 0

ECE 291 Lecture 0Page 14 of 45 Lab etiquette The 291 lab is in 238 Everitt Lab The lab is open 24-7 Get your keycards activated in 153 EL No food or drink allowed in the lab Don’t prop the door open Don’t let people in the lab who aren’t enrolled in the class

ECE 291 Lecture 0Page 15 of 45 Lab etiquette 2 The lab has recently been completely renovated. New paint job New paint job New tables and chairs New tables and chairs Increased number of computers from 30 to 37 Increased number of computers from 30 to 37 New computers (1GHz, 256MB ram, 17” flat panel monitors) New computers (1GHz, 256MB ram, 17” flat panel monitors) About $85,000 worth of improvements in all About $85,000 worth of improvements in all

ECE 291 Lecture 0Page 16 of 45 Lab etiquette 3 Clean up after yourselves Push your chair back under the table when you leave Push your chair back under the table when you leave Don’t leave candy wrappers or pop cans Don’t leave candy wrappers or pop cans Don’t leave papers laying about Don’t leave papers laying about Don’t lock screens – log off when you leave Don’t lock screens – log off when you leave Don’t poke monitors!!! Don’t poke monitors!!!

ECE 291 Lecture 0Page 17 of 45 Lab etiquette 4 Computer accounts – reset password at Home directories – store your work on the w: drive. The w: drive is your own private work area. It is stored on a server and follows you from computer to computer DO NOT STORE ANYTHING ON THE C: DRIVES OF THE LAB COMPUTERS

ECE 291 Lecture 0Page 18 of 45 Lab etiquette 5 FTP access to home directories ftp to elalpha.ece.uiuc.edu The 291 lab printer is for printing 291 lab materials. Don’t abuse it Don’t abuse it 100 page per month quota 100 page per month quota $0.07 charge per page over quota $0.07 charge per page over quota

ECE 291 Lecture 0Page 19 of 45 Lab etiquette 6 The lab computers don’t belong to you! Don’t destroy them Don’t destroy them Don’t install anything on them (this includes ICQ, Netscape, Real Player, MIRC, etc.) Don’t install anything on them (this includes ICQ, Netscape, Real Player, MIRC, etc.) Don’t attempt to move the computers, rearrange the monitors and speakers, etc. Don’t attempt to move the computers, rearrange the monitors and speakers, etc. ALWAYS log off when you are done ALWAYS log off when you are done

ECE 291 Lecture 0Page 20 of 45 Machine problems MP0 – Introduction to assembly language General design flow General design flow Debugging process Debugging process Introduction to the software tools Introduction to the software tools MP1 – Basic input and output Procedures Procedures Basic instructions Basic instructions Library routines Library routines

ECE 291 Lecture 0Page 21 of 45 Machine problems MP2 – Interrupts and I/O Advanced keyboard input Advanced keyboard input Serial port communication (probably between two computers in a client-server paradigm) Serial port communication (probably between two computers in a client-server paradigm) Keyboard interrupts Keyboard interrupts MP3 – Text mode video, timing MP4 – Protected mode, hi-res graphics, image processing, basic-shape drawing

ECE 291 Lecture 0Page 22 of 45 Final project All of the above topics plus sound and networking if you want to try them. Groups of 2 to 5 people (we prefer 3 or 4) Should be the equivalent of a later MP’s work per person You propose projects to us, we approve them or make suggestions

ECE 291 Lecture 0Page 23 of 45 Why am I doing this? Program speed Compact executable Common in DSP and embedded systems Games, games, games!!!

ECE 291 Lecture 0Page 24 of 45 Design flow Coding We will provide you with “skeleton” files for each MP. Copy this skeleton file to your w: drive and work on it from there. For MP0, the file is mp0.asm. We will provide you with “skeleton” files for each MP. Copy this skeleton file to your w: drive and work on it from there. For MP0, the file is mp0.asm. Write your assembly code in mp0.asm using your favorite text editor (we suggest vim) Write your assembly code in mp0.asm using your favorite text editor (we suggest vim) Run the make command. This invokes NASM, the Netwide ASseMbler. Run the make command. This invokes NASM, the Netwide ASseMbler.

ECE 291 Lecture 0Page 25 of 45 Design flow 2 Making your executable Running make from the command line assembles your code using NASM, links it with any library functions we provide and generates an executable like mp0.exe Running make from the command line assembles your code using NASM, links it with any library functions we provide and generates an executable like mp0.exe If there are syntax errors in your code, Nasm will tell you about it If there are syntax errors in your code, Nasm will tell you about it

ECE 291 Lecture 0Page 26 of 45 Design flow 3 Debugging Use feedback from Nasm to eliminate all syntax errors. Use feedback from Nasm to eliminate all syntax errors. Use Turbo Debugger (td) to track down run- time and logic errors. Use Turbo Debugger (td) to track down run- time and logic errors. MP0 takes you through the above process

ECE 291 Lecture 0Page 27 of 45 Number systems review Base 10 representation (decimal) (0..9): d n 10 n + d n-1 10 n d d d d n 10 n + d n-1 10 n d d d Example: 3045 Example: 3045 = 3* * *10 0 = = 3045

ECE 291 Lecture 0Page 28 of 45 Number systems review 2 Base 2 representation (binary) (0..1): d n 2 n + d n-1 2 n d d d d n 2 n + d n-1 2 n d d d Eg: Eg: = 1* * * *2 0 = = 45

ECE 291 Lecture 0Page 29 of 45 Number systems review 3 Base 16 representation (hex) (0..9,A..F): d n 16 n + d n-1 16 n d d d d n 16 n + d n-1 16 n d d d AF 3AF = 3* * *16 0 = 3* * = 943

ECE 291 Lecture 0Page 30 of 45 Base conversion Division/remainder method - Long division by largest power of base. Example: Convert 45 decimal to binary Example: Convert 45 decimal to binary 45 divides by 32 (2 5 ) once, leaves divides by 8 (2 3 ) once, leaves 5 5 divides by 4 (2 2 ) once, leaves 1 1 divides by 1 (2 0 ) once, leaves nothing [done] Thus: 45 (base 10) == (base 2)

ECE 291 Lecture 0Page 31 of 45 Number representation In computers, the size of a number becomes important. An 8-bit number for example always has 8 binary digits. Example: Example: Hexadecimal is a convenient shorthand for binary numbers: Example: 1Ah Example: 1Ah

ECE 291 Lecture 0Page 32 of 45 Number representation In an 8-bit system, the largest number we can represent is , or FFh, or 255d If we need to represent bigger numbers, we need more bytes. 16-bit numbers go up to 65,535d or FFFFh or

ECE 291 Lecture 0Page 33 of 45 Signed numbers Need a way to represent negative numbers Let’s try using the first bit or most significant bit as a sign bit! Sign bit = 0: positive Sign bit = 0: positive Sign bit = 1: negative Sign bit = 1: negative Example: = -2 decimal = +2 decimal

ECE 291 Lecture 0Page 34 of 45 Signed numbers 2 Trouble/Confusion/Problem How is different from ? How is different from ? One is -0 and one is +0. No different at all! One is -0 and one is +0. No different at all! We should intuitively dislike having to different representations for the same thing. We should intuitively dislike having to different representations for the same thing. More problems It becomes difficult to process positive and negative numbers. Special cases for each. It becomes difficult to process positive and negative numbers. Special cases for each.

ECE 291 Lecture 0Page 35 of 45 Two’s complement The solution is to use Two’s Complement Numeric Formula: -d n 2 n + d n-1 2 n d d 1 *2 1 + d 0 *2 0 Numeric Formula: -d n 2 n + d n-1 2 n d d 1 *2 1 + d 0 *2 0 Notice the negative sign in front of d n Notice the negative sign in front of d n

ECE 291 Lecture 0Page 36 of 45 Two’s complement 2

ECE 291 Lecture 0Page 37 of 45 Two’s complement 3 We are taking advantage of the circular nature of fixed-length binary numbers To subtract A-B, perform A+(-B). Now the addition operator works for negative numbers Notice: First bit still represents the sign of the number. s=0: positive (+) s=0: positive (+) s=1: negative (-) s=1: negative (-)

ECE 291 Lecture 0Page 38 of 45 Two’s complement 4 Three methods to compute a negative number (n) (choose one method) Invert bits of n then add 1 Invert bits of n then add 1 Take largest number (all ones), subtract n, add 1 Take largest number (all ones), subtract n, add 1 Scan n from right to left. Copy zeros, copy first one, invert remaining numbers Scan n from right to left. Copy zeros, copy first one, invert remaining numbers

ECE 291 Lecture 0Page 39 of 45 Two’s complement 5 Examples (8-bit): -1 = = = = = = = = = = = Invalid +128 = Invalid

ECE 291 Lecture 0Page 40 of 45 Two’s complement 6 Examples: (16-bit) -1 = = = = ,768 = ,768 = Observations When you move to a larger register (increase the number of bits), just extend the sign bit to the left. When you move to a larger register (increase the number of bits), just extend the sign bit to the left.

ECE 291 Lecture 0Page 41 of 45 Sign and Zero Extension Consider the value 64 the 8-bit representation is40h the 8-bit representation is40h the 16-bit equivalent is0040h the 16-bit equivalent is0040h Consider the value -64 the 8-bit two’s complement is C0h the 8-bit two’s complement is C0h the 16-bit equivalent isFFC0h the 16-bit equivalent isFFC0h The rule: to sign extend a value from some number of bits to a greater number of bits - copy the sign bit into all the additional bits in the new format Remember - you must not sign extend unsigned values

ECE 291 Lecture 0Page 42 of 45 Sign Contraction Given an n-bit number, you cannot always convert it into an m-bit number if m < n Consider the value -448 the 16-bit representation is FE40h the 16-bit representation is FE40h the magnitude of this number is too great to fit into an 8-bit value the magnitude of this number is too great to fit into an 8-bit value this is an example of an overflow condition that occurs upon conversion this is an example of an overflow condition that occurs upon conversion To properly sign contract one value to another the bits that you wish to remove must all contain either 0 or 1 FF80h can be signed contracted to 80h FF80h can be signed contracted to 80h 0100h cannot be sign contracted to 8-bit representation 0100h cannot be sign contracted to 8-bit representation

ECE 291 Lecture 0Page 43 of 45 Real numbers in binary Recall d n *2 n + d n-1 *2 n d 2 *2 2 + d 1 *2 1 + d 0 *2 0 d n *2 n + d n-1 *2 n d 2 *2 2 + d 1 *2 1 + d 0 *2 0 Notice the exponents begin from n and decrease to zero. For fractional parts, just keep going d -1 * d -2 * d -3 * … d -1 * d -2 * d -3 * …

ECE 291 Lecture 0Page 44 of 45 Real numbers in binary Example: Convert to decimal For negative numbers, we just stick a sign bit in the front and forget about it.

ECE 291 Lecture 0Page 45 of 45 Assignments Get started on MP0. Start HW0. Due Wednesday Reset your computer account password Get your keycard activated Go buy the Lab Manual