CS 367 Section 002 Spring 2010
HW #3
Due Thursday, February 25 at classtime

  1. (30 pts) Converting between representations
    Fill in the table below. If it is not possible to represent a value, explain why. Binary numbers are limited to 8 bits. Use twos complement for signed numbers.
    DecimalUnsigned BinarySigned Binary
    1250111110101111101
    -125 smaller than UMIN10000011
    21911011011greater then TMAX
    -219smaller than UMINsmaller than TMIN
    10101100101-----
    21111010011-----
    83-----01010011
    -73-----10110111

  2. (20 pts) Integer Addition
    Considering both signed (twos complement) and unsigned arithmetic, what is the result of adding each pair of 8 bit binary numbers. Characterize each result as:

    1. 01001000 + 00101100 = 01110100 - correct for both
    2. 01110000 + 01101100 = 11011100 - correct for unsigned only
    3. 11011001 + 01100011 = 00111100 - correct for signed only
    4. 11011001 + 11100011 = 10111100 - correct for signed only
    5. 00000000 + 11111111 = 11111111 - correct for both

  3. (50 pts) Floating Point
    Assume a 10 bit floating point representation which uses the first bit as a sign bit, the next 5 for the exponent and the last 4 for the fraction. The bias is 15. Fill in the table below.
    Bit representation    e      E       f      M        V     
    0 01101 000113-2 1/1617/1617/16 * 1/4 = 17/64
    1 10011 101019410/1626/16-26/16 * 16 = -26.0
    0 00000 1010
    denormalized
    0-1410/1610/1610/16 * 1/(2**14)
    0 01111 00111503/1619/1619/16
    0 10100 10002058/1624/1648.0
    0 01100 010012-34/1620/165/32
    What is the bit sequence for 0?
    0 00000 0000

    What is the bit sequence and value for the largest possible normalized value?
    0 11110 1111 which is 31/16 * (2**15)

    What is the bit sequence and value for the smallest possible positive normalized value?
    0 00001 0000 which is 1/(2**14)

    What is the bit sequence and value for the largest possible de-normalized value?
    0 0000 1111 which is 15/16 * 1/(2**14)

    What is the bit sequence and value for the smallest possible positive de-normalized value?
    0 0000 0001 which is 1/16 * 1/(2**14)