edited by
11,318 views
38 votes
38 votes

Consider the following $32\text{-bit}$ floating-point representation scheme as shown in the format below. A value is specified by $3$ fields, a one bit sign field (with $0$ for positive and $1$ for negative values), a $24 \;\text{bit}$ fraction field (with the binary point is at the left end of the fraction bits), and a $7\;\text{bit}$ exponent field (in $\text{excess-}64$ signed integer representation, with $16$ is the base of exponentiation). The sign bit is the most significant bit.

  1. It is required to represent the decimal value $- 7.5$ as a normalized floating point number in the given format. Derive the values of the various fields. Express your final answer in the hexadecimal.
  2. What is the largest value that can be represented using this format? Express your answer as the nearest power of $10$.
edited by

4 Answers

Best answer
38 votes
38 votes

Here, mantissa is represented in normalized representation and exponent in $\text{excess-}64$ (subtract $64$ to get actual value). 

a. We have to represent $-(7.5)_{10} = -(111.1)_2$. 

Now we are using base $16$ for exponent. So, mantissa will be $.01111$  and this makes exponent as $1 (4$ bit positions and no hiding first $1$ as in $\text{IEEE}\; 754$ as this is not mentioned in question) which in $\text{excess-}64$ will be $64 + 1 = 65.$ Number being negative sign bit is $1.$ So, we get

$(1\; 01111\underbrace{000\dots0}_{\text{19 zeroes}} \; 1000001)_2 = (\text{BC}000041)_{16}$

b. Largest value will be with largest possible mantissa, largest possible exponent and positive sign bit. So, this will be all $1$'s except sign bit which will be 

$0.\underbrace{111\dots 1}_{\text{24 ones}} \times 16^{127-64} = \left(1- 2^{-24}\right) \times 16^{63}$

$($Again we did not add implicit $1$ as in $\text{IEEE}\; 754)$

$2^x = 10^{y} \implies y = \log 2^x = x \log 2$  

So, $(1-2^{-24}) \times 16^{63} \\= \left(1 - 10^{-24 \log 2}\right) \times 10^{63 \log 16}\\ \approx \left(1 - 10^{-7}\right) \times 10^{76}\\ = 10^{76}$

Not directly relevant here, but a useful read: https://jeapostrophe.github.io/courses/2015/fall/305/notes/dist/reading/help-floating-point.pdf

edited by
15 votes
15 votes
It is clearly given here that this is excess 64 & Base is 16. So we need to use that.

a)

-7.5 Due to minus sign we will get sing bit as 1.

7.5 = 111.1 * 16^0

As Base is 16 & We need to normalize we need to at least normalize to 16^1. (This answer maybe different if we choose not to normalize, Though I think we can not use either implicit or explicit normalization correctly here.

It will be 0.0111*16^1.

So now our biased exponent is 1+64 = 65.

Mantissa is (0.) 0111000...

When we save it we get hex as BC000041

 

2. Maximum value possible is $(1- 2^{-24}) \times 16^{(127-64)}$.

WHen converted into base 10 we get $7.237006 \times 10^{75}$.
edited by
9 votes
9 votes

First express (-7.5) into binary

How to write (-7.5) in binary

first write 7.5 into binary = (111.1)

Do not worry about negative sign here sign bit will contain 1 because above number is negative.

And base 16 is given hence we will convert into power of 16(we know 2^4=16)

So we can write 111.1*2^0 = 0.01111*2^4

0.01111*2^4 = 0.01111*16^1( here 16 is a base and 1 is exponent)

Excess 64 is given hence 1+64=65

65 in binary= 1000001(we will represent 65 in exponent field)

Now we have to represent into floating point

Sign bit = 1

Mantissa = 011110...0(19 zero consecutive)

Exponent = 1000001 

( 1  011110....0   1000001 ) in floating point

convert it into hexadecimal and make a pair of 4 digit from right side. ( for example 0001=1 in hexadecimal )

then you will get (BC000041) in hexadecimal

 

1 votes
1 votes
a) 7 bit exponent means biasing of = 2^(7-1) -1 = 63

-7.5= - 111.1 =- 1.111 * 2^2

sign bit =1

biased exponent = 65 as (65 - 63 = 2) = 0010001

fraction = 111000000000000000000000 (three 1s followed by twenty one 0s)

normalized representation = 1 111000000000000000000000 0010001

hexadecimal representation = F0000011

b) largest value :

sign bit = 0 (positive)

exponent = 1111110

fraction = 111111111111111111111111 ( twenty four 1s )

normalized number =  0 111111111111111111111111 1111110

= 2147483646

= 2.147483646 * 10^9

 

CORRECT ME IF I AM WRONG

Related questions

30 votes
30 votes
3 answers
1
Kathleen asked Sep 15, 2014
9,203 views
In $2's$ complement addition, overflowis flagged whenever there is carry from sign bit additioncannot occur when a positive value is added to a negative valueis flagged w...
34 votes
34 votes
4 answers
2
Kathleen asked Sep 15, 2014
6,533 views
Sign extension is a step in floating point multiplicationsigned $16$ bit integer additionarithmetic left shiftconverting a signed integer from one size to another
27 votes
27 votes
6 answers
3
Kathleen asked Sep 15, 2014
9,885 views
The $2's$ complement representation of the decimal value $-15$ is$1111$$11111$$111111$$10001$
23 votes
23 votes
3 answers
4
Kathleen asked Sep 15, 2014
5,828 views
The decimal value $0.25$is equivalent to the binary value $0.1$is equivalent to the binary value $0.01$is equivalent to the binary value $0.00111$cannot be represented pr...