CS306 Homework 5

CS306 Processing Systems and Structures Lockwood, Spring 2002

Homework Assignment 5

Due: Wednesday, April 25, 2002, Midnight

76 Points

The answers to this homework assignment are to be submitted via the World Wide Web (WWW). You may use any Mosaic browser (such as Netscape or Internet Explorer) to submit this assignment. No special software is needed. Your answers will be graded automatically. You may resubmit this homework to improve your score. Your best score is posted immediately to the on-line gradebook.

ID Important: Use the same ID as selected in HW0
Name (First Last)


    Representing Floating Point Numbers

    Suppose that we wish to represent floating point numbers using a 1-bit sign, a 4-bit exponent with a bias of 7, and an 8-bit mantissa with an implict 1. Determine the floating point representation for each of the following numbers.
    • Round mantissas to the nearest digit if necessary
    • Use IEEE-754 notation to represent special numbers.
    • Enter all values in binary (1's and 0's)

    Number = 1.0

  1. Sign = (2 pt)
  2. Exponent = (2 pt)
  3. Mantissa = (3 pt)

    Number = -33.375

  4. Sign = (2 pt)
  5. Exponent = (2 pt)
  6. Mantissa = (3 pt)

    Number = -113.6

  7. Sign = (2 pt)
  8. Exponent = (2 pt)
  9. Mantissa = (3 pt)

    Number = 1/3

  10. Sign = (2 pt)
  11. Exponent = (2 pt)
  12. Mantissa = (3 pt)

    Number = PI: 3.14159265359

  13. Sign = (2 pt)
  14. Exponent = (3 pt)
  15. Mantissa = (3 pt)


    Multimedia Extensions (MMX)

    MultiMedia eXtensions (MMX) enable parallelism by allowing a Single Instruction to operate on Multiple Data (SIMD). Using the documentation available in the class notes, on the web, and/or the printed documents in our lab, analyze the following MMX-enabled application.

    
    Audio8Buf     dq 0102030405060708h ; Digitized stereo audio samples
    Right8Mask    dq 00FF00FF00FF00FFh
    
    Audio16Buffer dq 7A01C4E2F013A004h ; 16-bit audio samples
    Audio16Volume dq 0005000400030002h
    
    Xposition     dq 0A27527F9DC8DFF0h ; X-position of 8 different tanks
    Yposition     dq 6468507C6099306Fh ; Y-position of 8 different tanks
    
    AngleVector   dq 873C100A8545727Bh ; Angles of 8 different players
    PowerVector   dq 0563501560326435h ; Current Power level of 8 players
    MaxPower      dq 6450631524486035h ; Maximum allowed power for all 8 players.
    
    BestClass     dq AABBCCDD00030006h
    
    
     Rst0  dq 0     ; The results you need to determine !
     Rst1  dq 0
     Rst2  dq 0
     Rst3  dq 0
     Rst4  dq 0
     Rst5  dq 0
     Rst6  dq 0
     Rst7  dq 0
     Rst8  dq 0
     Rst9  dq 0
    
    
    ; --- DSP Operations ---
    
         MOVQ     mm0, [Audio8Buf]
         MOVQ     mm1, [Right8Mask]
         PAND     mm0, mm1
         MOVQ     [Rst0], mm0
    
         MOVQ     mm2, [Audio16Buffer]
         PSLLW    [mm2], 3
         MOVQ     [Rst1], mm2
    
    ; --- Arithmetic Operations ---
    
         MOVQ     mm1, [Xposition]
         MOVQ     mm2, [Yposition]
         MOVQ     mm3, mm2
         MOVQ     mm4, mm2
         PADDB    mm2, mm1
         MOVQ     [Rst2], mm2
    
         PADDUSB  mm3, mm1
         MOVQ     [Rst3], mm3
    
         PADDSB   mm4, mm1
         MOVQ     [Rst4], mm4
    
    ; --- SIMD Logical Operations ---
    
         PSRAW    mm1, 2
         MOVQ     [Rst5], mm1
    
    ; --- Multimedia Operations ---
    
         MOVQ     mm0, [Audio16Buffer]
         PMULLW   mm0, [Audio16Volume]
         MOVQ     [Rst6], mm0
    
    ; -- Real-time algorithmic calculations --
    
         MOVQ     mm7, [PowerVector]
         PCMPGTB  mm7, [MaxPower]
         MOVQ     [Rst7], mm7
    
    ; --- Pack/Unpack Operations ---
    
         MOVQ mm1, [BestClass]
         MOVQ mm2, [BestClass]
         MOVQ mm4, mm1
         PXOR mm3, mm3
         PUNPCKHBW mm1,mm3
         MOVQ [Rst8],mm1
    
         PUNPCKLBW mm3,mm2
         MOVQ [Rst9],mm3
    

    Enter all values as 16-digit hex numbers

  16. R0 = (4 pts)
  17. R1 = (4 pts)
  18. R2 = (4 pts)
  19. R3 = (4 pts)
  20. R4 = (4 pts)
  21. R5 = (4 pts)
  22. R6 = (4 pts)
  23. R7 = (4 pts)
  24. R8 = (4 pts)
  25. R9 = (4 pts)


Once you have completed this homework assignment, press: