Assignment 10, due Apr 6

Part of the homework for 22C:60 (CS:2630), Spring 2012
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (usually Friday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!

  1. Background: Here is a floating-point representation that might have been of some small use on a 16-bit minicomputer. It is designed to explicitly avoid advanced concepts common in floating point representations today:
    |_ _ _ _|_ _ _ _|_ _ _ _|_ _ _ _|
    |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
    |s|   exp   |      mantissa     |
    

    Each part is worth 0.2 points.

    a) What is the approximate decimal equivalent of FFFF16 in this number system?

    b) What is the exact decimal equivalent of 123416 in this number system?

    c) What is the normalized binary representation of of 1 in this number system?

    d) What is the normalized binary representation of of 1010 in this number system?

    e) What is the normalized approximate binary representation of of 0.110 in this number system?

    Background: Here is a floating-point representation that might have been of some small use on a 16-bit minicomputer. It is designed to make use of all of the advanced concepts typical of modern floating-point numbers

    |_ _ _ _|_ _ _ _|_ _ _ _|_ _ _ _|
    |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
    |s|   exp   |      mantissa     |
    

    Each part is worth 0.2 points.

    a) What is the binary equivalent of 1.010 in this number system.

    b) What is the binary representation of the largest non-infinite positive number in this system?

    c) What is the approximate decimal equivalent of your answer to part a? (That was a typo, this should have asked about part b!)

    d) What is the binary representation of the smallest non-zero positive number in this system?

    e) What is the approximate decimal equivalent of your answer to part c? (That was a typo, this should have asked about part d!)

  2. A Problem: Write a SMAL Hawk subroutine that takes, as an argument, a floating point number in the least significant 16 bits of R3 encoded in the format defined for problem 1. The subroutine should convert this number to the smallest integer greater than or equal to that number and return the result in R3 when it is done. Write textbook-quality code. Insufficient or excessive comments will be penalized. (1 point)