DOC PREVIEW
UIUC ECE 190 - Programming Studio

This preview shows page 1-2-3-4-5 out of 15 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Programming Studio 1 ECE 190 Programming Studio 1 Announcements Recitation Binary representation hexadecimal notation floating point representation 2 s complement In Studio Assignment Introduction to Linux Command Line Operations Announcements Homework 1 Is available on the website Drop off in basement of Everitt Lab in the ECE 190 Drop Box No late homework accepted If it s not in the drop box by 5pm on due date it receives a zero no excuses Programming Studio Attendance Policy If you score below average on any exam you must go to all but one studio before the next exam If you fail to meet this requirement you will not be allowed to take the next exam In order to receive credit for attending a programming studio you must completely finish lab assignments given during the studio time slot or put in a reasonable effort into solving said problem Cheating Policy We actively scan for cheating cases on exams homeworks and Machine Problems There is a difference between working to find a solution together and sharing code answers the latter is NOT allowed Course information View the syllabus on the website for deadlines rules etc Check website frequently for announcements Use the web board through my ece to ask questions Binary Representation 1 and 0 are the only digits This is a base 2 counting system Left hand bit is the MSB Most Significant Digit right hand bit is the LSB Least Significant Digit Binary decimal conversion Multiply each digit by 2n where n is the number of places away from the right most bit Sum all the products together Ex 11102 1 23 1 22 1 21 0 20 1410 Decimal binary conversion Divide the number by two if the remainder is 0 the bit is 0 otherwise it is 1 Subtract the remainder from the decimal value Repeat the above two steps until the decimal value is 0 Ex 610 6 2 3 0 bit 0 3 2 1 5 bit 1 1102 1 2 0 5 bit 1 Hexadecimal Representation Concept is the same as binary except its base 16 instead of 2 Digits range from 0 to F To indicate the number is a hexadecimal place an x in front Hexadecimal Decimal Conversion Exactly as in binary but multiply each digit by 16n Ex x1F 1 161 F 160 16 15 3110 Decimal Hexadecimal The same as in binary but divide by 16 remainder values 10 to 15 are represented by letters A to F Ex 2710 27 16 1 r 11 xB 1 16 0 r 1 x1 x1B Decimal Binary Shortcut First convert the decimal to hexadecimal then convert each hex digit to a 4 bit binary 2 s Complement A way to represent negative numbers in binary If the MSB is 1 the bit pattern represents a negative number But you can t just multiply each bit by a power of 2 to find its value To find its magnitude perform 1 s complement change all the 1 s to 0 s and vice versa Add 1 Use the standard binary decimal method to obtain the magnitude Ex 1011 0100 0100 1 0101 510 So 10112 is 510 What about 1002 To convert from decimal to 2 s complement convert the absolute value of the decimal number to binary as before If the original decimal value is negative perform 1 s complement on that binary representation and add 1 to it What is the decimal range of an n bit 2 s complement representation Floating Point Need a way to represent non integers in binary The common representation follows a standard set by IEEE IEEE 754 32 bits needed for single precision 64 bits for double Sign bit 1 if number is negative 0 if it is positive Mantissa normalized so that it always contains an implied 1 in front of the most significant bit Exponent 127 n where n is the number of places the decimal point was shifted to the left in order to normalize the mantissa n can be a negative number if we shifted the decimal point to the right Representation If you see a binary number 1011 what is its value It s just a bit pattern the person reading it adds meaning to it If we treat it as an unsigned notation the decimal value is 11 If we treat it as a signed 2 s complement notation the decimal value is 5 Or we could interpret it as a different encoding like floating point Programming Studio Assignment Introduction to Linux Logging In Log into your machine Use your netid and AD password If you cannot log in because you are not an engineering student ask your TA to create an account for you If you are using a Windows workstation you must connect to an EWS Linux machine using SSH Open PuTTY In the Host Name box type remlnx Make sure the Port is set to 22 Click Open When prompted to log in use your netid and AD password It is possible to connect to an EWS workstation from home Look on the EWS website for instructions Working in Command Line Instead of pointing and clicking we tell the computer what to do by typing a command Most of the ECE tools are only command line based In Linux open the Terminal application to enter command line mode To see which directory you are in type pwd Initially you should be in home engr your net id To see the contents of the current directory type ls To see more details about the contents type ls l To obtain help for most Linux commands programs type man command name Let s see the help information for the ls command Type man ls Creating changing directories We use the mkdir dir name command to create a directory called dir name Create a directory called mydir Type mkdir mydir Confirm that a directory was created by typing ls and seeing that the mydir directory shows up in the list To enter into a directory we use the cd command Type cd mydir to enter the mydir directory To exit to the parent directory of mydir type cd Moving Files Directories Make sure you are out of the mydir directory Type pwd to confirm you are in your home directory Create a directory called dir2 Type mkdir dir2 To move dir2 using the mv source dest command Type mv dir2 mydir Make sure you moved it to mydir Type ls mydir to see the contents inside mydir Many times you will want to make backup copies of files directories by using the cp command Make a backup copy of mydir and call it mydir backup by executing cp r mydir mydir backup The r tells the copy command to also make a copy of all the contents inside mydir If you are copying files you don t need it Type ls to confirm that you made a backup copy Deleting Files Folders We use the rm command to delete things WARNING This is an irreversible operation There is no way to undo it Make sure you use this command with caution …


View Full Document
Download Programming Studio
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Programming Studio and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Programming Studio 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?