Homework 1
Numbering Systems and Data Types

Due: (in class) Tuesday, November 2 at 9am

Outcomes

After successfully completing this assignment, you will be able to...

Before Starting

Read Chapters 1 and 2 (Patt).

Format and Submission of Assignment

The solution for this assignment must be submitted as hard-copy at the beginning of class (9am) on the due date. All papers must be stapled together, and your name and login name must appear at the top of every sheet. Handwriting must be legible - if we can't read it, the grade is zero (you may use a word processor or an editor to write your solution if you wish; please turn in a printed copy).

Show your work for each problem, and/or explain the steps you are taking to arrive at the answer. Put a circle around your answer. If you just give the answer to a problem, without explaining or showing the steps in obtaining the answer, that problem will be marked incorrect.

Problems (each problem is worth 10 points)

  1. Perform the following conversions on unsigned numbers.

  2. In the base 6 numbering system there are 6 digits: 0, 1, 2, 3, 4, 5. Perform the following conversions on unsigned numbers. SHOW YOUR WORK.

  3. Perform the following conversions. Assume 16-bit words. SHOW YOUR WORK.

  4. An 8-bit word contains the bit pattern 1101 0111. What decimal number does this represent if the word is

  5. To convert a floating point number from decimal to binary, the integer and fractional parts must be considered separately. In class, we saw how to convert the integer portion by doing repeated divisions by 2. The fractional part involves repeated multiplications by 2. At each step, the fractional part of the decimal number is multiplied by 2. The digit to the left of the decimal point in the product will be 0 or 1 and contributes to the binary representation of the fraction, starting with the most significant bit. The fractional part of the product is used as the multiplicand in the next step. Continue until the product contains a fractional part equal to 0, for exact representations.
       EXAMPLE:  Convert 4.625 decimal to binary
    
                 Integer portion:  4 decimal = 100 binary
    
                 Fractional portion:
                                   0.625 x 2 = 1.25   ==>      .1
                                   0.25  x 2 = 0.5    ==>       0
                                   0.5   x 2 = 1.0    ==>       1
                                   fractional portion of product is zero, so stop
    
                 4.625 decimal = 100.101 binary
    
    Note, however, that the process will not necessarily yield an exact representation. Just as some fractions cannot be represented exactly in the decimal numbering system (e.g. 1/3), neither can some fractions be represented exactly in the binary numbering system (e.g. 1/10). In cases that do not yield an exact result, continue until you find a repeating fraction, or for twenty-three binary places, whichever comes first.

  6. Compute the sum of the following IEEE single-precision floating point numbers and express the result as a hexadecimal number. The numbers to be added are given in hexadecimal: 41280000, 40700000. Do not convert the numbers to decimal first; rather, do all the arithmetic in binary. (Hint: the exponents must be the same when you add two numbers in floating point format, same as you would do if you added two numbers that were specified using scientific notation).

  7. Perform the following additions on 16-bit hexadecimal values (the numbers are 2's complement numbers). Provide your answers as 16-bit hexadecimal values.