SlideShare a Scribd company logo
1 of 2
Download to read offline
IEEE 754 Standard for Floating Point Representation
of Real Numbers.
There are four pieces of info to be represented:
Sign of the number
(Always the high order bit; 0=positive, 1=negative.)
Magnitude of the number (Stored in binary with leading "1" understood. See below.)
Sign of the exponent
(Stored as an offset "bias" on value of exponent. See below.)
Magnitude of the exponent. (Stored as unsigned binary added to offset bias.)
I. Float. (32 bits) Binary template: SEEE EEEE EMMM MMMM ... MMMM
where S = sign bit, E = exponent bits (8 of these), M = mantissa bits (23 of these).
Process to represent:
A. Convert decimal number to binary.
B. Move radix point to 1.xxx... * 2^exp representation.
C. Now, do the work:
i.
S. Assign the sign bit. positive --> 0, negative --> 1.
ii.

Assign the mantissa. This is the fractional part of the value of the number.
--ignore the leading "1". It is always 1 in this scientific notation, so there is no need to
store it. The system will re-insert it later when the number is used.
--form the 23 MMM...MMM bits from the first 23 of the remaining "xxx..." bits above.
If there are not 23 of them, fill out with trailing zeros.

iii.

The exponent "exp" may be positive or negative. Float is stored with excess-127
notation. That is, you ADD 127 to your exponent and store as a pure (unsigned)
binary. When the number is re-created for use later, 127 will be subtracted from the
exponent. This method saves having to use 2's complement for negative exponents.

iv: Combine in recipe SEEEEEEEEMMMM...MMM format.
Example:
Find the representation of decimal -10.5 in float IEEE-754 representation.
A. Convert the number: -10.5 decimal --> -1010.1 binary
B. Move radix to get scientific notation:
-1010.1 binary --> -1.0101 * 2^(+3) (binary)
C. Now, do the work:
i. Sign bit will be 1 since the number is negative.
ii. Mantissa.
(101010000...0)
Ignore leading one: 01010000...0
Use first 23 bits:
01010000000000000000000 -->This is mantissa.
iii. Exponent is +3.
ADD excess-127 offset: 127 + (+3) = 130 decimal = 10000010 binary.
These are the 8 bits for the exponent: 10000010.
D. Combine in SEEEEEEEEMMMMMMMMMMMMMMMMMMMMMMM format:
11000001001010000000000000000000
To make it easier to read, group in 4's and convert each group to hex:
original
grouped:

11000001001010000000000000000000
1100 0001 0010 1000 0000 0000 0000 0000
C
1
2
8
0
0
0
0

binary
binary
hex

or,
C128 0000

hex

II. double.
The process to convert to "double" is similar to "float":
1. a total of 64 bits are used to represent the number.
2. The sign bit still is one digit, always the high order digit.
3. The mantissa is stored with 52 bits instead of 23. This gives doubles greater precision.
4. The exponent is stored with 11 bits instead of 8. This gives doubles a wider range of
representable numbers.
Example: Decimal +10.5 --> 0100 0000 0010 0101 0000 ... 0000 binary (64 bits)
4025 0000 0000 0000 hex

More Related Content

What's hot

Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbersMOHAN MOHAN
 
Number system and codes
Number system and codesNumber system and codes
Number system and codesAbhiraj Bohra
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of IntegersSusantha Herath
 
Data types
Data typesData types
Data typesgavhays
 
Representation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarRepresentation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarSivakumar R D .
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Datagavhays
 
digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointdigital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointRai University
 
IEEE floating point representation
 IEEE floating point representation IEEE floating point representation
IEEE floating point representationMaskurAlShalSabil
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004arunachalamr16
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersMohammad Bashartullah
 
data representation
 data representation data representation
data representationHaroon_007
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 

What's hot (20)

Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
Representation of Real Numbers
Representation of Real NumbersRepresentation of Real Numbers
Representation of Real Numbers
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 
Class03
Class03Class03
Class03
 
Data types
Data typesData types
Data types
 
Representation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarRepresentation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.Sivakumar
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Data
 
digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointdigital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed point
 
IEEE floating point representation
 IEEE floating point representation IEEE floating point representation
IEEE floating point representation
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004
 
Number systems r002
Number systems  r002Number systems  r002
Number systems r002
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
data representation
 data representation data representation
data representation
 
Code conversion r006
Code conversion r006Code conversion r006
Code conversion r006
 
Number system
Number systemNumber system
Number system
 
Slide03 Number System and Operations Part 1
Slide03 Number System and Operations Part 1Slide03 Number System and Operations Part 1
Slide03 Number System and Operations Part 1
 
09 Arithmetic
09  Arithmetic09  Arithmetic
09 Arithmetic
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 

Similar to IEEE Floating Point

International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentIJERD Editor
 
number system: Floating Point representation.ppt
number system: Floating Point representation.pptnumber system: Floating Point representation.ppt
number system: Floating Point representation.pptNARENDRAKUMARCHAURAS1
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcAbhishek Rajpoot
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
Fast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseFast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseJohn Cook
 
Computer Representation of Numbers and.pptx
Computer Representation of Numbers and.pptxComputer Representation of Numbers and.pptx
Computer Representation of Numbers and.pptxTemesgen Geta
 
Lesson 1 basic theory of information
Lesson 1   basic theory of informationLesson 1   basic theory of information
Lesson 1 basic theory of informationRoma Kimberly Erolin
 
Lesson 1 basic theory of information
Lesson 1   basic theory of informationLesson 1   basic theory of information
Lesson 1 basic theory of informationRoma Kimberly Erolin
 
Computer Oraganizaation.pptx
Computer Oraganizaation.pptxComputer Oraganizaation.pptx
Computer Oraganizaation.pptxbmangesh
 
Floating point representation and arithmetic
Floating point representation and arithmeticFloating point representation and arithmetic
Floating point representation and arithmeticAvirajKaushik
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartTanjarul Islam Mishu
 
Implementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesImplementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesغزالة
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptskatiarrahaman
 

Similar to IEEE Floating Point (20)

International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
 
number system: Floating Point representation.ppt
number system: Floating Point representation.pptnumber system: Floating Point representation.ppt
number system: Floating Point representation.ppt
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
 
1.2 matlab numerical data
1.2  matlab numerical data1.2  matlab numerical data
1.2 matlab numerical data
 
Floating point arithmetic
Floating point arithmeticFloating point arithmetic
Floating point arithmetic
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Fast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseFast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverse
 
Computer Representation of Numbers and.pptx
Computer Representation of Numbers and.pptxComputer Representation of Numbers and.pptx
Computer Representation of Numbers and.pptx
 
Lesson 1 basic theory of information
Lesson 1   basic theory of informationLesson 1   basic theory of information
Lesson 1 basic theory of information
 
Lesson 1 basic theory of information
Lesson 1   basic theory of informationLesson 1   basic theory of information
Lesson 1 basic theory of information
 
Counit2
Counit2Counit2
Counit2
 
Computer Oraganizaation.pptx
Computer Oraganizaation.pptxComputer Oraganizaation.pptx
Computer Oraganizaation.pptx
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Es272 ch2
Es272 ch2Es272 ch2
Es272 ch2
 
Floating point representation and arithmetic
Floating point representation and arithmeticFloating point representation and arithmetic
Floating point representation and arithmetic
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchart
 
Ieee+floating
Ieee+floatingIeee+floating
Ieee+floating
 
Implementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesImplementation of character translation integer and floating point values
Implementation of character translation integer and floating point values
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
 

More from Jason Ricardo Thomas (8)

English demo lesson
English demo lessonEnglish demo lesson
English demo lesson
 
SDA Fundamental Belief #10 - The Experience of Salvation
SDA Fundamental Belief #10 - The Experience of SalvationSDA Fundamental Belief #10 - The Experience of Salvation
SDA Fundamental Belief #10 - The Experience of Salvation
 
SDA Fundamental Belief #8 : The Great Controversy
SDA Fundamental Belief #8 : The Great ControversySDA Fundamental Belief #8 : The Great Controversy
SDA Fundamental Belief #8 : The Great Controversy
 
The GodHead
The GodHeadThe GodHead
The GodHead
 
Gospel of Mark
Gospel of MarkGospel of Mark
Gospel of Mark
 
God The Son
God The SonGod The Son
God The Son
 
Our beliefs
Our beliefsOur beliefs
Our beliefs
 
Crm & you
Crm & youCrm & you
Crm & you
 

Recently uploaded

week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 

Recently uploaded (20)

week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 

IEEE Floating Point

  • 1. IEEE 754 Standard for Floating Point Representation of Real Numbers. There are four pieces of info to be represented: Sign of the number (Always the high order bit; 0=positive, 1=negative.) Magnitude of the number (Stored in binary with leading "1" understood. See below.) Sign of the exponent (Stored as an offset "bias" on value of exponent. See below.) Magnitude of the exponent. (Stored as unsigned binary added to offset bias.) I. Float. (32 bits) Binary template: SEEE EEEE EMMM MMMM ... MMMM where S = sign bit, E = exponent bits (8 of these), M = mantissa bits (23 of these). Process to represent: A. Convert decimal number to binary. B. Move radix point to 1.xxx... * 2^exp representation. C. Now, do the work: i. S. Assign the sign bit. positive --> 0, negative --> 1. ii. Assign the mantissa. This is the fractional part of the value of the number. --ignore the leading "1". It is always 1 in this scientific notation, so there is no need to store it. The system will re-insert it later when the number is used. --form the 23 MMM...MMM bits from the first 23 of the remaining "xxx..." bits above. If there are not 23 of them, fill out with trailing zeros. iii. The exponent "exp" may be positive or negative. Float is stored with excess-127 notation. That is, you ADD 127 to your exponent and store as a pure (unsigned) binary. When the number is re-created for use later, 127 will be subtracted from the exponent. This method saves having to use 2's complement for negative exponents. iv: Combine in recipe SEEEEEEEEMMMM...MMM format. Example: Find the representation of decimal -10.5 in float IEEE-754 representation. A. Convert the number: -10.5 decimal --> -1010.1 binary B. Move radix to get scientific notation: -1010.1 binary --> -1.0101 * 2^(+3) (binary) C. Now, do the work: i. Sign bit will be 1 since the number is negative. ii. Mantissa. (101010000...0) Ignore leading one: 01010000...0 Use first 23 bits: 01010000000000000000000 -->This is mantissa.
  • 2. iii. Exponent is +3. ADD excess-127 offset: 127 + (+3) = 130 decimal = 10000010 binary. These are the 8 bits for the exponent: 10000010. D. Combine in SEEEEEEEEMMMMMMMMMMMMMMMMMMMMMMM format: 11000001001010000000000000000000 To make it easier to read, group in 4's and convert each group to hex: original grouped: 11000001001010000000000000000000 1100 0001 0010 1000 0000 0000 0000 0000 C 1 2 8 0 0 0 0 binary binary hex or, C128 0000 hex II. double. The process to convert to "double" is similar to "float": 1. a total of 64 bits are used to represent the number. 2. The sign bit still is one digit, always the high order digit. 3. The mantissa is stored with 52 bits instead of 23. This gives doubles greater precision. 4. The exponent is stored with 11 bits instead of 8. This gives doubles a wider range of representable numbers. Example: Decimal +10.5 --> 0100 0000 0010 0101 0000 ... 0000 binary (64 bits) 4025 0000 0000 0000 hex