recategorized by
3,079 views
16 votes
16 votes

Following floating point number format is given

$f$ is a fraction represented by a $6-bit$ mantissa (includes sign bit) in sign magnitude form, $e$ is a $4-bit$ exponent (includes sign hit) in sign magnitude form and $n=(f, e) = f. 2^e$ is a floating point number. Let $A=54.75$ in decimal and $B=9.75$ in decimal

  1. Represent $A$ and $B$ as floating point numbers in the above format.

  2. Show the steps involved in floating point addition of $A$ and $B.$

  3. What is the percentage error (up to one position beyond decimal point) in the addition operation in (b)?

recategorized by

1 Answer

Best answer
13 votes
13 votes

PART A

$A = 54.75 = 110110.11_2$

Coming to the floating point representation we need to know whether to use "implied 1" in normalized representation or not. This is a 1997 question and IEEE-754 was not there and hence we cannot assume implied one.

So, $A = 110110.11 = 0.11011011 \times 2^{6}$

Thus mantissa $ = 11011011$ and exponent $ = 110.$ We use sign magnitude representation for both mantissa and exponent, mantissa bits are $6$ including sign and exponent bits are $4$ including sign. So, we get 

mantissa $= 011011$ and exponent $ = 0110$ which means $A = (011011,0110)$

$B = 9.75 = 1001.11_2$

$\qquad = 0.100111 \times 2^{4}$

So, mantissa bits $ = 010011$ (truncated to $6$ bits) and exponent bits $ = 0100.$

$\implies B = (010011,0100)$

PART B

To add two floating point numbers we must first make their exponents same and then add the mantissas. To make the exponents same we must make the smaller one equal to the larger (we cannot do the other way around as we can only shift the mantissa bits to right but not the left).

Here, $A = (011011,0110)$ and $B = (010011,0100).$ 

Since, exponent of $A$ is larger we change $B$ to $B = (000100,0110).$

Now, adding the mantissa parts of $A$ and $B$ (MSB is sign bit and not added as in $2's$ complement representation) we get $11011 + 00100 = 11111.$  Thus we get $A +  B = (011111, 0110).$

PART C

Precise Result of $A + B = 54.75+9.75 = 64.5$

Result got in Part (b) $ = 0.11111 \times 2^6 = 111110_2 = 62_{10}.$

So, $\text{absolute error} = \mid 62 - 64.5 = 2.5$

$\text{Percentage Error} = \dfrac{\text{Error}}{\text{Original Value}} \times 100 = \dfrac{2.5}{64.5} \times 100 = 3.87\%$

selected by

Related questions

27 votes
27 votes
2 answers
2
Kathleen asked Sep 29, 2014
11,795 views
Given $\sqrt{(224)_r} =(13)_r$.The value of the radix $r$ is:$10$$8$$5$$6$
39 votes
39 votes
9 answers
3
Kathleen asked Sep 29, 2014
15,821 views
Let $f(x, y, z)=\bar{x} + \bar{y}x + xz$ be a switching function. Which one of the following is valid?$\bar{y} x$ is a prime implicant of $f$$xz$ is a minterm of $f$$xz$ ...
37 votes
37 votes
5 answers
4