Assignment 2, due Sep 5

Part of the homework for CS:2630 (22C:60), Fall 2014
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. A Problem: Convert the following numbers to the base requested:

    a) Convert 10010 to octal. (0.2 point)

    b) Convert 10010 to hexidecimal. (0.2 point)

    c) Convert ADD16 to binary. (0.2 point)

    d) Convert ADD16 to decimal. (0.2 point)

    e) Convert ADD16 to base 5. (0.2 point)

    Note that, in some of the above, you will find the results of one of the previous conversions to be useful.

  2. A problem: What is the decimal value of 101110 interpreted as:

    a) A 6-bit one's complement signed binary number. (0.2 point)

    b) A 6-bit two's complement signed binary number. (0.2 point)

    c) A 6-bit signed magnitude binary number. (0.2 point)

    d) A 6-bit biased binary number (with the default bias). (0.2 point)

    Background: Here is a file of data in SMAL that follows the rules for Machine Problem 1 and can be tested in exactly the same way as the test data given with the assignment:

    	TITLE	"mp1.a alternative version, Aug. 26, 2014"
    
            INT     ARRAY		; make ARRAY visible to the test program
    
    ARRAY:  W       1,1,LINE1	; array[0] -- x, y, text
            W       1,10,LINE2      ; array[2] -- x, y, text
            W       1,6,LINE3       ; array[3] -- x, y, text
            W       1,2,LINE4       ; array[4] -- x, y, text
            W       0,0,0           ; array[5] -- x, y, text
    
    LINE1:  ASCII   "Abalone rod",0
    LINE2:  B       #65,#6C,0
    LINE3:  B       32,119,111,0
    LINE4:  B       8#154,0
    
            END
    

    A problem: What is the final text that this places on the screen after it finishes overwriting some of its previous output? (1.2 points)

    Suggestion: You can solve this problem by hand, first doing conversions between number bases before interpreting your numbers as ASCII characters, and then working out which characters are plotted where on the screen. You can also solve this problem by using the SMAL assembler and then linking and running the program, following the instructions for testing a solution to MP1. If you do it both ways, you will not only check your work but maximize your learning.