Floating-Point IP Cores User Guide

ID 683750
Date 7/31/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

15.5.1. ALTFP_CONVERT Design Example: Understanding the Simulation Results

The simulation waveform in this design example is not shown in its entirety. Run the design example files in the ModelSim* - Intel® FPGA Edition software to see the complete simulation waveforms.

This figure shows the expected simulation results in the ModelSim* - Intel® FPGA Edition software.

Figure 40. ALTFP_CONVERT Simulation Waveform

This design example implements a float-to-integer converter for converting double-precision floating-point format numbers to 64-bit integers. In this operation, the optional exception ports of overflow, underflow, and nan are available apart from the result[] port.

The latency for the float-to-integer operation is six clock cycles. Therefore, each conversion generates the output result six clock cycles after receiving the input value.

This table lists the inputs and corresponding outputs obtained from the simulation in the waveform.

Table 87.  Summary of Input Values and Corresponding Outputs
Time Event
0 ns, start-up dataa[] value: C394 AD22 761B 9EE5h

Output value: The result[] port displays 0 regardless of what the input value is. This value seen on the output port before the 6th clock cycle is merely due to the behavior of the system during start-up and should be disregarded.

55 ns Output value: FAD4 B762 7918 46C0h
150 ns dataa[] value: 000F 0000 5555 1111h

This value is a denormal number.

205 ns Denormal inputs are not supported and are forced to zero before conversion takes place.
300 ns dataa[] value: 5706 40CF OEC6 1176h
355 ns Output value: 7FFF FFFF FFFF FFFFh

Exception handling ports: overflow asserts.

The overflow flag is triggered because the width of the resulting integer is more than the maximum width allowed, and the value seen on the result[] port is the standard value used to represent a positive overflow number.

350 ns dataa[] value: C728 3147 8444 1F75h
405 ns Output value: 8000 0000 0000 0000h

Exception handling ports: overflow remains asserted.

This is a standard value to represent a negative overflow number.

400 ns dataa[] value: 145A 257C 895A B309h
455 ns Output value: 0000 0000h

Exception handling ports: underflow asserts.

The input value triggers the underflow port because the exponent of the input value is less than the exponent bias of 1023.

500 ns dataa[] value: FFFF 0000 DDDD 5555h

This value is a NaN.

555 ns Output value: 0000 0000h

Exception handling ports: nan asserts.