Search code examples
alu

Can't understand Mips, ALU, Clock Cycle Related Solution


I am reviewing test that I got on midterm before, but the provided solution doesn't explain for question below... Here is question:

Question 11. Assume that the multiplier hardware on your MIPS processor is set up like the multiplier discussed last week. It takes one clock cycle to initialize the ALU, product register and all other necessary hardware. It takes 3 clock cycles to get through each stage (one sequence of shift, test, add, etc. is considered a stage) of the multiplication. If the clock has a period of 1 nanosecond (ns), how long does it take to multiply two eight-bit numbers into a 16-bit product register? The register for the multiplicand is 8-bits wide.

a) 50 ns b) 49 ns c) 27 ns d) 25 ns e) 9 ns f) None of the above.

It says the answer is d (25ns). It says only answer but not explanation

Can you explain me why is that?

I just don't know what I need to calculate, or study, to obtain such answer.

Thank you very much..


Solution

  • My guess would be that to multiply by an 8-bit number you need to perform shift-test-add 8 times, once per each bit. That's 8*3 clocks. One more for initialization. 25 clocks or 25 ns total. Is this too hard?

    P.S. MIPS doesn't have 8-bit or 16-bit general-purpose registers. They are at least 32-bit.