Skip to content

This Repository was made in accordance to our MCO2 simulation project for CSARCH2 X22 which is to make a stand-alone IEEE-754 Binary-64 floating point converter. The project was made using Python as the PL using the tkinter library for the GUI.

License

Notifications You must be signed in to change notification settings

michhandreaa/CSARCH2-Binary64FloatingPointConverterSimulationProject

Repository files navigation

CSARCH2 X22 - Simulation Project

Contents

Introduction

About the App:

This simulation project is a stand-alone IEEE-754 Binary-64 Floating Point Converter. The project was made using Python and using tkinter library for the GUI.

Members:

  • Martinez, Michelle Andrea H.
  • Rojo, Kate Lynn M.
  • Romblon, Kathleen Mae V.
  • Tipon, Joshua Emmanuel G.

Task

Topic:

IEEE-754 Binary-64 floating point converter (including all special cases)

  • Input: (1) binary mantissa and base-2 (i.e., 101.01x25) (2) Decimal and base-10 (i.e. 65.0x103). Also should support special cases (i.e., NaN).
  • Output: (1) binary output with space between section (2) its hexadecimal equivalent (3) with option to output in text file.

Application platform:

  • Stand-alone with GUI (graphics user interface) using a library in python called tkinter

Programming language:

  • Python

How to Run the Program:

Step 1:

Run .bat file for easier downloading of the libraries used and to run the app

Step 2:

Try the app -- do different test cases

Step 3:

Print the result

Video Demonstration

Link to Video

Test cases:

Test Case 1: Positive binary mantissa and base-2

image

Test Case 2: Negative binary mantissa and base-2

image

Test Case 3: Positive decimal and base-10

image

Test Case 4: Negative decimal and base-10

image

Test Case 5: Binary Positive 0

image

Test Case 6: Binary Negative 0

image

Test Case 7: Decimal Positive 0

image

Test Case 8: Decimal Negative 0

image

Source Code

Link to source code

Analysis Writeup

  1. Error-catching different ways of writing positive numbers.
  • Although it sounds simple enough, one of the challenges that the team encountered while creating the app was the many different ways a user can write positive numbers. Thankfully, this problem was caught during the testing phase and solved by integrating it into the current data validation conditions.
  1. Implementing special cases
  • The hardest part that the team encountered was the implementation of special cases, although they may sound simple enough, given that these are values that have their own specific format. For some reason, it was difficult to catch these cases when we were following the process of converting to IEEE-754 Binary-64 format.
  1. Converting Decimal fractions to Binary
  • Another problem that the team encountered while creating the project was the proper way of converting decimal fractions to binary. During initial testing of the conversion, it seemed that the fraction converted correctly but looped multiple times. We tried converting the mantissa and the decimal exponent separately first, but this gave inaccurate results. Instead, we decided to transform the given decimal input so that the exponent in the scientific notation becomes 0, and this number will then be converted to binary and finally normalized.
  1. Converting Decimal exponent 10^n to its equivalent binary exponent 2m
  • The team was also challenged to convert the decimal exponent directly to its equivalent binary exponent. The team searched different math and CS forums for a formula, but most were derivations that resulted in an approximation. It would’ve been fine, given that the approximations were more or less close enough to the actual exact supposed conversion. Sadly, it greatly affected the answer, and thus, the team had to look for a more concrete solution, which ended up converting the whole thing into binary instead and then normalizing the result.
  1. Radio buttons using Tkinder
  • During the creation of the GUI, there was an agreement regarding the use of radio buttons to choose between binary and decimal input and how their respective text boxes and text must appear depending on which was clicked. This proved to be a bit tricky to implement since Tkinter was an old GUI library and wasn’t really intuitive.
  1. Implementing the normalization function
  • In implementing the normalization function, the group experienced a problem getting the expected exponent, as there were instances wherein the exponent outputs were lacking or in excess of 1. However, the team was able to resolve this issue through a bit of tinkering and analyzing.

About

This Repository was made in accordance to our MCO2 simulation project for CSARCH2 X22 which is to make a stand-alone IEEE-754 Binary-64 floating point converter. The project was made using Python as the PL using the tkinter library for the GUI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •