# The 2s complement of a negative number is obtained by

• Notes
• 6
• 100% (1) 1 out of 1 people found this document helpful

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

The 2's complement of a negative number is obtained by adding 1 to the 1's complement 28 obtained by adding 1 to the 1 s complement. For -13 00001101 base integer 11110010 1's complement +1 11110011 2's complement Example Write -25 in two's complement format. 0 0 0 1 1 0 0 1 25 1 1 1 0 0 1 1 0 ne's c mplement 29 one's complement 1 1 1 0 0 1 1 1 two's complement Two's Complement to Decimal If the sign bit is 0, convert the binary number to decimal. If the sign bit is 1 bt t 1 f th b b 30 subtract 1 from the binary number complement each bit convert the binary number to decimal put a minus sign in front

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

6 Example Convert the following 2's complement representation to decimal: 11100011 31 11100011 -> (subtract 1) -> 11100010 -> (complement each bit) 00011101 -> (change to decimal) -> 29 -> (put – in front) -> -29 Example Convert the following 2's complement representation to decimal: 11100011 Compute 2’s complement: 32 11100011 -> (1’s complement: 00011100) -> (Add 1: 00011101) (change to decimal) -> 29 -> (put – in front) -> -29 Before the next lecture Read from CHR textbook pp. 8-21 and 28-48. 33
This is the end of the preview. Sign up to access the rest of the document.
• Winter '08
• M
• Boolean Algebra, Binary numeral system, Decimal

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern