{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSE20 Lecture 4

# CSE20 Lecture 4 - CSE 20 Lecture 4 CK Cheng UC San Diego...

This preview shows pages 1–7. Sign up to view the full content.

1 CSE 20 Lecture 4 01/14/10 circle6 Negative numbers One’s and Two’s Complement circle6 Residual numbers CK Cheng, UC San Diego

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 CK No office hours next week Pat No office hours next week On Tuesday 1/19, Peng Du will be going over Chapter 11(Shaum’s) On Thursday 1/21, Peng Du will be going over Chapter 11 (Shaum’s) Midterm will be held on 1/28 Announcements
3 One’s Complement Given two positive integers x & y, perform: x + y x – y – x + y – x – y

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 How to Solve 1) Derive 1’s complement of the operands 2) Sum up the two operands 3) Use carry-out to feed into carry-in 4) The result is the solution in 1’s complement Carry-In Carry-Out
5 Formulas for 1’s Complement Arithmetic 1’s Complement x+y x+y x-y x+(2 n -1-y)=2 n -1+(x-y) -x+y (2 n -1-x)+y = 2 n- 1+(-x+y) -x-y (2 n -1-x)+(2 n -1-y)=2 n -1+(2 n -1-x-y)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 1’s Complement Example: 4 – 3 = 1 3 in binary = 0011. Flipping the bits, you get –3 (1100) in binary, which is 12.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}