0% found this document useful (0 votes)
16 views3 pages

Floating Point Representation

Floating-point representation allows computers to efficiently store real numbers using a format similar to scientific notation, primarily following the IEEE 754 standard. This standard divides a number into three parts: sign bit, exponent, and mantissa, with specific bit allocations for single and double precision. Examples illustrate the conversion of decimal numbers to their IEEE 754 binary and hexadecimal representations.

Uploaded by

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

Floating Point Representation

Floating-point representation allows computers to efficiently store real numbers using a format similar to scientific notation, primarily following the IEEE 754 standard. This standard divides a number into three parts: sign bit, exponent, and mantissa, with specific bit allocations for single and double precision. Examples illustrate the conversion of decimal numbers to their IEEE 754 binary and hexadecimal representations.

Uploaded by

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

Floating-Point Representation of Numbers

Introduction
Floating-point representation is a way to store real numbers in a computer's memory using a
format similar to scientific notation. This representation allows computers to handle very
large and very small numbers efficiently.
IEEE 754 Floating-Point Standard
The most commonly used standard for floating-point representation is the IEEE 754
standard. This standard divides a floating-point number into three parts:
1. Sign Bit (S): 1 bit that indicates the sign of the number.
o 0 for positive numbers.
o 1 for negative numbers.
2. Exponent (E): Determines the scaling factor of the number.
o Single Precision (32-bit) uses 8 bits for the exponent.
o Double Precision (64-bit) uses 11 bits for the exponent.
o The exponent is stored with a bias (127 for single precision, 1023 for double
precision).
o The exponent allows the floating-point number to represent very large and
very small values by adjusting the position of the decimal point.
3. Mantissa (M): Stores the significant digits of the number.
o Single Precision has 23 bits for the mantissa.
o Double Precision has 52 bits for the mantissa.
o The mantissa represents the precise value of the number, with an implicit
leading 1 in normalized representation.
o The more bits used in the mantissa, the more precise the number is.
A floating-point number is represented as:

(−𝟏)𝒔 × 𝑴 × 𝟐𝑬
Step-by-Step Example: 5.75
We already know that:
5.7510=(101.11)2
1. Normalize the number
o We shift the binary point to get the 1.yyy form:
o 1.0111×22
o The 1 before the decimal is always there (so we don't store it).
o The remaining 0111 is our mantissa.
2. Fill to 23 Bits
o The mantissa must be 23 bits long. So we add extra zeros:
o 01110000000000000000000
Another Example: 0.15625
1. Convert to binary:
o 0.1562510=0.001012
2. Normalize:
o 1.01×2−3
3. Mantissa (without the leading 1):
o 01000000000000000000000
Floating-Point Representation Format (Single Precision - 32-bit)

Sign Bit (1 bit) Exponent (8 bits) Mantissa (23 bits)

Examples of IEEE 754 Representation


Example 1: Representing 5.75 in IEEE 754 (Single Precision - 32-bit)
1. Convert to binary:
o 5.7510=101.112
o Normalize: 1.0111×22
2. Find components:
o Sign bit: 0 (positive number)
o Exponent: 2+127=129→ 10000001
o Mantissa: 01110000000000000000000 (drop the leading 1)
3. Final IEEE 754 representation:
4. 0 10000001 01110000000000000000000
Hexadecimal representation: 0x40B80000
Example 2: Representing -0.75
1. Convert to binary:
o 0.7510=0.112
o Normalize: 1.1×2−1
2. Find components:
o Sign bit: 1 (negative number)
o Exponent: −1+127=126→ 01111110
o Mantissa: 10000000000000000000000
3. Final IEEE 754 representation:
4. 1 01111110 10000000000000000000000
Hexadecimal representation: 0xBE400000

You might also like