Question: please write it in assembly language Write assembly language programs to perform each of the following floating-point operations on two input floating point numbers A


Write assembly language programs to perform each of the following floating-point operations on two input floating point numbers A and B: 1. Compute C=A+B and produce a normalized floating point result C 2. Compute D=AB and produce a normalized floating point result D (notice that in order to be able to perform this operation, you need to implement a subroutine that performs multiplication of two unsigned integers) You can make the following assumptions: 1. The mantissa's are unsigned (i.e., no negative values) 2. A and B are non-zero values and A is greater than B 3. The mantissa of input values A and B require no more than 8-bits (i.e., they are smaller than 256. Therefore, their multiplication will not result in a value that requires more than 16 bits. 4. No overflow or underflow could occur. Therefore, you can ignore checking for these. Add Algorithm 1. Align the binary point of the two values by shifting the mantissa of the smaller value (i.e. B) right by a number of positions equal to the difference between exponents. With this you can imagine that both values have the same exponents and therefore, the locations of their binary points are aligned. Make sure that for the first position shift, you should shift in a "1" value (the implicit most significant bit). 2. Compute the result a. The result mantissa of the result is the addition of both mantissa's b. The result exponent is the common exponent after aligning the binary point, which is the exponent of A. 3. Normalize the result by shifting the result right by one position (if needed) and adjusting (incrementing) the exponent. Notice that considering the above assumptions, you only need to do shift the result by a maximum of one position if there is a carry when you add the mantissa's. Assume floating-point (non-standard) representation of numbers as follows: Each number is represented by two consecutive 16-bit words The first word represents the exponent (using 2's representation). The second word represents an unsigned mantissa The floating point numbers are represented using our special normalized form (0.1xxx...), by which, o If the floating-point number is not zero, the most significant bit of the mantissa is 1 and the binary point is placed right before this leftmost bit. o If the floating-point number is zero, both the mantissa and the exponent fields should have a zero value. Notice that the above floating-point representation is not a standard one. Therefore, it may not be the most effective one in terms of utilizing the available bits to achieve optimal accuracy and range of values). It is specifically designed to simplify your project implementation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
