This Python project implements an IEEE-754 Binary-128 floating-point converter, supporting conversions between binary and decimal representations, and including handling of special cases (NaN, Infinity, Zero, and Denormalized).
The code utilizes the Tkinter library to provide a graphical user interface (GUI) for use interactions
Converts binary and decimal values to IEEE-754 Binary-128 binary and hexadecimal representations.
Correctly represents and identifies:
- NaN (Not a Number)
- Infinity (Positive and Negative)
- Zero (Positive and Negative)
- Denormalized numbers
Graphical User Interface:
- User-friendly Tkinter GUI for inputting values and displaying results.
Output Formats:
- Displays converted results in binary, hexadecimal, and special case representations.
Output Export
- Option to export conversion results in a .txt file.
- Python 3 (https://www.python.org/)
- Tkinter (Usually included in standard Python installations)
- Decimal (For high-precision decimal calculations) Install with
pip install tk
pip install decimal
- Download: Download or clone the project files from this GitHub repository.
- Install Dependencies: If you don't have the decimal module, install it using pip:
pip install decimal
- Run: Execute the main Python file:
python main.py
- Select Conversion Type: Choose between "Binary" or "Decimal" conversion using the radio buttons.
- Enter Values:
- Input Field: Enter the binary or decimal number you want to convert.
- Exponent Field: Enter the corresponding base-2 or base-10 exponent.
- Convert: Click the "Convert" button.
- Results: The converted output will be displayed:
- Binary Output: Full IEEE-754 Binary-128 representation.
- Hexadecimal Output: Hexadecimal representation of the floating-point value.
- Special Case: Identifies if the result falls into a special case category.
- Clear: Use the "Clear" button to reset the input fields.
- Export Output: Click the "Output as .txt" button to save conversion details.