in Digital Logic retagged by
18,156 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}$
in Digital Logic retagged by
by
18.2k views

2 Comments

R1 = + 2^(5+bias)    *   2^(-21)

R2 = – 2^(3+bias)    *   2^(-21)

 

R1 / R2    = – 2^2 *  1  = – 2^(127+2)  * 1 =  1   1000 0001   0000 0000 0000 0000 0000 000 

                                            =  1100  0000 1000  0000  0000  0000  0000 0000 0000

                                            =  C      0     8    0     0     0      0    0    0

Answer 0xC0800000 

 

 

1
1
edited by

Beautifully Explained about Floating point Representation

https://www.rfwireless-world.com/Tutorials/floating-point-tutorial.html

0
0

4 Answers

43 votes
43 votes
Best answer

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

edited by

4 Comments

 

NPTEL le​​​​​cture on this topic

​​

2
2

Wow great explanation 

thanks @vermavijay1986 sir for the solution 

1
1
Helpful:-

"[Solved] Consider three registers R1, R2 and R3 that store numbers in" https://testbook.com/question-answer/consider-three-registers-r1-r2-and-r3-that-store--5ea0291ef60d5d7ffaca2fc6/amp
0
0
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

4 Comments

@shaik bhai could you please provide some ref. for this.
0
0
it's normal procedure only. You can check any standard book.
1
1
OKay :)
0
0
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 vote
1 vote

 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