Assignment 2, due Feb 1

Part of the homework for 22C:60 (CS:2630), Spring 2013
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: Once upon a time, some eccentric folks thought we ought to all learn the duodecimal system (Base 12). Perhaps it had to do with the fact that British currency used 12 pence per shilling or that eggs are traditionally sold by the dozen. The most common duodecimal representation augments the conventional decimal digits with A standing for 10 and B standing for 11. (each part of this problem is worth 0.1 points)

    A Problem: Convert each of the following duodecimal numbers to decimal:
    a) 100
    b) A9
    c) 234

    Another Problem: Convert each of the following decimal numbers to duodecimal:
    d) 100
    e) 512

  2. A Problem: Here are 5 random 8-bit unsigned binary numbers. Convert them to decimal. (0.1 points each)
    00010111 00010111 01111010 11011001 10101101
    

  3. A Problem: Here are 5 random 8-bit two's complement binary numbers. Convert them to the usual signed-magnitude decimal number representation. (0.1 points each)
    11100100 01001110 11001010 11101111 01010110
    

  4. A Problem: Here are 5 random 8-bit one's complement binary numbers. Convert them to the usual signed-magnitude decimal number representation. (0.1 points each)
    01101001 01011110 01001100 10001010 00100101
    

  5. A Problem: Here are 5 random 8-bit binary numbers. Give their hexadecimal equivalents. We can't prevent you from using a calculator, but note that if you don't learn to do these kinds of problems in your head, the rest of the semester is likely to be extremely difficult. (0.1 points each)
    11010101 01010010 00110100 10010000 00000101 
    

  6. Background: You find a word in the Hawk memory and convert its contents to decimal, getting this value: 3735928559.

    a) What is the decimal equivalent of each of the two halfwords that make up this word? Give them in order of ascending memory addresses. (0.2 points)

    b) What is the decimal equivalent of each of the four bytes that make up this word? Give them in order of ascending memory addresses. (0.3 points)

    (In this final problem, feel free to use calculators, on-line or off, but you will need to look at Chapter 3 first.)