single precision floating point numbers

logistic_guy

Full Member
Joined
Apr 17, 2024
Messages
788
Convert the following single-precision floating-point numbers into decimal numbers:

\(\displaystyle \bold{(a)} \ 0 \ 10000000 \ 11000000000000000000000\)
\(\displaystyle \bold{(b)} \ 1 \ 01111111 \ 00000000000000000000000\)
\(\displaystyle \bold{(c)} \ 0 \ 10000010 \ 10010000000000000000000\)
 
Convert the following single-precision floating-point numbers into decimal numbers:

\(\displaystyle \bold{(a)} \ 0 \ 10000000 \ 11000000000000000000000\)
\(\displaystyle \bold{(b)} \ 1 \ 01111111 \ 00000000000000000000000\)
\(\displaystyle \bold{(c)} \ 0 \ 10000010 \ 10010000000000000000000\)
show us your effort/s to solve this problem.
 
\(\displaystyle \bold{(a)} \ 0 \ 10000000 \ 11000000000000000000000 = +3.5\)

I will explain in the next post why the answer for \(\displaystyle \bold{(a)}\) is \(\displaystyle +3.5\)
 
First makes post with no work shown and then posts the solution. This is in violation of the posting guidelines.
Reported this OP to the admin---again
 
Single-precision floating-point numbers has this formula:

\(\displaystyle (-1)^S \times 2^E \times M\)

where

\(\displaystyle S \rightarrow \text{sign digit}\)
\(\displaystyle E \rightarrow \text{biased exponent part} - 127\)
\(\displaystyle M \rightarrow \text{Mantissa} = 1 + \text{decimal part}\)

The main idea is how to get the values of these three variables from the \(\displaystyle \text{zeros}\) and \(\displaystyle \text{ones}\).

We have in \(\displaystyle \bold{(a)}\):

\(\displaystyle 0 \ 10000000 \ 11000000000000000000000\)

\(\displaystyle S\) is the first digit on the left. In this case \(\displaystyle S = 0\).

\(\displaystyle 10000000\) is the biased exponent part. In this case \(\displaystyle 10000000 = 128\), so \(\displaystyle E = 128 - 127 = 1\).

\(\displaystyle 11000000000000000000000\) is the decimal part. In this case \(\displaystyle 11000000000000000000000 = 2^{-1} + 2^{-2}\).

Then, \(\displaystyle M = 1 + \frac{1}{2} + \frac{1}{4} = 1.75\).

Goint back to the formula.

\(\displaystyle (-1)^S \times 2^E \times M\)

\(\displaystyle (-1)^S\) represents the sign of the number.
\(\displaystyle 2^E\) represents the biased exponent.
\(\displaystyle M\) represents \(\displaystyle \text{Mantissa}\).

Let us fill the formula with what we got.

\(\displaystyle (-1)^S \times 2^E \times M = (-1)^0 \times 2^1 \times 1.75 = 3.5 = +3.5\)
 
Top