0% found this document useful (0 votes)
13 views

CS302 Assignment 01 Solution

Uploaded by

asif
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

CS302 Assignment 01 Solution

Uploaded by

asif
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Solution

Step 1: IEEE 754 Format Overview


A 32-bit IEEE 754 floating-point number consists of three main parts:
- **Sign bit (1 bit)**: Determines if the number is positive (0) or negative (1).
- **Exponent (8 bits)**: Encodes the exponent with a bias of 127.
- **Mantissa/Fraction (23 bits)**: Encodes the significant digits (fraction) of the number.

The formula for conversion to decimal is:


Value = (-1)^sign × 2^(exponent - 127) × (1.mantissa)

Step 2: Identify Each Component from the Binary String


Given the binary number:
11111111111111111111111111111111

1. **Sign bit**: The first bit is 1, indicating the number is negative.


2. **Exponent**: The next 8 bits are all 1's (11111111). An exponent of all 1's usually
indicates a special value:
- If the mantissa is all 0's, the number represents infinity (positive or negative based on
the sign bit).
- If the mantissa is not all 0's, the value represents NaN (Not a Number).

3. **Mantissa**: The remaining 23 bits are all 1's, which indicates a NaN.

Step 3: Interpret the Result


Since both the exponent and mantissa contain only 1's, this binary floating-point number
represents **NaN (Not a Number)** under the IEEE 754 standard.

Final Answer
The 32-bit binary floating-point number '11111111111111111111111111111111'
translates to **NaN** in decimal form.

You might also like