Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 1 decade ago

Binary number arithmetic question... quiz question I got wrong but can't figure out the right answers to.?

Use seven bits to accommodate each number together with its sign. In each case, determine if there's an overflow.

A. (+35) + (+40)

B. (-35) + (-40)

C. (-35) - (+40)

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    For A...

    Convert 35 and 40 to binary using 7 digits. First, I have to assume that these numbers are using two's complement, since B & C use negative numbers.

    0100011

    +0101000

    ________

    1101011

    1101011 converts to a negative number in two's complement which is not valid. the easier way to remember is that signed two's bit complement numbers can only represent numbers -64 <= x <= 63

    Since 35 + 40 = 70 which is greater than 63, you know there will be overflow.

    B & C follow directly.

    Source(s): Software Architect.
Still have questions? Get your answers by asking now.