CSCI 370 Computer Architecture: Homework 2 Solutions

Due date: On or before Monday, March 25, 2024
Absolutely no copying others’ works
Name: _____Professor Hu_____

  1. (Sequential/first-version multiplication: 50%) Using a table similar to that shown in the Slide 8.5, calculate the product of the octal unsigned 6-bit integers 738 (or 1110112) and 358 (or 0111012) using the hardware and algorithm described in the figures of Slide 8.5. You should show the contents of each register on each step.
    Ans>

      This question is to simulate the computer hardware, so

      • each number is either 12 or 6 bits, and
      • has to complete the 6 steps.

    Iteration Multiplicand Multiplier Product
    0 Initialize 000000 111011 011101    000000 000000
    1 Multiplier[0]=1ADD        000000 000000
    + 000000 111011
       000000 111011
    SHL Multiplicand and SHR Multiplier 000001 110110 001110  
    2 Multiplier[0]=0 ⇒ Do nothing.        000000 111011
    SHL Multiplicand and SHR Multiplier 000011 101100 000111  
    3 Multiplier[0]=1ADD        000000 111011
    + 000011 101100
       000100 100111
    SHL Multiplicand and SHR Multiplier 000111 011000 000011  
    4 Multiplier[0]=1ADD        000100 100111
    + 000111 011000
       001011 111111
    SHL Multiplicand and SHR Multiplier 001110 110000 000001  
    5 Multiplier[0]=1ADD        001011 111111
    + 001110 110000
       011010 101111
    SHL Multiplicand and SHR Multiplier 011101 100000 000000  
    6 Multiplier[0]=0 ⇒ Do nothing.        011010 101111
    SHL Multiplicand and SHR Multiplier 111011 000000 000000  


  2. (Refined division: 50%) Using a table similar to that shown in the Slide 8.11, calculate the octal unsigned 6-bit integer 758 (or 1111012) divided by another octal unsigned 6-bit integer 138 (or 0010112) using the hardware and algorithm described in the figures of Slide 8.11. You should show the contents of each register on each step.
    Note that you have to actually show the differences in the procedures, not just the signs.
    Ans>

    Iteration Remainder Quotient Divisor Difference
    0 Initialize 000000 111101 001011  
    1 Shift left; Difference 000001 111010 001011    000001
     – 001011
            110110 < 0
    Difference < 0 Do nothing.        
    2 Shift left; Difference 000011 110100 001011    000011
     – 001011
            111000 < 0
    Difference < 0 Do nothing.        
    3 Shift left; Difference 000111 101000 001011    000111
     – 001011
            111100 < 0
    Difference < 0 Do nothing.        
    4 Shift left; Difference 001111 010000 001011    001111
     – 001011
            000100 ≥ 0
    Rem = Diff; Set lsb of quotient. 000100 010001    
    5 Shift left; Difference 001000 100010 001011    001000
     – 001011
            111101 < 0
    Difference < 0 Do nothing.        
    6 Shift left; Difference 010001 000100 001011    010001
     – 001011
            000110 ≥ 0
    Rem = Diff; Set lsb of quotient. 000110 000101