Floating Point to Fixed Point Converter
Advertisement
This page provides information about floating point to fixed point conversion and vice versa, along with example calculations.
Floating Point to Fixed Point Conversion
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
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.

Where:
- Q format = Number of fractional bits
- Fixed Point Number = Integer representation of the number in fixed-point format
- Floating Point Number = Decimal representation of the number in floating-point format
- 2 ^ Q format = Scaling factor based on the Q format
In digital signal processing (DSP), embedded systems, and hardware design, numerical data is often represented in either floating point or fixed point formats. Floating point representation is widely used in general purpose computing because it supports a large dynamic range and high precision. However, floating point arithmetic requires more hardware resources and power consumption, making it less suitable for low power embedded systems.
Fixed point representation, on the other hand, stores numbers with a predefined number of fractional bits. It is faster, more power efficient, and commonly used in microcontrollers, FPGA designs, and real time DSP applications. Therefore, converting between floating point and fixed point formats is essential when optimizing algorithms for embedded hardware.
A Floating Point to Fixed Point Converter transforms real valued floating numbers into fixed point format, while a Fixed Point to Floating Point Converter restores fixed point values back to floating point representation for analysis or visualization.
Additional Information
References
- Floating Point Representation - Wikipedia
- Fixed Point Representation - Wikipedia
- Q Format - Embedded.com
- Fixed Point vs Floating Point - GeeksforGeeks
Advertisement
RF