Here you can ask questions and find or give answers to organizational, academic and other questions about studying computer science.

1.1k questions

1.2k answers

1.6k comments

529 users

0 votes

Given the ReSy-Float number (exam WS17)

with base=4, 3 exponent bits and 2 mantissa bits (not counting hidden bit?), how can we convert it into a decimal value?

I tried the following approach, but it yields incorrect results:

edit: added original screenshot of exam

in * TF "Emb. Sys. and Rob." by (380 points)
edited by

2 Answers

+2 votes
 
Best answer

This is the Resy-float format where we do not have any hidden bit.

ß = 43-1 div 2 = 31

Exponent E = 2.42 + 1.41 + 3.40 - 31 = 8

Mantissa M = (2.41 + 3.40).41-2 = 11.4-1

The represented number x is +M.BE = (11.4-1).48 = +11.47= 180224

by (2.5k points)
selected by
This would make things clear, but that would mean the exponent is 3 bits long and the mantissa is 2 bits long, right? In the exam however, we are given the following information:
http://prntscr.com/u1i2js (this is a screenshot)
This would mean that the mantissa is 3 bits long and the exponent is 2 bits long. Is that an error or am I missing something?
So the subscript in screenshot says B,m,e . And for the floating point number, we have the subscript 4,2,3 . That means base=4, mantissa=2 and exponent=3 bits long.
Oh, you're right. Somehow I mixed things up. Thank you very much.
Ok one more small question: Doesn't it say in the screenshot, that this ReSyFloat-format does have a hidden bit ("zzgl. dem 'hidden bit'")?
I guess there is confusion over the wordings. Let me try to explain.

The IEEE-754 standard has the concept of a hidden bit which is always 1, and therefore not explicitly included in the number format.

In the Resy-float number format, we do NOT have the concept of a hidden bit. Instead all bits are explicitly shown in the number format. This is what the screenshot says. That the "Hidden-bit" which is hidden in the IEEE-754 standard is explicitly shown in the Resy-float number format.
Ah, now I really understand it! Thank you!!
Where did the 4^(1-2) for the calculation for the mantissa come from?
That is because in the floating point number format, the m digit mantissa is represented as a fixed point number with m-1 digits to the right of the decimal point. Therefore to get the mantissa value, one has to multiply the radix-B value of m digit mantissa by B^{-(m-1)}. In this case, B=4 and m=2. Thus 4^{-(2-1)} = 4^{1-2}.
I see. Thank you!
+2 votes

You use 23-1 -1 for the offset \beta. Since it's base 4 there should be 4....

Also note that \beta = (Be-1) div 2 = (43-1) div 2 = 31

by (2.4k points)
Thank you, but even if I calculate the bias as 4^(3-1)-1 the result is still in the range of 10^16, which is a lot larger than the solution.
I added the correct formula for \beta to the answer. Does it work with that?
The result is still in the millions. But isn't (4^3-1)/2=8 ?
No, the -1 is not in the exponent. I think you computed the mantissa wrong: 2.3_4 = 2.75. And 2.75 * 4^(39-31) = 180224
Ah, ok. How did you calculate the mantissa? (I can't make sense of 2.3_4 at the moment)
Mantissa is 23_4 (last two digits). Since we don't have a hidden bit it read as a fixed-point number 2.3_4. Converting to base 10 that is 2 + 3*1/4 = 2.75
Ok, I got it now, thanks!

Related questions

0 votes
4 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 21, 2020 in * Other Teaching Fields by Eichi (200 points)
Imprint | Privacy Policy
...