CSE 378 - Autumn 2002

Machine Organization and Assembly Language Programming

Problem Set 2: Binary representation
Due: Wednesday, October 9, at the start of class

This assignment is based on Chapter 4.1 to 4.4. Its purpose is to enable you to become comfortable with manipulating different binary representations and to be able to convert values between them. There is also a problem taken from Chapter 1 that will simply verify that you know some basic terminology.

Do the following problems.

  1. Exercises 1.1 through 1.26, inclusive.
  2. Exercise 4.1, substituting 61680 (for 512), with results in both binary and hexadecimal.
  3. Exercise 4.2, substituting -43691 (for -1023).
  4. Exercise 4.4, substituting 0000 0000 0000 0000 1010 1011 1100 1101.
    Use the shortcut. Also translate the binary number into (unsigned) hexadecimal.
  5. Exercise 4.7, substituting 0f5a5af0.
  6. Exercise 4.8, substituting 0001 1100 0000 1111 1111 1110 1110 0001.
  7. Exercise 4.11.
  8. The Big Picture on page 299 mentions that bits have no inherent meaning.  Given the bit pattern:

  9. 0100 0001 0011 1100 0011 1101 0100 0010

    What does it represent, assuming it is:
    a. A 32-bit two's complement integer?  (Specify the result in decimal.)
    b. A 32-bit unsigned integer?  (Specify the result in decimal.)
    c. Four consecutive, 8-bit ASCII values?   Use the ASCII table on p. 142 for the standard character values.  Also note the following special codes which do not appear in the table:

     
    ASCII  0 =  NUL  (C string null terminator)
    ASCII 8 = BS (Backspace)    
    ASCII 9 = TAB ASCII 10 = LF (Line Feed)   
    ASCII 13 = CR (Carriage Return)
  10. Assume a 4-bit register and a 2's complement representation of integers.  Give examples of adding two positive numbers with and without overflow, and of subtracting a negative number from a positive number with and without overflow.  Show the 2's complement representation of the operands and the result in a manner similar to what is done in the book, pp. 220-221.