c05_ps03_fall03

# c05_ps03_fall03 - long 3 Write an algorithm to convert a...

This preview shows page 1. Sign up to view the full content.

UNIFIED ENGINEERING Fall 2003 I. Kristina Lundqvist Problem C5. (Unified Computers and programming) 1. Convert the following base 10 numbers into 8-bit 2’s complement notation 0, -1, -12 2. Perform each of the following additions assuming that the bit strings represent values in 2’s complement notation. Identify the cases in which the answer is incorrect because of overflow. 1111 01111 01110 + 1111 +10001 +01010 Hint : The bit strings are only 5 bits long so your answer should also be 5 bits
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: long. 3. Write an algorithm to convert a negative decimal number into a binary number in 2’s complement form. Assume that the number ranges from +127 to -128 Hint: You already know how to convert a positive decimal number into binary notation. Think about determining sign and inverting bit positions. 4. Implement your algorithm in Ada95. Turn in an electronic copy of your code listing and a hard copy of your code....
View Full Document

## This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Ask a homework question - tutors are online