Normalisation Function Write a function Float24_t float24_normalise(int32_t oversizeMantissa, int8_t exponent) that is a bit like the float24_init() except that it allows the oversizeMatissa to be much bigger than what is normally allowed for a Float24_t. The function makes the matissa "fit" by scaling the 32-bit oversizeMantissa down to a 16-bit integer (only if necessary) and correspondingly changing the exponent value. For example if dividing the oversizeMantissa by 4 yielded a number whose magnitude could be represented by a int16_t for the mantissa then we would need to add '2' to the exponent (scale factor) of the number. Clearly this dividing down leads to a loss of precision. Note: 1. The maximum value expressible by an int16_t is defined in limits.h as INT16_MAX. All "write a function" questions in this assignment will include this for you. 2. The minimum value, after normalisation, of the mantissa is -INT16_MAX. ie. values must lie in the range + INT16_MAX While there are potentially many solutions (that is, many scalings that would yield an acceptable 16-bit mantissa) there is only one solution that maximises the precision when normalising. If the mantissa is oversize, you should end up with the highest precision mantissa possible. You will need to include the two functions you wrote in the previous question. Normalisation is a process we often need to perform after other arithmetic operations, where the intermediate results of the operation are performed at a higher precision. For example: Test Float24_t result = float24_normalise (1,0); float24_print (result); Result 1 * 20 Float24_t result = float24_normalise(123456,0); 30864 * 2^2 float24_print (result);

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Normalisation Function
Write a function
Float24_t float24_normalise (int32_t oversizeMantissa, int8_t exponent)
that is a bit like the float24_init() except that it allows the oversizeMatissa to be much bigger than what is normally allowed for a Float24_t. The function makes the matissa "fit" by scaling the 32-bit
oversizeMantissa down to a 16-bit integer (only if necessary) and correspondingly changing the exponent value. For example if dividing the oversizeMantissa by 4 yielded a number whose magnitude could be
represented by a int16_t for the mantissa then we would need to add '2' to the exponent (scale factor) of the number. Clearly this dividing down leads to a loss of precision.
Note:
1. The maximum value expressible by an int16_t is defined in limits.h as INT16_MAX. All "write a function" questions in this assignment will include this for you.
2. The minimum value, after normalisation, of the mantissa is -INT16_MAX. ie. values must lie in the range +INT16_MAX
While there are potentially many solutions (that is, many scalings that would yield an acceptable 16-bit mantissa) there is only one solution that maximises the precision when normalising. If the mantissa is
oversize, you should end up with the highest precision mantissa possible.
You will need to include the two functions you wrote in the previous question.
Normalisation is a process we often need to perform after other arithmetic operations, where the intermediate results of the operation are performed at a higher precision.
For example:
Test
Float24_t result = float24_normalise (1,0);
float24_print (result);
Result
1 * 2 ^ 0
Float24_t result = float24_normalise (123456,0); 30864 * 2^ 2
float24_print (result);
Transcribed Image Text:Normalisation Function Write a function Float24_t float24_normalise (int32_t oversizeMantissa, int8_t exponent) that is a bit like the float24_init() except that it allows the oversizeMatissa to be much bigger than what is normally allowed for a Float24_t. The function makes the matissa "fit" by scaling the 32-bit oversizeMantissa down to a 16-bit integer (only if necessary) and correspondingly changing the exponent value. For example if dividing the oversizeMantissa by 4 yielded a number whose magnitude could be represented by a int16_t for the mantissa then we would need to add '2' to the exponent (scale factor) of the number. Clearly this dividing down leads to a loss of precision. Note: 1. The maximum value expressible by an int16_t is defined in limits.h as INT16_MAX. All "write a function" questions in this assignment will include this for you. 2. The minimum value, after normalisation, of the mantissa is -INT16_MAX. ie. values must lie in the range +INT16_MAX While there are potentially many solutions (that is, many scalings that would yield an acceptable 16-bit mantissa) there is only one solution that maximises the precision when normalising. If the mantissa is oversize, you should end up with the highest precision mantissa possible. You will need to include the two functions you wrote in the previous question. Normalisation is a process we often need to perform after other arithmetic operations, where the intermediate results of the operation are performed at a higher precision. For example: Test Float24_t result = float24_normalise (1,0); float24_print (result); Result 1 * 2 ^ 0 Float24_t result = float24_normalise (123456,0); 30864 * 2^ 2 float24_print (result);
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY