CSE20 Lecture 3

# CSE20 Lecture 3 - CSE20 Lecture 2W1 Number Systems Negative...

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

CSE20 Lecture 2W1 1/12/2010 Number Systems: Negative Numbers 1. Sign and Magnitude Representation 2. 1’s Complement Representation 3. 2’s Complement Representation 1 CK Cheng, UC San Diego

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

View Full Document
2 Outlines 1.Goal of the Negative Number Systems 2.Definition 1.Sign Magnitude Rep. 2.1’s Complement Rep. 3.2.s Complement Rep. 3.Arithmetic Operations
Goal of negative number systems Signed system: Simple. Just flip the sign bit 0 = positive 1 = negative One’s complement: Replace subtraction with addition Easy to derive (Just flip every bit) Two’s complement: Replace subtraction with addition Addition of one’s complement and one produces the two’s complement. 3

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

View Full Document
Definitions: Given a positive integer x, we represent -x 1’s complement: s Formula: 2 n -1 – x i.e. n=4, 2 4 – 1 – x = 15 – x In binary: (1 1 1 1) – (b 3 b 2 b 1 b 0 ) Just flip all the bits. 2’s complement:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

CSE20 Lecture 3 - CSE20 Lecture 2W1 Number Systems Negative...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online