CMSI 284
Homework #1

Do all these problems without the aid of a computer. The purpose of doing these exercises is to develop useful skills so you can ace the midterm and final and impress your friends. Submit all answers in hard copy, on these assignment sheets only. Use pen or pencil. By the way, all integer encodings use two's complement.

  1. Assuming a 16-bit storage word complete the following table:
    Unsigned Decimal Signed Decimal Hexadecimal Binary
     -30228  
      DE78 
      0111 
       1101001100001000
      8000 
    65518   
    64   
     -500  
     -2  
       0011101011100000
      9826 
  2. Assume 16-bit signed words x=8000, y=D00D, z=8008, w=4444. Compute:
      -x = ____________
    
      -y = ____________
    
      -z = ____________
    
      -w = ____________
     
  3. Do the following 16-bit sums, assuming SIGNED arithmetic, for both saturated and modular addition. Indicate for each whether the modular arithmetic produced a carry and/or an overflow.
      Sum — Saturated Sum — Modular Carry
    (y/n)
    Overflow
    (y/n)
    3517 + 4EFC    
    6159 + F702    
    B0B0 + FACE    
    A249 + 9AAA    
    8507 + 12E2    
    72E5 + 0026    
    8000 + 8000    
  4. Express in kibibytes
      65000 bytes = _______________
    
      262144 bytes = _______________
    
      217 bytes = _______________
    
      225 bytes = _______________
    
      768 bytes = _______________
    
  5. Assuming IEEE 754 single precision complete the following table. Express decimal values as accurately as you can. If it is necessary to use scientfic notation, do so with powers of 2.

    Comment Hex Decimal
    largest finite positive  
    smallest nonzero positive  
    largest nonzero negative  
    smallest finite negative –(2–2–23) × 2127
    00000000 
    A0000000 
    C5410000 
    FF000000 
     2–145
     –96.625 × 290
     16777216
    FF800000 
     positive infinity
  6. Encode the following characters. Show all answers in hexadecimal big-endian. If a character cannot be encoded under a particular encoding scheme, write "N/A" in the corresponding cell.

    Character UTF-32 UTF-16 UTF-8 ISO-
    8859-1
    windows-
    1252
    ARABIC PERCENT SIGN     
    LEFT CURLY BRACKET     
    TETRAGRAM FOR EXHAUSTION     
    TETRAGRAM FOR FAILURE     
    LATIN CAPITAL LETTER Z WITH CARON     
    CANCEL TAG     
    MUSICAL SYMBOL PODATUS     
    MONGOLIAN COMMA     
    SINGLE SHIFT TWO     
    END OF SELECTED AREA     
    HANGUL LETTER YEORINHIEUH     
    COFFIN