### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Class Note for ENGIN 112 at UMass(13)

### View Full Document

## 26

## 0

## Popular in Course

## Popular in Department

This 17 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Massachusetts taught by a professor in Fall. Since its upload, it has received 26 views.

## Similar to Course at UMass

## Popular in Subject

## Reviews for Class Note for ENGIN 112 at UMass(13)

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 02/06/15

College of Engineering University of Massachusetts Amherst ENGIN 112 Introduction to Electrical and Computer Engineering Fall 2008 Discussion A 2 Number Systems Decimal and Binary Number Systems Number representations make use of a base or radix A radixr system uses the r digits 0 1 r l Convention Let 01 02 be digits in the radixr set Then the radixr number 0K aKl 0100 3901 aIVI r T quotradix pointquot means aKx rKaK1 x rK391 01 x r1 00 x r0 a1 x r391 0M x r39M We most commonly use decimal radix10 number representations so decimal digits are 0 1 9 But computer arithmetic is based on binary radix2 number representations so binary digits or bits are 0 1 Converting a binary representation to a decimal representation is easy for example 1001110012 1x24 1x21 1x20 1x2391 1x2394 162112116 19562510 How do we convert decimal to binary Shorthand for procedure 25 2 12 remainder 1 9 00 1 1226 remainder0 9 010 6 2 3 remainder O 9 02 O 321remainder1 9 031a41 So 2510 110012 v Now Find the binary representation for 3810 ans 1001102 For numbers that have both integer and fractional parts Convert the two parts separately then put together Now Find the binary representation to 6 fractional bits of 6310 ans 1100100112 Other Number Systems Sometimes it is convenient to represent numbers using bases other than 10 or 2 In particular large binary numbers are often converted to octal radix 8 using digits 0 1 2 7 or hexadecimal radix 16 using digits 0 1 9 A B C D E F where A digit for quot10 B digit for quot11 F digit for quot15 Since three bits can be used to represent 0 1 7 we can convert binary to octal just by grouping bits in sets of three starting from the radix point Similarly four bits can be used to represent 0 1 15 so to convert binary to hexadecimal we group bits in sets of four starting from the radix point Now Convert 282510 to octal and hexadecimal ans 3428 10416 II Binary Arithmetic Addition and multiplication of binary numbers is done in the same way as with decimal numbers except that we can only use binary digits Examples 111 4 Carries 10101 10111 101100 Check 101012 10510 101112 11510 105 11 510 221o 101102 I 10111 x 10101 10111 0 10111 00 1011100 1110011 1011100 111100011 ChECC x 12075101111000112 u It s easiest to do the addition two terms at a time Now Find 1010112 100112 and 1010112 x 100112 ans 1010112 100112 11010012 1010112 x 100112 11001100012 Subtraction and Signed Binary Numbers Subtraction can be done using standard binary numbers but it is awkward to program Also if we want to allow for negative numbers we need some way to represent the sign or of a binary number Various ways of doing this are discussed in the textbook in Secs 15 and 16 We ll discuss the most commonlyused approach Signed2 s Complement representations Suppose we want to represent the positive integers 0 1 2 1 using n bits The nbit 2 scomplement representation for an integer N in this set is de ned to be the binary representation for the number 2 N The 2 s complement representation for 0 is de ned to be the binary representation for 0 Example Say we use 4 bits to represent the integers 0 1 15 Find the 4bit binary and 2 scomplement representations for 1410 n4 N14 2 N2 So binary representation is 1110 2 scomplement representation is 0010 Now suppose we need to represent the positive and negative integers in the set 2 391 2 391 1 1 O 1 2W 1 total of 2 digits This is most commonly done as follows we use the standard n bit binary representations for integers in the set 0 1 2 391 1 for negative integer N in the set 2 391 2 391 1 1 we use the nbit 2 scomplement representation for N Note that in this format All nonnegative integer representations have leftmost bit 0 while all negative integer representations have leftmost bit 1 so the leftmost bit is the sign bit This is called a signed 2 scompement representation Example Find the 4bit signed 2 scomplement representations of 610 and 410 610 0110 4bit 2 s complement representation of 410 4bit representation of 16 4 1210 11002 So 1100 3941o Now Suppose have signed 2 scomplement numbersA and B A B is computed in exactly the same way as with standard binary numbers except there is no carry of the sign bit A B is computed as A 2 s complement of B again with no carry of the sign bit Example Say we are using 5bit signed 2 s complement representations Show the binary operations for i 510 39 710 5bit 2 scomplement for 710 5bit rep for 32710 2510 110012 So have 00101 11001 11110 5bit signed 2 s complement representation for 321684210 210 t ii 151o 3961o 610 is represented by the 2 scomplement of 610 5bit rep for 32 610 11010 So have 01111 11010 01001 no carry of sign bit 910 t Now Using 4bit signed 2 s complement representations calculate 510 39610 ans 1111 110 Now suppose have numbers represented in 5bit signed 2 s complement format Say that we add 00111 to some number B and the result is 11110 What is B ans B 10111 910

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.