Floating Point to Fixed Point Converter

This page provides information about floating point to fixed point conversion and vice versa, along with example calculations.

Floating Point to Fixed Point Conversion

Inputs

Outputs

Here’s an example demonstrating the conversion from a floating-point number to a fixed-point number:

EXAMPLE:

INPUTS:

  • Floating Point Number = 1.5
  • Q format = 8

OUTPUT:

  • Fixed Point Number = 384

Fixed Point to Floating Point Conversion

Inputs

Outputs

Now, let’s look at an example showing how to convert from a fixed-point number back to a floating-point number:

EXAMPLE:

INPUTS:

  • Fixed Point Number = 512
  • Q format = 10

OUTPUT:

  • Floating Point Number = 0.5

Conversion Formula

Below is an illustration of the formula used for floating point versus fixed point conversions.

floating point vs fixed point converter equationimport FixedPointToFloatingPointCalculator from ”./elements/FixedPointToFloatingPointCalculator.astro”; import FloatingToFixedCalculator from ”./elements/FloatingToFixedCalculator.astro”;