The decimal number 6.125 converted to binary is 110.001 - Scottish Highers Computing Science - Question 4 - 2019
Question 4
The decimal number 6.125 converted to binary is 110.001.
Convert 110.001 to floating-point representation. There are 16 bits for the mantissa (including the sign bit... show full transcript
Worked Solution & Example Answer:The decimal number 6.125 converted to binary is 110.001 - Scottish Highers Computing Science - Question 4 - 2019
Step 1
Sign bit:
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The sign bit indicates whether the number is positive or negative. Since 110.001 is a positive number, the sign bit is 0.
Step 2
Remaining 15 bits of mantissa:
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
After the sign bit, the next 15 bits of the mantissa are needed. The binary for 110.001 is 110.001000000000000. By normalizing it to the form 1.xxxxxx, we adjust it:
Normalized form: 1.10001 × 2^2
Thus, the mantissa will be '100010000000000' (the '1' is implicit in floating-point representation).
Step 3
Exponent:
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The exponent for this floating-point representation will be calculated by adding the bias to the actual exponent. The bias for an 8-bit exponent is 127:
Actual exponent: 2
Exponent with bias: 2 + 127 = 129
In binary, 129 is '10000001'.
Join the Scottish Highers students using SimpleStudy...