Assignment 2, due Sept 7

Part of the homework for 22C:60, Fall 2007
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!

  1. Background: Here is a fragment of a SMAL assembly language program that defines a sequence of bytes in memory:
    	B	109
    	B	8#145
    	B	#6D
    	B	111
    	B	8#162
    	B	#79
    	B	32
    	B	8#142
    	B	'y'
    	B	116
    	B	8#145
    	B	#73
    

    Problems: Give equivalent expressions of this string in SMAL notation using only:

    a) a single ASCII directive. (1/2 point)
    b) B directives with all operands in hexadecimal. (1/2 point)
    b) B directives with all operands in decimal. (1/2 point)

  2. Background: Consider the 8-bit values represented in hexadecimal as 6D, DB and B6.

    a) Give the signed decimal interpretation of these as 8-bit two's complement numbers. (1/2 point)

    b) Give the two's complement of each of the original 8-bit numbers in hexadecimal. (1/2 point)

    c) Give the signed decimal interpretation of the original 8-bit numbers as biased numbers with a bias of 128. (1/2 point)