CSE 378 - Winter 2002

Machine Organization and Assembly Language Programming

Problem Set 2: Binary representation
Due: Wednesday, January 16, 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, with results in both binary and hexadecimal.
  3. Exercise 4.2.
  4. Exercise 4.4.  Use the shortcut. Also translate the binary number into (unsigned) hexadecimal.
  5. Exercise 4.7.
  6. Exercise 4.8.
  7. Exercise 4.11.
  8. The Big Picture on page 299 mentions that bits have no inherent meaning.  Given the bit pattern:

  9. 0100 1000 0110 1001 0000 1101 0000 1010

    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.