{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

03_Arithmetic - Computer Arithmetic Readings 3.1-3.3 C.5...

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

View Full Document Right Arrow Icon
Computer Arithmetic Readings: 3.1-3.3, C.5 Review binary numbers, 2’s complement Develop Arithmetic Logic Units (ALUs) to perform CPU functions. Introduce shifters, multipliers, etc. 37 Binary Numbers Decimal: 471 = 4*10 2 + 7*10 1 + 1*10 0 Binary: 01101 = 1*2 3 + 1*2 2 + 0*2 1 + 1*2 0 = (13) 10 Example: 0111010111 = (?) 10 38
Background image of page 1

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

View Full Document Right Arrow Icon
2’s Complement Numbers Positive numbers & zero have leading 0, negative have leading 1 Negation: Flip all bits and add 1 Ex: –(01101) 2 = To interpret numbers, convert to positive version, then convert: 11010 = 01100 = 39 Sign Extension Conversion of n-bit to (n+m)-bit 2’s complement: replicate the sign bit b 3 b 2 b 1 b 0 = b 3 b 3 b 3 b 2 b 1 b 0 = b 3 b 3 b 3 b 3 b 3 b 3 b 3 b 3 b 3 b 3 b 3 b 3 b 2 b 1 b 0 Ex - Convert to 8-bit: 01101 = (13) 10 11101 = (-3) 10 40
Background image of page 2