Problem 1 (8 marks)
Part A. (4 marks) Suppose A = C5 and B = 6D (both in hexadecimal). Show the step-by-step result of multiplying A and B using Booth's algorithm. Assume A and B are 8-bit two's complement integers, stored in hexadecimal format.
Part B. (2 marks) Describe in one paragraph, in your own words, why Booth's algorithm works. Also, what does the mythical bit in Booth's algorithm stand for? Sketch/justify why it is needed and why it works.
Part C. (2 marks) What is the RISC-V instruction that gives the upper 64 bits of the above multiplication of signed integers? What is the RISC-V instruction that gives the lower 64 bits of the above multiplication? Name one register where you will be placing the result and fill in all 32-bit positions for this instruction (write it both in assembly and in machine language).
Solution: