retagged by
18,467 views
27 votes
27 votes

Consider three registers $R1$, $R2$, and $R3$ that store numbers in $\textsf{IEEE-754}$ single precision floating point format. Assume that $R1$ and $R2$ contain the values (in hexadecimal notation) $\textsf{0x42200000}$ and $\textsf{0xC1200000},$ respectively.

If $R3=\frac{R1}{R2}$, what is the value stored in $R3$?

  1. $\textsf{0x40800000}$
  2. $\textsf{0xC0800000}$
  3. $\textsf{0x83400000}$
  4. $\textsf{0xC8500000}$
retagged by

4 Answers

Best answer
43 votes
43 votes

For more elaboration, please refer: General Floating-Point Division

edited by
52 votes
52 votes
R1 = 0x42200000 = 0100 0010 0010 0000 0000 0000  0000 0000

As per IEEE -754 single precision format,

S=0 ==> +ve number

Exponent = (10000100)$_2$ = 128+4 = 132

true exponent = 132-127 = 5

Mantissa = (010 000000000)$_2$

$value = (-1)^0 . (1.010 0000 0000 ...) * 2^5 = (1010 00.00 0000 ...)_2 = 40 $

 

R2 = 0xC1200000 = 1100 0001 0010 0000 0000 0000  0000 0000

As per IEEE -754 single precision format,

S=1 ==> -ve number

Exponent = (10000010)$_2$ = 128+2 = 130

true exponent = 130-127 = 3

Mantissa = (010 000000000)$_2$

$value = (-1)^{1} . (1.010 0000 0000 ...) * 2^3 = (1010 .00 0000 ...)_2 = -10 $

R3 = $\frac{40}{-10} = -4 $

 

represent -4 in IEEE-754 single precision format

S=1

$Value = (100.0000)*2^0 = (1.00000000...)*2^2 $

true exponent = 2 ==> exponent = 2+127=129 = (10000001)$_2$

Mantissa = 000000..0

-4 in IEEE format : 1100 0000 1000 0000 0000 0000 0000 0000

in Hexa decimal format : 0xC0800000

 

option B is correct
edited by
7 votes
7 votes

IEEE-754 Single precision format

$Sign(S)$ $Biased\ exponent(BE)$ $Mantissa(M)$
$1-bit$ $8-bit$ $23-bit$

$BE=AE+Bias(+(2^{n-1}-1))$

$where\ n=BE\ field\ size$


$0x42200000:0|100\ \ \ 0010\ \ \ 0|010\ \ \ 0000\ \ \ 0000\ \ \ 0000\ \ \ 0000\ \ \ 0000$

$AE=BE-Bias=132-127=5$

$Mantissa=010....0000$

$\downarrow$

$+.0100000...0000\times 2^{+5}$

$\downarrow de-normalizaton$

$+.10100000...0000\times 2^{+6}$

$\downarrow$

$+101000.0000...0000=+40$


$0xC1200000:1|100\ \ \ 0001\ \ \ 0|010\ \ \ 0000\ \ \ 0000\ \ \ 0000\ \ \ 0000\ \ \ 0000$

$AE=BE-Bias=130-127=3$

$Mantissa=010....0000$

$\downarrow$

$-.0100000...0000\times 2^{+3}$

$\downarrow de-normalizaton$

$-.10100000...0000\times 2^{+4}$

$\downarrow$

$-1010.000000...0000=-10$


$R3=-4=-100.0000....000$

$\downarrow Normalization$

$-1.0000.....0000\times 2^{+2}$

$BE=AE+Bias=2+127=129=10000001$

$1|100\ \ \ 0000\ \ \ 1|000\ \ \ 0000\ \ \ 0000\ \ \ 0000\ \ \ 0000\ \ \ 0000$

$Ans:0xC0800000$

1 votes
1 votes

 R1=0x42200000 and R2=0xC1200000 (Given)

R1 in binary is 0      10000100      01000000000000000000000

R2 in binary is 1      10000010      01000000000000000000000

Clearly R1 is positive and R2 is negative

R3=R1/R2 

Sign bit of R3 will be 1

Exponent bit will be E1-E2 + 127 which will be (131-129)+127 = 129

M3 be 0 as M1-M2 is 0

 

So R3 in Binary will be

1      10000001      01000000000000000000000

which is C0800000

Answer:

Related questions

15 votes
15 votes
4 answers
1
Arjun asked Feb 12, 2020
8,028 views
Consider the Boolean function $z(a,b,c)$. Which one of the following minterm lists represents the circuit given above?$z=\sum (0,1,3,7)$$z=\sum (1,4,5,6,7)$$z=\sum (2,4,5...
12 votes
12 votes
2 answers
2
17 votes
17 votes
4 answers
3
Arjun asked Feb 12, 2020
9,707 views
If there are $m$ input lines and $n$ output lines for a decoder that is used to uniquely address a byte addressable $1$ KB RAM, then the minimum value of $m+n$ is _______...