CSCI 370 Computer Architecture: Homework 2 Solutions

Due date: On or before Wednesday, April 01, 2026
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 538 (or 1010112) and 758 (or 1111012) 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 101011 111101    000000 000000
    1 Multiplier[0]=1ADD        000000 000000
    + 000000 101011
       000000 101011
    SHL Multiplicand and SHR Multiplier 000001 010110 011110  
    2 Multiplier[0]=0 ⇒ Do nothing.        000000 101011
    SHL Multiplicand and SHR Multiplier 000010 101100 001111  
    3 Multiplier[0]=1ADD        000000 101011
    + 000010 101100
       000011 010111
    SHL Multiplicand and SHR Multiplier 000101 011000 000111  
    4 Multiplier[0]=1ADD        000011 010111
    + 000101 011000
       001000 101111
    SHL Multiplicand and SHR Multiplier 001010 110000 000011  
    5 Multiplier[0]=1ADD        001000 101111
    + 001010 110000
       010011 011111
    SHL Multiplicand and SHR Multiplier 010101 100000 000001  
    6 Multiplier[0]=1ADD        010011 011111
    + 010101 100000
       101000 111111
    SHL Multiplicand and SHR Multiplier 101011 000000 000000  

    You may double-check the answer as follows:

    538×758 = 1010112×1111012 = 43×61 = 2623 = 101000 1111112

  2. (Refined division: 50%) Using a table similar to that shown in the Slide 8.11, calculate the octal unsigned 6-bit integer 738 (or 1110112) divided by another octal unsigned 6-bit integer 118 (or 0010012) 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 111011 001001  
    1 Shift left; Difference 000001 110110 001001    000001
     – 001001
     ⇓
       000001
     + 110111
            111000 < 0
    Difference < 0 Do nothing.        
    2 Shift left; Difference 000011 101100 001001    000011
     – 001001
     ⇓
       000011
     + 110111
            111010 < 0
    Difference < 0 Do nothing.        
    3 Shift left; Difference 000111 011000 001001    000111
     – 001001
     ⇓
       000111
     + 110111
            111110 < 0
    Difference < 0 Do nothing.        
    4 Shift left; Difference 001110 110000 001001    001110
     – 001001
     ⇓
       001110
     + 110111
          1 000101 ≥ 0
    Rem = Diff; Set lsb of quotient. 000101 110001    
    5 Shift left; Difference 001011 100010 001001    001011
     – 001001
     ⇓
       001011
     + 110111
         1 000010 ≥ 0
    Rem = Diff; Set lsb of quotient. 000010 100011    
    6 Shift left; Difference 000101 000110 001001    000101
     – 001001
     ⇓
       000101
     + 110111
            111100 < 0
    Difference < 0 Do nothing.        

    You may double-check the answer as follows:

    738÷118 = 1110112÷0010012 = 59÷9 ⇒ Q: 6 = 0001102 and R: 5 = 0001012