This document describes the conversion process between fixed-point and floating-point representations. The system supports various data sizes and facilitates bidirectional conversion.
There are two primary applications:
- Fixed to Floating-Point Conversion
- Floating-Point to Fixed Conversion
Each application supports the following sizes:
- Floating-Point Sizes: 32-bit, 64-bit, 80-bit
- Fixed-Point Sizes (Integer & Fraction): 16-bit, 32-bit, 40-bit
- 1st Byte: Application (2 bits), Size (3 bits), Packet (3 bits)
- Application: 1 (Floating-Point to Fixed), 2 (Fixed to Floating-Point)
- Size:
- 1 (2 bytes integer & fraction, 4 bytes floating-point)
- 2 (4 bytes integer & fraction, 8 bytes floating-point)
- 3 (5 bytes integer & fraction, 10 bytes floating-point)
- Packet: Packet 1, Packet 2
- 2nd - 5th Byte: Input Data (Integer, Fraction, Floating-Point)
This conversion transforms a fixed-point integer and fraction into a floating-point representation.
Input packet :-
Ouput packet :-
- Application Selection, Size & Packet: First packet:
88
- Application:
2 (2'b10)
- Size:
1 (3'b001)
- Packet:
0 (3'b000)
- Application:
- Input: 2 bytes (integer & fraction)
- Data: 2 bytes (integer), 2 bytes (fraction), 1 byte (reserved)
- Output: 4 bytes (floating point)
- Data: 4 bytes (floating point), 1 byte (reserved)
Input Details
- Decimal Value:
28.6528
- Integer Part:
28
→ Hex:00 1c
- Fractional Part:
0.6528
→ Hex:a7 90
The input data is structured as follows:
Input packet: 88 00 1c a7 90 00
88
→ Header/Identifier(application,size & packet)00 1c
→ Integer representation (28
)a7 90
→ Fractional representation (0.6528
)00
→ Reserved
The output data packet is structured as follows:
Output Packet: 88 41 E5 3C 80 00
88
→ Header/Identifier(application,size & packet)41 e5 3c 80
→ Floating-point representation of28.6528
00
→ Reserved
Input packet :-
Ouput packet :-
- Application Selection, Size & Packet:
- First packet:
91
, Second packet:92
- Application:
2 (2'b10)
- Size:
2 (3'b010)
- Packet:
1,2 (3'b001, 3'b010)
- First packet:
- Input: 4 bytes (integer & fraction)
- Data Packet 1: 4 bytes (integer), 1 byte (reserved)
- Data Packet 2: 4 bytes (fraction), 1 byte (reserved)
- Output: 8 bytes (floating point)
- Data Packet 1: 5 bytes (floating point)
- Data Packet 2: 3 bytes (floating point), 1 byte (reserved)
Input packet1: 91 00 00 00 1c 00
Input packet2: 92 a7 90 00 00 00
Output packet1: 91 40 3c a7 90 00
Output packet2: 92 00 00 00 00 00
Input packet :-
Ouput packet :-
- Application Selection, Size & Packet:
- First packet:
99
, Second packet:9a
- Application:
2 (2'b10)
- Size:
3 (3'b011)
- Packet:
1,2 (3'b001, 3'b010)
- First packet:
- Input: 5 bytes (integer & fraction)
- Data Packet 1: 5 bytes (integer)
- Data Packet 2: 5 bytes (fraction)
- Output: 10 bytes (floating point)
- Data Packet 1: 5 bytes (floating point)
- Data Packet 2: 5 bytes (floating point)
Input packet1: 99 00 00 00 00 1C
Input packet2: 9a a7 90 00 00 00
Output packet1: 99 40 03 ca 79 00
Output packet2: 9a 00 00 00 00 00
This conversion transforms a floating-point number into its fixed-point integer and fraction components.
Input packet :-
Ouput packet :-
- Application Selection, Size & Packet: First packet:
48
- Application:
1 (2'b01)
- Size:
1 (3'b001)
- Packet:
0 (3'b000)
- Application:
- Input: 4 bytes (floating point)
- Data: 4 bytes (floating point), 1 byte (reserved)
- Output: 2 bytes (integer & fraction)
- Data: 2 bytes (integer), 2 bytes (fraction), 1 byte (reserved)
Input Details
- Floation-point hex value:
41 e5 3c 80
The input data is structured as follows:
Input packet: 48 41 e5 3c 80 00
48
→ Header/Identifier(application,size & packet)41 E5 3C 80
→ Floating-point representation of28.6528
00
→ Reserved
The output data packet is structured as follows:
Output packet: 48 00 1c a7 90 00
48
→ Header/Identifir(application,size & packet)- Integer Part:
00 1c
→ Decimal:28
- Fractional Part:
a7 90
→ Decimal:0.6528
00
→ Reserved
Input packet :-
Ouput packet :-
- Application Selection, Size & Packet:
- First packet:
51
, Second packet:52
- Application:
1 (2'b01)
- Size:
2 (3'b010)
- Packet:
1,2 (3'b001, 3'b010)
- First packet:
- Input: 8 bytes (floating point)
- Data Packet 1: 5 bytes (floating point)
- Data Packet 2: 3 bytes (floating point), 2 bytes (reserved)
- Output: 4 bytes (integer & fraction)
- Data Packet 1: 4 bytes (integer), 1 byte (reserved)
- Data Packet 2: 4 bytes (fraction), 1 byte (reserved)
Input packet1: 51 40 3c a7 90 00
Input packet2: 52 00 00 00 00 00
Output packet1: 51 00 00 00 1c 00
Output packet2: 52 a7 90 00 00 00
Input packet :-
Ouput packet :-
- Application Selection, Size & Packet:
- First packet:
59
, Second packet:5a
- Application:
1 (2'b01)
- Size:
3 (3'b011)
- Packet:
1,2 (3'b001, 3'b010)
- First packet:
- Input: 10 bytes (floating point)
- Data Packet 1: 5 bytes (floating point)
- Data Packet 2: 5 bytes (floating point)
- Output: 4 bytes (integer & fraction)
- Data Packet 1: 5 bytes (integer)
- Data Packet 2: 5 bytes (fraction)
Input packet1: 59 40 03 ca 79 00
Input packet2: 5a 00 00 00 00 00
Output packet1: 59 00 00 00 00 1C
Output packet2: 5a a7 90 00 00 00