CSE20 Lecture 3 - CSE20 Lecture 2W1 1/12/2010 Number...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

CSE20 Lecture 3 - CSE20 Lecture 2W1 1/12/2010 Number...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online