The value of a type variable is represented using the single-precision floating point format of standard that uses for sign, for biased exponent and for the mantissa. A type variable is assigned the decimal value of . The representation of in hexadecimal notation is
View worked solution
Answer: A
To represent the decimal value in IEEE-754 single-precision floating-point format, we follow these steps:
- Sign Bit (): Since the number is negative, the sign bit is .
- Binary Conversion: Convert the magnitude to binary: Thus, .
- Normalization: Normalize the binary representation to the form : Here, the actual exponent is , and the mantissa bits () are (padded with zeros to 23 bits).
- Biased Exponent (): The bias for single-precision is .
Combining the fields (, , and ):
Grouping the 32 bits into groups of 4 to convert to hexadecimal:
Thus, the hexadecimal representation is .
Free practice · Your answers on this page are not saved.
