Floating-point fields normal values और subnormals
Digits के साथ scale भी रखें
Fixed point में सभी values की scale समान है। Floating point में significand और exponent store होते हैं, इसलिए value के साथ scale बदलती है। समान bit count में उपयोगी range बढ़ती है, लेकिन पड़ोसी values समान अंतर पर नहीं रहतीं। Floating-point pattern, अपनी numerical value का two's-complement integer encoding नहीं है।
पूर्वज्ञान: binary fractions, दो की घातें, signed representation और fixed-point rounding। लक्ष्य: normal/subnormal fields decode करना, exact examples encode करना, range/spacing निकालना और special fields पहचानना। पहले पूरी तरह परिभाषित educational format लेंगे, फिर IEEE binary32 से तुलना करेंगे। Educational format को IEEE standard नहीं कहते और हर language का float binary32 होना नहीं मानते।
सात-bit educational format
Fields s | eee | fff हैं: sign bit s, तीन unsigned exponent bits e और तीन unsigned fraction bits f। Exponent bias 3 है। f का integer मान 0 से 7 और binary fraction .fff=f/8 है। Separator केवल notation है, stored bit नहीं।
| Exponent field e | Fraction field f | अर्थ |
|---|---|---|
| 1 से 6 | कोई भी | (−1)^s × (1+f/8) × 2^(e−3) |
| 0 | 1 से 7 | (−1)^s × (f/8) × 2^(1−3) |
| 0 | 0 | Signed zero |
| 7 | 0 | Signed infinity |
| 7 | 1 से 7 | NaN, finite numerical value नहीं |
Normal values में implicit leading 1 है, इसलिए तीन stored fraction bits से चार significant binary digits मिलते हैं। Exponent biased है, two's complement नहीं: e=010 यानी unsigned 2, इसलिए true exponent −1। e=0 के subnormal rule में exponent 1−bias=−2 और implicit leading 0 है। Normal formula में केवल e=0 रख देना गलत होगा।
Encoding से पहले normalize करें
Nonzero positive normal को (1.fraction)₂×2^E लिखते हैं; significand [1,2) में है। Binary point खिसकाते समय exponent से compensation करें, ताकि value न बदले। Sign bit sign देता है; exponent bias का नियम नहीं बदलता।
हल किया उदाहरण 1: 5.5=(101.1)₂=(1.011)₂×2²। Sign 0, biased exponent e=2+3=5=101 और fraction f=011। Store 0|101|011। जाँच: (1+3/8)×4=5.5। Leading 1 implicit है; उसे तीन-bit fraction में दोबारा नहीं डालते।
हल किया उदाहरण 2: 1|010|100 decode करें। e=2 होने से normal है। Significand=1+4/8=1.5, true exponent=2−3=−1 और sign negative। Value=−1.5×1/2=−0.75। Fraction 100 को integer 100 या पूरे word को signed integer मानना गलत interpretation है।
Normalization में तीन से अधिक fraction digits चाहिए हों तो rounding लग सकती है। केवल fields बताने से truncation की अनुमति नहीं मिलती; अगला पाठ rounding rule देता है। पहले classify और range check करें, हर value को normal formula में न ठूँसें।
Normal range और local spacing
सबसे छोटा positive normal e=1,f=0 से 1×2^−2=1/4 है। सबसे बड़ा finite normal e=6,f=7 से (1+7/8)×2³=15। Exponent 7 reserved है, उससे अगला normal binade नहीं बना सकते।
एक normal exponent E में f को 1 बढ़ाने से 2^(E−3) जुड़ता है। जैसे [1,2) में E=0 और values 1,1.125,1.25,…,1.875 हैं; अंतर 1/8। [2,4) में E=1 और अंतर 1/4। Precision चार significant bits रहती है, लेकिन magnitude के साथ absolute spacing बढ़ती है।
Power-of-two boundary पर नीचे और ऊपर के gaps अलग हो सकते हैं। 2 से पहले 1.875 है, gap 0.125; बाद में 2.25 है, gap 0.25। “2 के आसपास spacing” में दिशा या interval बताना चाहिए। Floating-point format हर जगह समान absolute resolution नहीं देता।
Zero के पास subnormals
e=0 पर value (−1)^s(f/8)×2^−2=(−1)^s f/32 है। सबसे छोटा positive subnormal 1/32=0.03125 और सबसे बड़ा 7/32=0.21875। अगला positive value सबसे छोटा normal 8/32=0.25 है, इसलिए boundary पर gap 1/32 रहता है।
हल किया उदाहरण 3: 0|000|101 का मान 5/32=0.15625 है, (1+5/8)×2^−3 नहीं। Leading significand bit 0 है। Subnormals zero तक छोटे steps देते हैं, लेकिन normals जितनी relative precision नहीं; value घटने पर effective significant digits घटते हैं।
Representable subnormal अपने आप arithmetic error नहीं है। Underflow exception flag अलग arithmetic विषय है; लागू नियमों में tiny और inexact result जैसी शर्तें आती हैं। यह पाठ representation classify करता है, पूरा exception-status protocol नहीं सिखाता।
Zeros infinities और NaNs
दो s|000|000 patterns +0 और −0 हैं। Sign stored है, हालांकि ordinary IEEE equality में दोनों numerical values समान हैं। Bit patterns अलग हैं। दो s|111|000 patterns signed infinities हैं, सबसे बड़ी finite value नहीं। e=111 के साथ nonzero fraction NaN है। NaN encodings अतिरिक्त finite magnitudes नहीं हैं और ordinary equality में NaN स्वयं के बराबर नहीं होता।
Field partition जाँचने के लिए patterns गिनें: normals 2×6×8=96; nonzero subnormals 2×7=14; zeros 2; infinities 2; NaNs 2×7=14। कुल 128=2^7। यह encodings गिनता है, अलग real-number values नहीं। Bit patterns गिनते समय कई NaNs या signed zeros को चुपचाप न मिलाएँ।
IEEE binary32 से संबंध
IEEE binary32 में एक sign bit, आठ exponent bits, 23 stored fraction bits और bias 127 है। Implicit 1 सहित normal precision 24 bits है। Normal exponent fields 1 से 254 हैं; 0 और 255 की special roles ऊपर जैसी हैं, उचित field widths के साथ। इसलिए minimum positive normal 2^−126, minimum positive subnormal 2^−149 और maximum finite value (2−2^−23)2^127 है। ये format facts हैं, memory byte-order नियम नहीं।
मुख्य जाँचें: पहले fields बाँटें; formula से पहले exponent classify करें; fraction field और significand अलग रखें; सही case में ही bias घटाएँ; hidden 1 केवल normal में जोड़ें; smallest normal को smallest positive value से अलग रखें। Counts और decode किए example को वापस encode करके जाँचें।
मौलिक अभ्यास
ये छह single-correct MCQ सीखने के लिए बनाए गए मौलिक प्रश्न हैं, पिछले वर्षों के प्रश्न नहीं। हर प्रश्न में ठीक एक विकल्प चुनें।
C01. Bias 3, normal exponent fields 1…6 और तीन fraction bits वाले s|eee|fff format में +5.5 कौन-सा pattern है?
A. 0|010|011 B. 0|101|101 C. 0|101|011 D. 1|101|011
उत्तर: C
A गलत है: exponent field 2 का true exponent −1 है, +2 नहीं।
B गलत है: fraction 101=5/8 से 6.5 मिलता है, 5.5 नहीं।
C सही है: 5.5=1.011₂×2², इसलिए e=5,f=3।
D गलत है: sign 1 से −5.5 होगा।
C02. इसी सात-bit format में सबसे छोटा positive subnormal क्या है?
A. 1/32 B. 1/8 C. 1/4 D. 1/64
उत्तर: A
A सही है: f=1,e=0 से (1/8)×2^−2=1/32।
B गलत है: fixed subnormal exponent factor छूट गया।
C गलत है: 1/4 सबसे छोटा positive normal है।
D गलत है: subnormal exponent −2 के बजाय −3 लिया।
C03. दोनों signs गिनकर इस सात-bit format में कितने normal-number encodings हैं?
A. 128 B. 48 C. 112 D. 96
उत्तर: D
A गलत है: 128 में सभी special encodings भी हैं।
B गलत है: 48 केवल एक sign की गिनती है।
C गलत है: exponent field 0 normal नहीं।
D सही है: 2 signs×6 normal exponent fields×8 fraction patterns=96।
C04. इस format में 0|111|001 क्या है?
A. सबसे बड़ी finite संख्या B. NaN C. Positive infinity D. सबसे छोटी normal संख्या
उत्तर: B
A गलत है: सबसे बड़े finite pattern का exponent 110 है, 111 नहीं।
B सही है: all-one exponent और nonzero fraction से NaN।
C गलत है: infinity में fraction 000 चाहिए।
D गलत है: smallest positive normal में e=001,f=000 है।
C05. इस format में [1,2) के successive representable normal values का अंतर क्या है?
A. 1/4 B. 1/16 C. 1/8 D. 1/32
उत्तर: C
A गलत है: 1/4, [2,4) की spacing है।
B गलत है: इस binade में उसके लिए एक अतिरिक्त fraction bit चाहिए।
C सही है: E=0 और तीन fraction bits से 2^(0−3)=1/8।
D गलत है: 1/32 subnormal spacing है, 1 के पास की नहीं।
C06. IEEE binary32 में 23 stored fraction bits हैं। Implicit leading bit सहित normal values में कितने significant binary digits हैं?
A. 23 B. 24 C. 32 D. 22
उत्तर: B
A गलत है: normal का implicit leading 1 छूट गया।
B सही है: 23 stored fraction bits और एक implicit leading bit से 24।
C गलत है: 32 में sign और exponent fields भी हैं, केवल precision नहीं।
D गलत है: normalization कोई fraction bit नहीं हटाता।
सीमा और स्रोत
यह Digital Logic के एक सीमित हिस्से का पाठ है, पूरे GATE CS की तैयारी नहीं। आधिकारिक पाठ्यक्रम केवल विषय की प्रासंगिकता की पुष्टि करता है; व्युत्पत्तियाँ, उदाहरण और अभ्यास मौलिक हैं। तकनीकी संदर्भों से representation और circuit की conventions जाँची गई हैं; उनके अभ्यास प्रश्न नहीं दोहराए गए।
स्रोत 14 अक्टूबर 2026 को जाँचे गए।
प्रगति सहेजने के लिए साइन इन करें। साइन इन