0% found this document useful (0 votes)
57 views19 pages

COA - UNIT 2 - Floating Point Arithmetic 1

This document discusses floating point arithmetic. It explains that floating point numbers represent fractional values with a radix point that can vary in position, unlike fixed point numbers where the radix point is fixed. It then provides examples of how moving the radix point affects a number's value. The document goes on to describe the IEEE 754 standard for 32-bit single precision floating point numbers and the need to align exponents before performing arithmetic operations on floating point values. It concludes by outlining the steps for floating point addition and subtraction.

Uploaded by

Devika csbs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views19 pages

COA - UNIT 2 - Floating Point Arithmetic 1

This document discusses floating point arithmetic. It explains that floating point numbers represent fractional values with a radix point that can vary in position, unlike fixed point numbers where the radix point is fixed. It then provides examples of how moving the radix point affects a number's value. The document goes on to describe the IEEE 754 standard for 32-bit single precision floating point numbers and the need to align exponents before performing arithmetic operations on floating point values. It concludes by outlining the steps for floating point addition and subtraction.

Uploaded by

Devika csbs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

COA UNIT 2

FLOATING POINT ARITHMETIC


Floating/Fractional Point Numbers

 To handle fractional quantities.


 Fixed point/Integer numbers - the position of this radix point is
fixed.
 Floating point numbers – the radix point is not fixed in a
particular position.
Representing Fractional Numbers
Examples

• If you move the radix point to the left, it means - divide by 2


• If you move the radix point to the right, it means - multiply by 2
• If you have a number of this form 0.11111, it means the value is less than 1
Limitations
IEEE 754 Representation
(32-bit / Single precision format)

Example:
IEEE 754 Representation
(32-bit / Single precision format)

Example:
Exponent alignment
Exponent alignment

 Ifthe exponents don't match, we can't simply add the mantissa


together while adding floating point numbers
 So, adjust one of the exponents to match the other.
 For that, make the smaller exponent match the larger one.
 Itcan be done by moving the decimal point to the left or right to make the exponents the
same (E1==E2) i.e., move the bit positions(larger exponent – smallest
exponent, E1-E2 or E2-E1) left or right and,
increase or decrease the exponent by E1-E2 or E2-E1 to compensate.
Floating point binary
addition/Subtraction

 Make sure that both numbers are normalized


 Make the exponents the same
 Add/Sub the mantissa together and
 Normalize the result, if necessary.
Floating point addition example

You might also like