Question: Consider that floating - point numbers are represented in a 1 6 bit format as shown below. where - The scale factor ( exponent )

Consider that floating-point numbers are represented in a 16 bit format as shown below.
where
- The scale factor (exponent) is an implied base of 2 and a 7-bit, excess 63 exponent, with the two end values of 0 and 127 use to signify exact 0 and infinity, respectively.
- The 8-bit mantissa is normalized, with an implied 1 to the left of the binary point.
- The sign bit is 1 bit.
Answer the following questions
- Represent the numbers 2.125 and -1.012 in this format.
- Describe two steps to add floating point numbers 0.0125 and 20.0.
- The following are three solutions to add \(0.01,0.02,0.03,\ldots,1.00\), in total 100 floating point numbers with increment 0.01. Consider how we add two floating point numbers and explain which one would yield most accurate result and what the main problems are with the other two.
Listing 1: snippet 1
```
double sum =0.0;
for (double f=0.0;f=1.0;f+=0.01){
sum += f;
}
```
Listing 2: snippet 2
```
double sum =0.0;
for (int i=1; i=100; i++){
sum +=0.01* ; ;
}
```
Listing 3: snippet 3
```
double sum =0.0;
for (int i =100; i>=1; i --){
sum +=0.01* i;
}
```
Consider that floating - point numbers are

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!