Write the following binary number using floating-point representation - Scottish Highers Computing Science - Question 2 - 2022
Question 2
Write the following binary number using floating-point representation.
-111 0000 1111.0101
There are 16 bits for the mantissa (including the sign bit) and 8 bits f... show full transcript
Worked Solution & Example Answer:Write the following binary number using floating-point representation - Scottish Highers Computing Science - Question 2 - 2022
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 of the number is negative, hence the sign bit is set to 1.
Step 2
mantissa: 111 0000 1111.0101
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
The mantissa consists of the binary number without the sign, leading to the representation:
111000011110101
This is then adjusted to fit the 16-bit mantissa requirement:
1110000111101010
(padding with an additional zero at the end as needed).
Step 3
exponent: 0000 1011
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 is derived from the scientific notation of the binary number. The exponent in this case is 11, which in binary is represented as:
00001011
Join the Scottish Highers students using SimpleStudy...