Assignment 2, due Sep 3

Part of the homework for 22C:60, Fall 2010
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!

Homework

  1. The problem: Convert the following values to the indicated base: (1 point)

    a) 10101011110011012 to base 16
    b) 323300014 to base 16
    c) 215058 to base 16
    d) 2650510 to base 16
    e) A8CA16 to base 10

    Hint: Some patterns should emerge to help you judge your answers.

  2. The problem: Consider the value -123 (a negative decimal number). (1 point)

    a) Convert it to a 12-bit signed magnitude binary number.
    b) Convert it to a 12-bit one's complement binary number.
    c) Convert it to a 12-bit two's complement binary number.
    d) Convert it to a 12-bit natural-biased binary number.
    e) Convert it to a 4-digit 10's complement decimal number.

  3. The Problem: Show the result of assembling the following into memory using the SMAL assembly language. Show the result in hexidecimal as a sequence of 32-bit words in memory: (1 point)
    	H       17767
            B       "#"
    	B       1
    	W	32#24QNJFF
    

    Hint: You can use the SMAL assembler to help you with this, but you will need to finish the job of packing the result into 32-bit words by yourself. Also, as in problem 1, when you get it right, the result should be obviously right.