marajovic126
New member
- Joined
- Nov 5, 2012
- Messages
- 9
1
Last edited:
Let's go to basics.A friend of mine told me i have to do the following:
Since we have only one bit for the exponent, but allow it to be positive or negative, whatever number is given by the mantissa is multiplied by= 1,
or
. With 5 bits for the mantissa, the largest that can be is
. Huh? What happened to 21? Since that can be multiplied by 2, the largest number that can be represented in that way is 2(63)= 126 and, of course, 127 will cause overflow. The smallest non-zero mantissa is, of course, 00001= 1. Since it can be multiplied by 1/2, the smallest positive number that can be represented in that way is 1/2. There are
different mantisas of which 31 are non-zero. Those, combined with the three possible mantissas, You mean exponents (gives 3(31)= 93 different positive numbers. Only if there is no overlap in the numbers Adding the 93 different negative number, and, of course, 0, there are 187 different numbers representable in this way.![]()
Is this correct?
One thing i don't understand, if this is correct is how the largest mantissa is 63, 11111 = 31 not 63! (11111, of course in base 2)
Thanks
Could anyone show me how to do this question, im really stuck!
You really are making this infinitely more difficult than it needs to be. A bit can be in two states, 0 and 1. So how many numbers can it represent? If the implied binary point precedes the first digit of the normalized mantissa, then it representsI'm guessing that i need to use the formula, number = [0.(x_1)*(x_2)*(x_2)*....]*2^e, where e is the exponent and x_1*x_2*.... is the mantissa.
Now for the first question you asked i get; number = +[0.(x_1)*(x_2)*(x_2)*....]*2^0, but what would i replace 0.(x_1)*(x_2)*(x_2)*.... by? Could you show me how to do the first question you asked, so that i can apply it to the rest. Were looking at 1 bit at the first stage so i was thinking of the combinations 0.00001, 0.00010, 0.00100, 0.01000, 0.10000 for the mantissa section.
Also, im not really sure how to evaluate [0.(x_1)*(x_2)*(x_2)*....]*2^e once we have 0.(x_1)*(x_2)*(x_2)*....?
thanks
You really are making this infinitely more difficult than it needs to be. A bit can be in two states, 0 and 1. So how many numbers can it represent? If the implied binary point precedes the first digit of the normalized mantissa, then it represents
\(\displaystyle 0.0_2 = \left(\dfrac{0}{2}\right)_{10}\ and\ 0.1_2 = \left(\dfrac{1}{2}\right)_{10}.\) 21 = 2 possible numbers, largest (2 - 1)/2.
Two bits can be in four states: 00, 01, 10, 11.
\(\displaystyle 0.00_2 = \left(\dfrac{0}{4}\right)_{10}\ and\ 0.01_{2} = \left(\dfrac{1}{4}\right)_{10}\ and\ 0.10_2 = \left(\dfrac{2}{4}\right)_{10}\ and\ 0.11_2 = \left(\dfrac{3}{4}\right)_{10}.\)
22 = 4 possible numbers, largest (4 - 1)/4.
Figure out what a five bit normalized mantissa could represent before worrying about sign bits or exponent bits or sign of exponent bits. Formulas are handy when you understand what you are doing, but they are dangerous if you use them mechanically.
Once you understand what the possible values of the mantissa are you will will be in a position to think about what happens with various exponents and various signs. Make sense?
I am sure that this problem can be worked out exclusively in terms of formal mathematical reasoning. I am equally sure that the results can be summarized in purely mathematical formulas that could be memorized. But, as I said before, using formulas without understanding them is dangerous. In any case, I stopped working on computers (as opposed to working with computers) in 1970 and so remember no formulas at all. Moreover, it appears that this problem has been very carefully designed to let you physically see what is going on so that you intuitively understand whatever formulas you are being taught.So for 5 bits we can have \(\displaystyle 2^5 = 32\) possible numbers, largest \(\displaystyle \dfrac{32-1}{32} = \dfrac{31}{32}\) YES!
For the cases you stated i have done the following, hope i'm right:
Sign of mantissa can be \(\displaystyle \pm\), exponent can be \(\displaystyle \pm 0\)
Actually, if you use an excel spreadsheet, you can evaluate all the cases quite quickly, but you will find that there are duplicate values. It is eliminatiing the duplicates that takes some time doing it this way.After all this time i think i've finally got it except for one bit:
So far i have done the following:
-mantissa has 5 bits.
-1 bit for the exponent which can take the values -1, 0 or 1. Correct because + 0 = - 0 = 0. So if x is the number of bits reserved for the exponent, the number of distinct exponents is 2x - 1.
The smallest positive mantissa is +(0.00001)_(2) = 0.03125_(10)
Correct, but, as you will see, the fractional representation is easier to work with. The values run as follows
\(\displaystyle \left(\dfrac{0}{32}\right)_{10},\ \left(\dfrac{1}{32}\right)_{10},\ \left(\dfrac{2}{32}\right)_{10}, ...,\ \left(\dfrac{30}{32}\right)_{10},\ \left(\dfrac{31}{32}\right)_{10} \)
Hence, the smallest positive number that can be represented is 0.03125 * 2^(-1) = 0.015625 Yes indeed.
The biggest positive mantissa is +(0.11111)_(2) = 0.96875 Still on track
The, the biggest positive number that can be represented is 0.96875 * 2^(1) = 1.9375 Doing fine.
So the computer will overflow when the number is greater than 1.9375 i.e when it is 1.9376. AT LEAST 1.9376
Hope, i'm correct so far.
Now i know that there are 2^5 = 32 possible values for the mantissa (31 are non-zero) for a start but i don't know how to do the bit which says "How many numbers can be represented in this way?" I have an idea. I was thinking if we use the formula (+ or -)mantissa *(2)^((+ or -)exponent), so we have the combinations +mantissa *2^(+exponent), +mantissa *2^(-exponent), -mantissa *2^(-exponent), -mantissa *2^(+exponent), but the exponent can still be 0,-1,1 so trying all this will take a long long time. I'm guessing that there is a shorter way to go about this?
Thanks
I'm sorry. I do not understand any of your last three posts.
Subhotosh KhanI assume s/he is deleting the posts to avoid detection by the instructor. However, some his posts were answered with quotation - thus cannot be deleted.
This is why always answer a post from a student "with quote".