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

1.1k questions

1.3k answers

1.7k comments

557 users

0 votes

In the exam of WS17 there was the following question asked:

I understand every part except the 0.05.

I converted it as follows:

The resulting exponent ist negative, which (if I understood it correctly) means the number cannot be represented with the given amount of bits. We would have to increase the amount of bits in the exponent, so that the bias would increase to 7 and we would get an exponent of +2, which we can represent in binary. I do not understand how the solution displays the number with only a 3 bit exponent and I do not know what I did wrong. Any help would be very much appreciated.

edit: q2a may cut off the rightmost part of the image, right-click and "show image in new tab" still shows the whole image.

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

1 Answer

0 votes
 
Best answer
You may use the teaching tool https://es.cs.uni-kl.de/tools/teaching/FloatingPoint.html to get more insights; here is what I got from its output (you have to specify the number of bits for the mantissa however correctly depending on whether you want to use a hidden bit or not).
by (170k points)
selected by
Ok. With teaching tools I figured out that my problem was that I was trying to only convert it into a normalised floating point number, however a representation of 0.05 is only possible with a denormalised number in this case. With this I got same result as the solution. In the exam, would it be sufficient if we only wrote the binary representation of the number of do we have to write out the decimal value as well?
depends on the exercise; but typically, the question is to convert a given number to the floating point format (which is binary)
Ok, thank you!
Imprint | Privacy Policy
...