SlideShare ist ein Scribd-Unternehmen logo
1 von 8
QUICK TUTORIAL ON IEEE 754
FLOATING POINT REPRESENTATION
-by
RITU RANJAN SHRIVASTWA
Decimal to IEEE 754 Floating point
representation
There are 32 bits in Standard IEEE 754 representation of floating point numbers in binary and
is divided into three parts namely:
• Sign bit
• Exponent
• Mantissa
The representation in bit format is as follows
Sign bit
1 or 0

EXPONENT
8 bits

MANTISSA
23 bits

To be represented in this format, a number should be in the following normalized form.
(+ or -) 1.(mantissa) x 2^(exponent)
Sometimes in question it asks not to convert in normalized form, otherwise it should be
converted to its normalized form
Decimal to IEEE 754 Floating point
representation
To convert a number into its normalized form, we need to do the following:
For example, we will take the decimal number +4.6
We see that the number before decimal is not equal to 1 which means we need to convert it
into normalized form and bring 1 there. To do this, we need to keep dividing it by 2 till we get
the normalized form with just 1 left before decimal.
This means
4.6 / 2
2.3 / 2

= 2.3
= 1.15

Hence we get the normalized form and we can write
+4.6  1.15 x 22
Now we will represent this using IEEE 754 standard
Decimal to IEEE 754 Floating point
representation
We have +1.15 x 22 to represent
1. The sign bit will be ‘0’ as the number is positive
2. The exponent will be 127+2=129 (here we are using 127 as bias value because, the 8 bit
exponent part can accommodate 256 values i.e., 0-255. In this range we need to display
both positive and negative powers, thus we use the first 128 numbers(0-127) to denote
negative power and next 128(128-255) for positive power. Thus unless mentioned as
Excess-128 or Excess-64, we will use 2n-1 as the Bias value where n is the number of bits
in the exponent part.) Hence, if the power had been negative, then the exponent value
would have been
127+(-2) = 127-2 = 125
3. Since we have got our sign bit, and exponent, lets fill them up in the bit pattern.
0

10000001
12910  100000012

MANTISSA
23 bits
Decimal to IEEE 754 Floating point
representation
Now we need to find out the mantissa part.
First of all, not that the ‘1’ is NOT represented in the bit pattern since it is in the normalized
form, it is known that the ‘1’ will exist. Thus in the mantissa part only the decimal part i.e.,
(0.15) need to be represented.
Let us convert the 0.15 to binary
0.15 x 2 = 0.3 0
0.3 x 2 = 0.6
0
0.6 x 2 = 1.2
1
(i)
0.2 x 2 = 0.4
0
0.4 x 2 = 0.8
0
0.8 x 2 = 1.6
1
(ii)
Now the value from (i) till (ii) will continue to recur and we will keep recurring it till 23 bits
are filled.
Thus the bits obtained are 00100110011001100110011
Hence the bit pattern in the 32 bit format are
0

10000001

00100110011001100110011

 (40933333)16
EXAMPLE PROBLEM

NOTE : In this question,
The total no of bits is only
16. They have given the
bias as 64, where it
should be 63, so you
need to use 64. And also,
the given number need
not be converted into its
normal form
IEEE 754 Floating point to Decimal
conversion
You need to do just the reverse of the above which is very simple.
For example:
Given Binary representation: 11000001101111110……0
Thus we will break it into three parts as:
1

10000011

01111110000000000000000

We clearly see that the number is negative and the power is 131-127 = 4
Mantissa is: 2-1x0 + 2-2x1 + 2-3x1 + 2-4x1 + 2-5x1 + 2-6x1 + 2-7x1 = 0.4921875
The number is -1.4921875 x 24 [note the ‘1’ is added before the 0 in the normal fom]
Which is equal to -23.875
ANS: -23.875
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartTanjarul Islam Mishu
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbersMOHAN MOHAN
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Chap ii.BCD code,Gray code
Chap ii.BCD code,Gray codeChap ii.BCD code,Gray code
Chap ii.BCD code,Gray codeBala Ganesh
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithmGaurav Subham
 
Restoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarRestoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarSania Nisar
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbersKiriti Varkur
 
Booths Multiplication Algorithm
Booths Multiplication AlgorithmBooths Multiplication Algorithm
Booths Multiplication Algorithmknightnick
 
Parity Generator and Parity Checker
Parity Generator and Parity CheckerParity Generator and Parity Checker
Parity Generator and Parity CheckerJignesh Navdiya
 

Was ist angesagt? (20)

1s and 2s complement
1s and 2s complement1s and 2s complement
1s and 2s complement
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchart
 
Fixed point and floating-point numbers
Fixed point and  floating-point numbersFixed point and  floating-point numbers
Fixed point and floating-point numbers
 
Binary codes
Binary codesBinary codes
Binary codes
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Chap ii.BCD code,Gray code
Chap ii.BCD code,Gray codeChap ii.BCD code,Gray code
Chap ii.BCD code,Gray code
 
Bcd
BcdBcd
Bcd
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Restoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania NisarRestoring & Non-Restoring Division Algorithm By Sania Nisar
Restoring & Non-Restoring Division Algorithm By Sania Nisar
 
Complements of numbers
Complements of numbersComplements of numbers
Complements of numbers
 
What is Gray Code?
What is Gray Code? What is Gray Code?
What is Gray Code?
 
Codes
CodesCodes
Codes
 
Booths Multiplication Algorithm
Booths Multiplication AlgorithmBooths Multiplication Algorithm
Booths Multiplication Algorithm
 
Floating Point Numbers
Floating Point NumbersFloating Point Numbers
Floating Point Numbers
 
Synchronous Counter
Synchronous Counter Synchronous Counter
Synchronous Counter
 
Parity Generator and Parity Checker
Parity Generator and Parity CheckerParity Generator and Parity Checker
Parity Generator and Parity Checker
 
Complement
ComplementComplement
Complement
 

Andere mochten auch

Floating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAFloating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAAzhar Syed
 
Design and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogDesign and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogSTEPHEN MOIRANGTHEM
 
Bit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBhargavKatkam
 
floating point multiplier
floating point multiplierfloating point multiplier
floating point multiplierBipin Likhar
 
implementation and design of 32-bit adder
implementation and design of 32-bit adderimplementation and design of 32-bit adder
implementation and design of 32-bit adderveereshwararao
 
Alu design-project
Alu design-projectAlu design-project
Alu design-projectalphankg1
 
Wallace tree multiplier.pptx1
Wallace tree multiplier.pptx1Wallace tree multiplier.pptx1
Wallace tree multiplier.pptx1vamshi krishna
 
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...Saikiran Panjala
 
Wallace tree multiplier
Wallace tree multiplierWallace tree multiplier
Wallace tree multiplierSudhir Kumar
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Rahul Borthakur
 
Microsoft GDI+ JPEG Integer Underflow Vulnerability
Microsoft GDI+ JPEG Integer Underflow VulnerabilityMicrosoft GDI+ JPEG Integer Underflow Vulnerability
Microsoft GDI+ JPEG Integer Underflow VulnerabilityAshish Malik
 
Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...
Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...
Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...Silicon Mentor
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mcaEdhole.com
 
Decimal arithmetic in Processors
Decimal arithmetic in ProcessorsDecimal arithmetic in Processors
Decimal arithmetic in ProcessorsPeeyush Pashine
 

Andere mochten auch (20)

Floating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAFloating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGA
 
Design and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogDesign and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilog
 
Bit Serial multiplier using Verilog
Bit Serial multiplier using VerilogBit Serial multiplier using Verilog
Bit Serial multiplier using Verilog
 
floating point multiplier
floating point multiplierfloating point multiplier
floating point multiplier
 
implementation and design of 32-bit adder
implementation and design of 32-bit adderimplementation and design of 32-bit adder
implementation and design of 32-bit adder
 
Alu design-project
Alu design-projectAlu design-project
Alu design-project
 
Wallace tree multiplier.pptx1
Wallace tree multiplier.pptx1Wallace tree multiplier.pptx1
Wallace tree multiplier.pptx1
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
 
Wallace tree multiplier
Wallace tree multiplierWallace tree multiplier
Wallace tree multiplier
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Ver...
 
Array multiplier
Array multiplierArray multiplier
Array multiplier
 
Microsoft GDI+ JPEG Integer Underflow Vulnerability
Microsoft GDI+ JPEG Integer Underflow VulnerabilityMicrosoft GDI+ JPEG Integer Underflow Vulnerability
Microsoft GDI+ JPEG Integer Underflow Vulnerability
 
IEEE Floating Point
IEEE Floating PointIEEE Floating Point
IEEE Floating Point
 
Class10
Class10Class10
Class10
 
Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...
Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...
Design and Implementation of Single Precision Pipelined Floating Point Co-Pro...
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 
Decimal arithmetic in Processors
Decimal arithmetic in ProcessorsDecimal arithmetic in Processors
Decimal arithmetic in Processors
 

Ähnlich wie Quick tutorial on IEEE 754 FLOATING POINT representation

3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
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
 
Binary octal
Binary octalBinary octal
Binary octaldrdipo4
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
Number system and codes
Number system and codesNumber system and codes
Number system and codesAbhiraj Bohra
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).pptnamraashraf56
 
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
 
digital systems and information
digital systems and informationdigital systems and information
digital systems and informationKamran Zafar
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precisionnikhilarora2211
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawabAmmar_n
 
U1 - Code Conversion.pptx
U1 - Code Conversion.pptxU1 - Code Conversion.pptx
U1 - Code Conversion.pptxRamKumar612299
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfTamiratDejene1
 
data representation
 data representation data representation
data representationHaroon_007
 

Ähnlich wie Quick tutorial on IEEE 754 FLOATING POINT representation (20)

3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
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
 
Binary octal
Binary octalBinary octal
Binary octal
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Alu1
Alu1Alu1
Alu1
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
 
2's complement
2's complement2's complement
2's complement
 
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
 
digital systems and information
digital systems and informationdigital systems and information
digital systems and information
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precision
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
U1 - Code Conversion.pptx
U1 - Code Conversion.pptxU1 - Code Conversion.pptx
U1 - Code Conversion.pptx
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
09 Arithmetic
09  Arithmetic09  Arithmetic
09 Arithmetic
 
data representation
 data representation data representation
data representation
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Kürzlich hochgeladen (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Quick tutorial on IEEE 754 FLOATING POINT representation

  • 1. QUICK TUTORIAL ON IEEE 754 FLOATING POINT REPRESENTATION -by RITU RANJAN SHRIVASTWA
  • 2. Decimal to IEEE 754 Floating point representation There are 32 bits in Standard IEEE 754 representation of floating point numbers in binary and is divided into three parts namely: • Sign bit • Exponent • Mantissa The representation in bit format is as follows Sign bit 1 or 0 EXPONENT 8 bits MANTISSA 23 bits To be represented in this format, a number should be in the following normalized form. (+ or -) 1.(mantissa) x 2^(exponent) Sometimes in question it asks not to convert in normalized form, otherwise it should be converted to its normalized form
  • 3. Decimal to IEEE 754 Floating point representation To convert a number into its normalized form, we need to do the following: For example, we will take the decimal number +4.6 We see that the number before decimal is not equal to 1 which means we need to convert it into normalized form and bring 1 there. To do this, we need to keep dividing it by 2 till we get the normalized form with just 1 left before decimal. This means 4.6 / 2 2.3 / 2 = 2.3 = 1.15 Hence we get the normalized form and we can write +4.6  1.15 x 22 Now we will represent this using IEEE 754 standard
  • 4. Decimal to IEEE 754 Floating point representation We have +1.15 x 22 to represent 1. The sign bit will be ‘0’ as the number is positive 2. The exponent will be 127+2=129 (here we are using 127 as bias value because, the 8 bit exponent part can accommodate 256 values i.e., 0-255. In this range we need to display both positive and negative powers, thus we use the first 128 numbers(0-127) to denote negative power and next 128(128-255) for positive power. Thus unless mentioned as Excess-128 or Excess-64, we will use 2n-1 as the Bias value where n is the number of bits in the exponent part.) Hence, if the power had been negative, then the exponent value would have been 127+(-2) = 127-2 = 125 3. Since we have got our sign bit, and exponent, lets fill them up in the bit pattern. 0 10000001 12910  100000012 MANTISSA 23 bits
  • 5. Decimal to IEEE 754 Floating point representation Now we need to find out the mantissa part. First of all, not that the ‘1’ is NOT represented in the bit pattern since it is in the normalized form, it is known that the ‘1’ will exist. Thus in the mantissa part only the decimal part i.e., (0.15) need to be represented. Let us convert the 0.15 to binary 0.15 x 2 = 0.3 0 0.3 x 2 = 0.6 0 0.6 x 2 = 1.2 1 (i) 0.2 x 2 = 0.4 0 0.4 x 2 = 0.8 0 0.8 x 2 = 1.6 1 (ii) Now the value from (i) till (ii) will continue to recur and we will keep recurring it till 23 bits are filled. Thus the bits obtained are 00100110011001100110011 Hence the bit pattern in the 32 bit format are 0 10000001 00100110011001100110011  (40933333)16
  • 6. EXAMPLE PROBLEM NOTE : In this question, The total no of bits is only 16. They have given the bias as 64, where it should be 63, so you need to use 64. And also, the given number need not be converted into its normal form
  • 7. IEEE 754 Floating point to Decimal conversion You need to do just the reverse of the above which is very simple. For example: Given Binary representation: 11000001101111110……0 Thus we will break it into three parts as: 1 10000011 01111110000000000000000 We clearly see that the number is negative and the power is 131-127 = 4 Mantissa is: 2-1x0 + 2-2x1 + 2-3x1 + 2-4x1 + 2-5x1 + 2-6x1 + 2-7x1 = 0.4921875 The number is -1.4921875 x 24 [note the ‘1’ is added before the 0 in the normal fom] Which is equal to -23.875 ANS: -23.875