• edited by
7,864 views
22 22 votes
Consider an excess -$50$ representation for floating point numbers with $4$ BCD digit mantissa and $2$ BCD digit exponent in normalised form. The minimum and maximum positive numbers that can be represented are __________ and _____________ respectively.

4 Answers

Best answer
21 21 votes

In binary we have normalized number of the form $(-1)^{S} \times 1.M \times 2^{E-\text{ Bias}}$ where,

  • $S:$ sign bit 
  • $M :$ Mantissa
  • $E:$ Exponent

Similarly for for $\textsf{Binary Coded Decimal (BCD)}$ numbers the normalized number representation will be $:(-1)^{S} \times 1.M \times 10^{E-\text{ Bias}}$

Here bias is given to be excess - $50$ meaning that we need to subtract $50$ from the base exponent field to get the actual exponent.

So, maximum mantissa value with $4\;\text{BCD}$ digits $= 9999$

Maximum base exponent value with $2\;\text{BCD}$ digits $=  99$

So, maximum actual exponent value possible with $2\;\text{BCD}$ digits $= 99\;\text{- Bias} $

$\qquad \qquad \qquad =  99 - 50$

$\qquad \qquad \qquad  =  49$

So, the magnitude of the largest positive number $=  9.9999 \times 10^{49}$

Similarly, 

To get a minimum positive number, we have to set mantissa $= 0$ and exponent field  $= 0$

So, doing that we get exponent  $=  0 - 50  =  -50$

So, magnitude of minimum positive number $=  1.0000 \times 10^{-50}$

Therefore, maximum positive number $ = 9.9999 \times 10^{49}$

Minimum positive number $= 1.0000 \times 10^{-50}$

• edited by
1 flag:
✌ Edit necessary (juDson_Abhi “Wrong representation and wrong answer”)
10 10 votes

 

The "Why": Is Sawaal Mein "Trap" Kya Hai?

Sabse pehla aur sabse zaroori kaam hai iske "trap" ko pehchaanna.
This is NOT IEEE 754!

Yeh ek poori tarah se custom-made, hypothetical floating point system hai. Iska matlab humein IEEE 754 ke (S|E|M, binary mantissa, bias=127) saare niyam bhool kar, is question ke naye niyam-kanoon se khelna padega.


Concept Deep Dive: Decoding the Custom BCD Format

Chaliye, is naye system ke niyam-kanoon ko decode karte hain.

  • The Base: Question mein "BCD" (Binary Coded Decimal) likha hai. Jaise hi aap BCD dekhein, samajh jao ki hum Decimal (Base-10) ki duniya mein baat kar rahe hain, Binary (Base-2) ki nahi.

  • The Formula: Iska general formula hoga:
    Value = (Mantissa)₁₀ * 10^(Actual Exponent)

Ab hum Mantissa aur Exponent, dono ke "aukaat" (range) ko nikaalenge.

1. Decoding the Exponent

  • Format: "2 BCD digit exponent". BCD matlab har digit 4 bit ka. Toh 2 digit = 8 bits.

  • Range of Stored Exponent: 2 BCD digits se hum kaun-kaun se decimal number bana sakte hain? 00 se lekar 99 tak.

  • Bias: Question kehta hai "excess-50". Iska matlab Bias = 50.

  • Actual Exponent ki Range:

    • Actual Exp = Stored Exp - Bias

    • Minimum Actual Exp: 00 (stored) - 50 = -50.

    • Maximum Actual Exp: 99 (stored) - 50 = +49.

2. Decoding the Mantissa

  • Format: "4 BCD digit mantissa". 4 digit = 16 bits.

  • Normalization: Question kehta hai "in normalized form". IEEE 754 mein iska matlab 1.M hota tha. BCD/Decimal duniya mein iska matlab hota hai ki mantissa ko hamesha 0.something ki form mein likha jaata hai aur pehla digit zero nahi ho sakta.

    • Mantissa = 0.d₁d₂d₃d₄ where d₁ ≠ 0.

  • Range of Mantissa:

    • Minimum Normalized Mantissa: Pehla digit 1 hona chahiye, baaki 0. → 0.1000.

    • Maximum Normalized Mantissa: Saare digits 9 hone chahiye. → 0.9999.


Let's Find X (The Minimum Positive Number)

The "How": Sabse chhota number banane ke liye, humein Mantissa ko minimum aur Exponent ko minimum rakhna padega.

  • Minimum Normalized Mantissa: 0.1000

  • Minimum Actual Exponent: -50

  • Assemble X:

    • X = 0.1000 * 10⁻⁵⁰


Let's Find Y (The Maximum Positive Number)

The "How": Sabse bada number banane ke liye, humein Mantissa ko maximum aur Exponent ko maximum rakhna padega.

  • Maximum Normalized Mantissa: 0.9999

  • Maximum Actual Exponent: +49

  • Assemble Y:

    • Y = 0.9999 * 10⁴⁹


The Final Calculation: X * Y

Ab bas in dono ko multiply karna hai.

  • X * Y = (0.1000 * 10⁻⁵⁰) * (0.9999 * 10⁴⁹)

  • Powers ko ek saath, values ko ek saath:
    = (0.1 * 0.9999) * (10⁻⁵⁰ * 10⁴⁹)

  • = (0.09999) * (10⁻¹)

  • = 0.009999

The Last Step: Rounding Off
Question kehta hai "Rounded to one decimal place".

  • 0.009999 ko one decimal place tak round karne par answer aata hai 0.0.

3 3 votes

Given:

Bias $= q = 50$

Mantissa / Significand digits $= 4$

Exponent digits $= 2$

Base $= 10$

Exponent Range: $0 \leq E \leq 99$

Mantissa Range: $0.1000 \leq m \leq 0.9999$
 

Because, Normalized form requires the most significant digit to be non-zero.

Maximum value:

Exponent = 99

Mantissa = 0.9999

\[
\text{Number} = 10^{(99 - 50)} \times (0.9999)
\]

Minimum value:

Exponent = 00

Mantissa = 0.1000

\[
\text{Number} = 10^{(00 - 50)} \times (0.1000)
\]

Reference :

COA - William Stallings 10th edition (Problems 10.22)

Position:
Show:

Related questions

51 51 votes
6 answers 6 answers
13.7k
13.7k views
Misbah Ghaya asked Nov 29, 2016
13,651 views
How many substrings (of all lengths inclusive) can be formed from a character string of length $n$? Assume all characters to be distinct, prove your answer.
1 1 vote
1 1 answer
1.1k
1.1k views
Misbah Ghaya asked Nov 30, 2016
1,142 views
Consider the definition of macro $B,$ nested within the definition of a macro $A.$ Can a call to macro $B$ also appear within macro $A?$ If not, why not? If yes, explain ...
45 45 votes
4 answers 4 answers
12.3k
12.3k views
Misbah Ghaya asked Nov 27, 2016
12,284 views
Which of the following graphs is/are planar?
8 8 votes
0 0 answers
942
942 views
Misbah Ghaya asked Nov 30, 2016
942 views
It is required to implement a stack using bidirectional shift registers providing stack underflow and overflow detection capability.How many shift registers are needed fo...