Arithmetic Quiz - Answers

  1. For an 8-bit group, work out the representation for −3710 in

      3710 = 1001012

    1. Sign & Magnitude

      10100101

    2. One's Complement

      11011010

    3. Two's Complement

      11011011

    4. Excess-256

      −37 = −37 + 256 = 219 = 11011011

      Note: the range of representable numbers is −256 to −1 (!)

    5. Excess-128

      −37 = −37 + 128 = 91 = 01011011

      This is the more usual range. i.e. −128 to +127

  2. For a 10-bit group, what range of integers can be represented using

    1. Sign & Magnitude

      −2n−1−1 to +2n−1−1, where n = 10, i.e. −511 to +511

    2. One's Complement

      −2n−1−1 to +2n−1−1, where n = 10, i.e. −511 to +511

    3. Two's Complement

      −2n−1 to +2n−1−1, where n = 10, i.e. −512 to +511

    4. Excess-512

      −2n−1 to +2n−1−1, where n = 10, i.e. −512 to +511

  3. Express 9876510 in Binary Coded Decimal
  4. 9 8 7 6 5
    1001 1000 0111 0110 0101

  5. Form the negative equivalent of the following 8-bit Two's Complement numbers

    by comparing the resulting bitpatterns to the originals, can you spot a "short cut" method for the conversion?

  6. Take another look at the bit patterns:

    positive: 00011001   00011110   01101000   01110100
    negative: 11100111   11100010   10011000   10001100

    "starting from the rightmost bit (lsb), copy each bit unchanged up to and including the first 1 then invert all the remaining bits"

  7. Perform the following 12-bit two’s complement subtraction

     1010 1010 1011
    −1011 0000 1101
    

    Two's Complement subtraction: "negate the subtrahend and add"

    Two's Complement negation: "invert the bits and add 1"

    101100001101 = 010011110010 + 1 = 010011110011

     1010 1010 1011
    +0100 1111 0011
     --------------
     1111 1001 1110

    Check your answer by determining the decimal representation of the numbers and the result

     1010 1010 1011 =   −2048 +  683 = −1365
    −1011 0000 1101 = −(−2048 +  781 = −1267)
     --------------                    -----
     1111 1001 1110 =   −2048 + 1950 =   -98
    


[ Index ]

last updated: 24-Oct-06 Ian Harries <ih@doc.ic.ac.uk>