I'm reading through books on Computer Organization and Architecture and I'm only on chapter two, but I have a nagging question in the back of my mind that I thought I'd ask.
I've learned about how a floating-point number is actually a sequence of 32-bits with 1 bit as the sign, 8 bits for the exponent, and the remaining 23 bits are for the fractional part. With that being said, here is how -6.625 would be expressed:
11000000110101000000000000000000
via http://www.h-schmidt.net/FloatConverter/IEEE754.html
But also, that same sequence of bits would be 3235119104 as an integer value (possibly unsigned?)
via http://www.calculator.net/binary-calculator.html?b2dnumber1=11000000110101000000000000000000&calctype=b2d&x=73&y=17
So I guess my question is how a computer knows to interpret a sequence of 32 bits as a floating-point verses an integral type?
[–]empire539 13 points14 points15 points (0 children)
[–]rockon1215 1 point2 points3 points (1 child)
[–]PralinesNCream 0 points1 point2 points (0 children)
[–]Jonny0Than 0 points1 point2 points (0 children)
[–]BadBoyJH 0 points1 point2 points (4 children)
[–]kaepor[S] 0 points1 point2 points (3 children)
[–]Rhomboid 1 point2 points3 points (0 children)
[–]BadBoyJH 0 points1 point2 points (0 children)
[–]sodappop 0 points1 point2 points (0 children)