Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Floating Point Multiplication and Division using RISC-V Assembly Method Write RISC-V321 base integer assembly instruction code to implement a function for floating-point multiplication. Similarly, also
Floating Point Multiplication and Division
using RISC-V Assembly
Method
Write RISC-V321 base integer assembly instruction code to implement a function for floating-point multiplication. Similarly, also write assembly code to implement a function for floating-point division. Use IEEE 754 format single precision floating point representation.
You will debug and simulate your code using a simulator such as Venus, https://
www.kvakil.me/venus/ . Details on using Venus are given at https://github.com/kvakil/venus/
wiki .
Project Description
You will create a main routine which calls 2 floating point subroutines: fmult and fdiv. You will
submit a .txt file that includes all the code
demonstrate your code using the following values:
multiplicand: 8.0546875 100
multiplier: -1.79931640625 10-1
dividend: 8.625 101
division: -4.875 100
Part 1: fmult
Develop and test RISC-V assembly code to implement floating-point multiplication. Use the
floating-point multiplication algorithm given in Figure 3.16 of the reference textbook (on reserve
at the Engineering Library) as the basis for your floating point multiplication routine. Return a
32-bit product. Use the simulator for debugging and simulation. Use round to nearest even
with 1 guard bit, 1 round bit, and 1 sticky bit. You should also make sure that you normalize
properly. You do not need to handle denormals or special values other than zero.
Part 2: fdiv
Develop and test RISC-V assembly code to implement floating-point division. Use an algorithm
similar to the multiplication algorithm you use in Part 1. Return a 32-bit quotient and a 32-bit remainder. Again, use the simulator for debugging and simulation. Use round to nearest even
with 1 guard bit, 1 round bit, and 1 sticky bit. You should also make sure that you normalize
properly. You do not need to handle denormals or special values other than zero.
Part 3: fmult and fdiv integrated called from main
Write a main program using RISC-V assembly that (1) reads the test values from memory, (2)
calls fmult and stores the result in memory, and (3) calls fdiv and stores the result in memory.
You should convert the multiplicand, multiplier, dividend and divisor to IEEE single-precision
floating point format by hand and store it in a suitable memory location. Your resulting product
should be stored in memory using single-precision floating point.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started