A floating point Notation Exercise

In summary, the floating point binary notation with 16 bits can represent numbers between 1 and 2 with a minimum exponent of 4 and a maximum exponent of 5.
  • #1
hastings
80
0
Consider a floating point binary notation with 16 bits. From left to right, it consists of 1bit for the sign (0= "+"), e bits for the exponent represented in Excess[tex]~2^{e-1}[/tex] and the remaining bits for the decimal part of the mantissa, normalized between 1 and 2 ([tex]1 \leq m <2[/tex]).

a) Calculate the minimum value [tex]e_{min}[/tex] of the exponent that allows us to write in the above notation, both the numbers r= -8147.31 and
s= [tex]0.103 \cdot 10^{-6} [/tex];

This is what I would do.
1. Calculate the order of magnitude of both r and s
2. Write a proportion knowing that [tex]2^{10} \approx 10^3[/tex] (like say 10:3= x: 4, considering 4 the result of point 1. ).
3. Find x from the above proportion and find the highest power of 2 which includes x (like say x=15, [tex] 2^3 \leq 15 \leq 2^4[/tex], I'd take [tex]2^4[/tex])
4. Calculate [tex]e_{min}[/tex]: since it's in excess [tex]2^{e-1}[/tex], I solve the equation [tex]2^4=2^{e-1} \Rightarrow e=e_{min}=4+1=5[/tex], where [tex]2^4[/tex] is the result of point 3.

Is this resoning right?

Now, when I went to calculate the order of magnitude of r and s, I got that
Ord of Magn r=[tex]10^4[/tex], better say 4.
Ord of Magn s=[tex] 10^{-5}[/tex] better say -5.
Which should I consider as a starting point, [tex] 10^4 \mbox{ or } 10^{5} [/tex] ?
 
Last edited:
Computer science news on Phys.org
  • #2
hey, I really REALLY, need a help with this exercise, got an exam day after tomorrow.


got an idea: suppose I do the 1 to 4 steps for each of the numbers? In the end I see which one "includes" the other and I choose that one.

Let's do it.

Let's take r, its Order of magnitude is 4

[tex]10^4 \approx 2^{10} \Rightarrow 2^2 \leq 10 \leq \underbrace{2^3} \Rightarrow 2^3=2^{e-1} \Rightarrow e=3+1=4[/tex]

Then take s, its O of M is -5 but since at the end what we get is the number of bits, which cannot be negative, we shall consider it simply 5.
This time we need to write a proportion about exponents:
since [tex] 2^{10} \approx 10^3[/tex] and we want to find the equivalent of [tex]10^5=2^?[/tex]

[tex]10:3=x:5 \Rightarrow x=\frac{10 \cdot 5}{3} \approx 17 \Rightarrow 2^4 \leq 17 \leq \underbraces{2^5} \Rightarrow 2^5=2^{e-1} \Rightarrow e=5+1=6[/tex]

Since e=6 includes e=4, e_min =6.
So I suppose I should have taken 5 as the common order of magnitude for both the numbers in the decimal system.

Is what I just said a big bunch of nonsense?
Please reply asap!
 
Last edited:
  • #3
Don't forget the common "cheat" used by most formats, where the first bit of the mantissa is assumed to be one and not included in the bits of a floating point number. You may have covered this case since you stated the mantissa represents a number between 1 and 2. In most floating point formats, the mantissa represents a number between >0 and <1. Reserved combinations of values are used for special cases, like all zero bits for zero.

However you've got a problem, 8147.31 takes more than 16 bits to represent to the nearest 1/100th.
 
  • #4
Jeff Reid said:
However you've got a problem, 8147.31 takes more than 16 bits to represent to the nearest 1/100th.

Sorry I didn't get you.

The notation is

sign / exponent in Exc.2^{e-1} / mantissa norm. 1 & 2
1bit / e bits / (15-e) bits = Tot. 16 bits

example
suppose we find out e=6
and we want ot represent +1.0101 * 2^3 (doesn't matter what's its value)
exponent: since it's in Excess 2^(e-1), ==> 3 +(32) =35 (32 come from 2^(e-1)=2^5=32)
with 6 bits, 35 is 1 0 0 0 1 1 .
mantissa: 9 bits (=15-e=15-6) 0101 000 00

So ultimately the number in the above notation is
0 100011 010100000 (from left to right: 0 means it's positive, the following 6 bits are the exponent and the remaining 9 are the mantissa)
 
  • #5
My point is that it takes 20 bits (or at least more than 19 bits) to represent 814731 x 10^? accurately.
 

1. What is a floating point notation exercise?

A floating point notation exercise is a mathematical exercise that involves converting numbers from decimal notation to floating point notation, which is a binary representation of numbers used in computers.

2. Why is floating point notation important?

Floating point notation is important in computer science and engineering because it allows for precise representation and calculation of numbers with decimal points. It is also necessary for performing complex mathematical operations and storing large numbers.

3. How do you convert from decimal to floating point notation?

To convert a number from decimal to floating point notation, you must first convert the number to binary notation and then apply the appropriate floating point format. This involves representing the number in scientific notation with a sign bit, exponent bits, and mantissa bits.

4. What are the limitations of floating point notation?

While floating point notation allows for precise representation of numbers, it has limitations in terms of accuracy. Due to the finite number of bits used in the representation, some numbers cannot be accurately represented, leading to rounding errors. Additionally, calculations involving very large or very small numbers can also result in loss of precision.

5. How is floating point notation used in real-world applications?

Floating point notation is used in a wide range of real-world applications, including scientific computing, engineering, financial modeling, and computer graphics. It is especially useful in fields that require precise calculations, such as physics, astronomy, and statistics.

Similar threads

  • Computing and Technology
Replies
4
Views
630
Replies
4
Views
785
  • Linear and Abstract Algebra
Replies
1
Views
901
Replies
3
Views
963
  • Differential Equations
Replies
1
Views
609
  • Introductory Physics Homework Help
Replies
17
Views
278
  • Computing and Technology
2
Replies
52
Views
3K
  • High Energy, Nuclear, Particle Physics
Replies
3
Views
508
  • Introductory Physics Homework Help
Replies
5
Views
706
  • Advanced Physics Homework Help
Replies
2
Views
776
Back
Top