Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3.2 Part A: Write a callable/returning MIPS subroutine called HDE (x,y) You are tasked to write a callable/returning MIPS subroutine called HDE (x) which accepts
3.2 Part A: Write a callable/returning MIPS subroutine called HDE (x,y) You are tasked to write a callable/returning MIPS subroutine called HDE (x) which accepts a positive float x as the input parameter. It returns a float value equal to the Half Debiased Estimate for the square root Namely, HDE(x)=(De-biased Exponent of the floating point representation of x)/2 Here recall the IEEE754 stores values with Excess-127 bias format. So the above refers to the value stored in the Exponent field with the bias removed, and then divided by two For example, HDE (125348ten) - 8ten since 125348ten - 0100 0111 1111 0100 1101 0010 0000 0000 spfpbf where spfpbf denotes single-precision floating-point binary format. Thus, the biased exponent is 10001111two -143ten thus 143-127-16 (since spfpbf uses Excess-127 format for the Exponent field) thus 16/2-8ten However, the value returned by HDE must be a float, thus to complete part A of the project, it is necessary for you to write MIPS code to convert the value above, in this case 8ten, into single- precision floating-point binary format. You can achieve this readily by noting that intermally in MIPS the values are represented in fixed-point binary rather than decimal, unless specified to be float. Thus, you will need to develop a routine to convert 0000 0000 0000 0000 0000 0000 0000 1000 two nto 0100 0001 0000 0000 0000 0000 0000 0000 spfpbf which is the value returned for HDE (125348) A hint on this is to use a shift followed by mask to normalize the mantissa, then create the exponent using the cumulative shift amount without the hidden 1. All values used here will be positive Finally, since HDE (x) must be implemented as a subroutine function using jal/jr then all non- temporary registers used must be saved on to the stack upon entry to the HDE subroutine and restored prior to exit of the HDE subroutine For reference of the above steps to compute HDE (x,n), the below provides a concise mathematical description found conveniently at Wikipedia for estimating the square root of S) using an identical procedure When working in the binary numeral system (as computers do internally), by expressing S as n can be estimated as 2 Note during testing, it may be convenient to output your result to the console using print float service code of syscall -- however please remove this debug ging-aid output before beginning Part B 3.2 Part A: Write a callable/returning MIPS subroutine called HDE (x,y) You are tasked to write a callable/returning MIPS subroutine called HDE (x) which accepts a positive float x as the input parameter. It returns a float value equal to the Half Debiased Estimate for the square root Namely, HDE(x)=(De-biased Exponent of the floating point representation of x)/2 Here recall the IEEE754 stores values with Excess-127 bias format. So the above refers to the value stored in the Exponent field with the bias removed, and then divided by two For example, HDE (125348ten) - 8ten since 125348ten - 0100 0111 1111 0100 1101 0010 0000 0000 spfpbf where spfpbf denotes single-precision floating-point binary format. Thus, the biased exponent is 10001111two -143ten thus 143-127-16 (since spfpbf uses Excess-127 format for the Exponent field) thus 16/2-8ten However, the value returned by HDE must be a float, thus to complete part A of the project, it is necessary for you to write MIPS code to convert the value above, in this case 8ten, into single- precision floating-point binary format. You can achieve this readily by noting that intermally in MIPS the values are represented in fixed-point binary rather than decimal, unless specified to be float. Thus, you will need to develop a routine to convert 0000 0000 0000 0000 0000 0000 0000 1000 two nto 0100 0001 0000 0000 0000 0000 0000 0000 spfpbf which is the value returned for HDE (125348) A hint on this is to use a shift followed by mask to normalize the mantissa, then create the exponent using the cumulative shift amount without the hidden 1. All values used here will be positive Finally, since HDE (x) must be implemented as a subroutine function using jal/jr then all non- temporary registers used must be saved on to the stack upon entry to the HDE subroutine and restored prior to exit of the HDE subroutine For reference of the above steps to compute HDE (x,n), the below provides a concise mathematical description found conveniently at Wikipedia for estimating the square root of S) using an identical procedure When working in the binary numeral system (as computers do internally), by expressing S as n can be estimated as 2 Note during testing, it may be convenient to output your result to the console using print float service code of syscall -- however please remove this debug ging-aid output before beginning Part B
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