{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

l8_arithmetic

# l8_arithmetic - L8 Arithmetic Structures Structures...

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

L8: Arithmetic Structures L8: Arithmetic Structures Acknowledgements: - J. Rabaey, A. Chandrakasan, B. Nikolic. Digital Integrated Circuits: A Design Perspective . Prentice Hall, 2003. - Kevin Atkinson, Rex Min L8: 6.111 Spring 2004 Introductory Digital Systems Laboratory 1 ., Materials in this lecture are courtesy of the following people and used with permission. Computer Science) - Gaetano Borriello (University of Washington, Department of Computer Science & Engineering, http://www.cs.washington.edu/370)

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

View Full Document
Number Systems Basics Number Systems Basics How to represent negative numbers? ± Three common schemes: sign-magnitude, ones complement, twos complement ± Sign-magnitude: MSB = 0 for positive, 1 for negative ² Range: -(2 N-1 – 1) to +(2 N-1 –1) ² Two representations for zero: 0000… & 1000… ² Simple multiplication but complicated addition/subtraction _ ± Ones complement: if N is positive then its negative is N ² Example: 0111 = 7, 1000 = -7 ² Range: -(2 N-1 – 1) to +(2 N-1 –1) ² Two representations ² Subtraction implemented as addition followed by ones complement L8: 6.111 Spring 2004 Introductory Digital Systems Laboratory 2
Twos Complement Representation Twos Complement Representation Twos complement = bitwise complement + 1 0000 0001 0010 0011 1000 0101 0110 0100 1001 1010 1011 1100 1101 0111 1110 1111 -1 +0 -2 +1 0111 1000 + 1 = 1001 = -7 -3 +2 1001 0110 + 1 = 0111 = 7 -4 +3 -5 +4 ± Asymmetric range: -2 N-1 to +2 N-1 -1 ± Only one representation for zero -6 +5 ± Simple addition and subtraction -7 +6 ± Most common representation -8 +7 4 0100 -4 1100 4 0100 -4 1100 + 3 0011 + (-3) 1101 -3 1101 + 3 0011 7 0111 -7 11001 1 10001 -1 1111 [Katz93, chapter 5] L8: 6.111 Spring 2004 Introductory Digital Systems Laboratory 3

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

View Full Document
Overflow Conditions Overflow Conditions Add two positive numbers to get a negative number or two negative numbers to get a positive number 0000 0001 0010 0011 1000 0101 0110 0100 1001 1010 1011 1100 1101 0111 1110 1111 -1 +0 -2 +1 -3 +2 -4 0000 0001 0010 0011 1000 0101 0110 0100 1001 1010 1011 1100 1101 0111 1110 1111 +0 -1 -2 +1 -3 +2 -4 +3 +3 -5 -5 +4 +4 -6 -6 +5 +5 -7 +6 -7 +6 -8 +7 -8 +7 5 + 3 = -8! -7 - 2 = +7! 0 1 1 1 10 0 0 5 0 1 0 1 -7 1 0 0 1 3 0 0 1 1 -2 1 1 0 0 0 1 1 1 -8 0 1 0 0 0 7 1 If carry in to sign equals carry out then can ignore carry out, otherwise have overflow L8: 6.111 Spring 2004 Introductory Digital Systems Laboratory 4
Binary Full Adder Binary Full Adder A B Full Adder S = A B C i C o = ABC i + ABC i + ABC i + ABC i C i C o = AB + C i (A+B) S A B CI 0 0 0 0

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 22

l8_arithmetic - L8 Arithmetic Structures Structures...

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

View Full Document
Ask a homework question - tutors are online