1,272 views

2 Answers

2 votes
2 votes

For IEEE 754 single precision representation answer would be

  32840.000000 0x47004800
#include<stdio.h>  
int main()  {
    float f = 3.284e4;
    printf("%f 0x%02x%02x%02x%02x\n", f, 
        *((char*) &f+3),*((char*) &f +2) , *((char*) &f+1), *((char*) &f+0));
}  

 The above code is run on a little-endian machine and hence the byte reversal. So, the answer would be

0x47004800 = (0100 0111 0000 0000 0100 1000 0000 0000)2

32840 = (1000000001001000)2

So, in normalized representation (implicit 1), we have 15 positions to be shifted for exponent and IEEE using bias as 127, we get exponent field = 127 + 15 = 142 = (10001110)2

The number is positive, so sign bit is 0. 

Thus we get sign bit followed by 8 exponent bits followed by 23 mantissa bits (after removing the leading 1)

0 100 0111 0 000 0000 0100 1000 0000 0000 = 0x47004800

1 votes
1 votes

$3.284\times 10^4=32840=(1000000001001000)_{2}$

Normalized form : $1.000000001001000\times 2^{15}$

Biased exponent=Actual exponent + Bias $=15+127=142=(10001110)_{2}$

$0|10001110|00000000100100000000000$

$0x47004800$

Related questions

2 votes
2 votes
2 answers
1
hemantsoni asked May 5, 2016
6,169 views
Which of the given number has its IEEE-754 32-bit floating-point representation as $(0 \ 10000000\ 110 0000 0000 0000 0000 0000)$a) 2.5b) 3.0c) 3.5d) 4.5
0 votes
0 votes
0 answers
3
tusharp asked Dec 3, 2018
834 views
Can someone please help in highlighted part. Thanks
2 votes
2 votes
1 answer
4
Hitoshi asked Dec 19, 2017
4,831 views
If the decimal number is 3.248 x 104 ,then its equivalent floating number in IEEE 754 standard is ?