Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python3 problem As a junior software engineer, you are tasked to evaluate a floating point system to determine its robustness to underflow and overflow errors.
python3 problem
As a junior software engineer, you are tasked to evaluate a floating point system to determine its robustness to underflow and overflow errors. The floating point system is guarenteed to be signed and normalized, but the number of bits allocated to the significand and exponent fields are highly classified information. Specifically, the system stores a single sign bit s, a significand f that consists of n bits, and an exponent field c that consists of x bits. The unshifted exponent field c encodes a shifted exponent m using a shift b such that m=cb. Thus, the floating point system can be written as a=(1)s(1.f)2m. Further, here are some assumptions that can help with solving this problem. - the exponent shift b for this floating point system can be computed using the following formula b=2x1 - the cases where the exponent field is all 0 s or all 1s are reserved for special floating point values (such as zero or infinity) so ignore these cases when computing the lower and upper bound of the exponent range Write a function evaluate_f1_system that receives n (the number of bits in the significand), x (the number of bits in the exponent field), and f1_1st (a list of Python floats) as input and returns a list of strings that specifies whether each float in f1_1st is underflow ("underflow"), overflow ("overflow"), or neither ("neither"). Below is an example of the function usage: # inputs n=3 x=4 f1_lst = [3.9e9,1.0,3.5e] \# function call print(evaluate_fl_system(n, n,f11 lst )) \# output ["underflow", "neither", "overflow"] The setup code defines the following variable(s) and/or function(s): Your code snippet should define the following variablesStep 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