MHB What is the Range of Integers and Real Numbers in a 10-bit Float Type?

  • Thread starter Thread starter shamieh
  • Start date Start date
  • Tags Tags
    Float
AI Thread Summary
The discussion revolves around a question regarding a computer's 10-bit representation for integers and real numbers. The first part of the question, concerning the range of integers, was resolved by determining that the smallest 10-bit binary number is -512 and the largest is 511, leading to a range of -512 to 511. The second part, which addresses the range of real numbers, proved more complex. The participant initially attempted to convert binary to decimal but faced uncertainty about the validity of the conversion with a 10-bit float. Another contributor clarified that the mantissa can range from 1/16 to 15/16, while the exponent ranges from -16 to +15. Consequently, the overall range for the floating-point number is from -15/16 × 2^15 to +15/16 × 2^15, with the smallest positive number being 1/16 × 2^(-16).
shamieh
Messages
538
Reaction score
0
Hello all, (wasn't quite sure where to post this)

I'm stumped on a question my teacher is asking me...I'm not sure if it's even possible. Maybe someone can point me in the right direction?

Question: A computer uses 10 bits to store integers with 1 bit for a sign. It stores an approximation of real numbers in 10 bits. The first bit of the first five is the sign of the mantissa and the other four bits are the mantissa. The first bit of the second five is the sign of the exponent and the other four the exponent.
1)What is the range of integers?
2)what is the range of real numbers(Float Type)

The first question was simple. I just found the smallest 10 digit binary number 1000000000 = -512 and then found the largest 10 digit binary number which would have to be 0111111111 = 511, therefore the range of integers is from -512 to 511.

For the second question - I am either making this harder than it is, or it really is a challenging question. So I followed the steps and first I was thinking I would take the number 1000000000 and convert this to a decimal (assuming its a 10 bit float)...But, can you even do this with a 10 bit float??

I ended up getting 1000000000 (after denormalizing) = .000100000 = 0.625.. would that be the minimum range? If so, then I know what I need to do to find the maximum , but if not - then I am really lost.

My Process was:
1.00000 X 2^(-4) = my final result of 0.625 after converting.

Thanks in advance
 
Technology news on Phys.org
shamieh said:
Hello all, (wasn't quite sure where to post this)

I'm stumped on a question my teacher is asking me...I'm not sure if it's even possible. Maybe someone can point me in the right direction?

Question: A computer uses 10 bits to store integers with 1 bit for a sign. It stores an approximation of real numbers in 10 bits. The first bit of the first five is the sign of the mantissa and the other four bits are the mantissa. The first bit of the second five is the sign of the exponent and the other four the exponent.
1)What is the range of integers?
2)what is the range of real numbers(Float Type)

The first question was simple. I just found the smallest 10 digit binary number 1000000000 = -512 and then found the largest 10 digit binary number which would have to be 0111111111 = 511, therefore the range of integers is from -512 to 511.

For the second question - I am either making this harder than it is, or it really is a challenging question. So I followed the steps and first I was thinking I would take the number 1000000000 and convert this to a decimal (assuming its a 10 bit float)...But, can you even do this with a 10 bit float??

I ended up getting 1000000000 (after denormalizing) = .000100000 = 0.625.. would that be the minimum range? If so, then I know what I need to do to find the maximum , but if not - then I am really lost.

My Process was:
1.00000 X 2^(-4) = my final result of 0.625 after converting.

Thanks in advance

Hi shamieh,

The mantissa can take values up to .1111 (positive), which is 15/16.
The smallest positive mantissa is .0001, which is 1/16.

The range of the exponent is 10000 to 01111, which is -16 to +15.

This means that the range of the floating point number is:
$$-\frac{15}{16} \times 2^{15} \quad \text{ to } \quad +\frac{15}{16} \times 2^{15}$$

Additionally, the smallest positive number is:
$$\frac{1}{16} \times 2^{-16}$$
 
Thank you so much.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top