2k views

The value of a $\text{float}$ type variable is represented using the single-precision $\text{32-bit}$ floating point format of $IEEE-754$ standard that uses $1$ $\text{bit}$ for sign, $\text{8 bits}$ for biased exponent and $\text{23 bits}$ for the mantissa. A $\text{float}$ type variable $X$ is assigned the decimal value of $−14.25$. The representation of $X$ in hexadecimal notation is

1. $C1640000H$
2. $416C0000H$
3. $41640000H$
4. $C16C0000H$
edited | 2k views

$\begin{array}{|c|c|c|c|}\hline \textbf{S}&\textbf{BE}&\textbf{M}&\textbf{Value}\\\hline 0/1&\text{All 0's}&\text{All 0's}&0\\0&\text{All 1's}&\text{All 0's}&+\infty\\1&\text{All 1's}&\text{All 0's}&-\infty\\0/1&\text{All 1's}&\text{Non zero}&\text{NaN}\\\hline\end{array}$

$\textbf{Bias} = 2^{N-1}-1$
$N-\text{Number of bits to represent exponent in binary}$

$14.25 = 1110.01000 = 1.11001000\times 2^3$

Biased exponent $= \text{actual} + \text{bias} = 3 + \text{bias}$
where; $\text{bias} = 2^{8-1}-1 = 127$
$\text{biased exponent} = 3+127 = 130 = 10000010$

Therefore, number represented as = 1 10000010 11001000000000000000000

on converting to hexadecimal we get $(C1640000)_{16}$

edited
0
sometimes in the question it is given that 1 in normalised form will be added implicitly in that case we would shift the decimal point before first bit or would we follow the same as shown [email protected], @Arjun
+1
IEEE 754 uses implicit 1 for normalized numbers. So, we skip that 1 before "." always.
0

I could not get your explanation, my doubt is that 14.25 is written as 1110.01000 which is 1.11001000 ✖ 2in normalized form, if the question says 1 is added implicitly as you have mentioned in IEEE754, then we write it as

.111001000 or 1.11001000?

0
For 1.11001000, mantissa = 11001000
+1
Okay thanks :)
M=14.25=1110.01= 1.11001*2^3

M=11001 MSB 1 is for sign bit , since exponent is 8 bit biased so, 2^8 -1= 127.. E= 127 +3= 130=10000010

So , 1 foe sign bit 10000010(8 bits) for exponent and 1100100000....0(23bits)= C1640000H
0
Since No is negative S bit will be 1
Convert 14.25 into binary 1110.01
Normalize it : 1.11001 X 2 ^ 3
Biased Exponent (Add 127) : 3 + 127 = 130 (In binary 10000010)
Mantissa : 110010.....0 (Total 23 bits)

Num represented in IEEE 754 single precision format :

1 10000010 11001000000000000000000

In Hex (Group of Four bits) -

1100 0001 0110 0100 0000 0000 0000 0000

Num becomes : C1640000
0

very nice explanation.. :)

### Answer should be option (A).

answered ago by Junior (831 points)

1
2