FP→I Floating Point to Integer
| Library: | Floating Point Arithmetic |
Behavior
This component rounds the floating-point input to a signed 64-bit integer intermediate, then places the low Data Bits bits on the east output. The output is a signed two's-complement value.
- Round up
- Rounds toward positive infinity.
- Round down
- Rounds toward negative infinity.
- Round to nearest
- Rounds to the nearest integer; a halfway case is rounded toward positive infinity.
- Round to nearest, ties to even
- Rounds to the nearest integer; a halfway case is rounded to the even integer.
- Truncate
- Discards the fractional part, rounding toward zero.
NaN converts to zero and sets ERR to 1. Values above or below the signed 64-bit range, including positive and negative infinity, are limited to the corresponding 64-bit endpoint. If the selected output width is smaller than 64 bits, higher bits are discarded; neither saturation nor discarded bits set ERR.
An input containing unknown or error bits is converted to NaN.
Pins
- West edge (input, bit width matches Float size)
- The floating-point value to convert.
- East edge (output, bit width matches Data Bits)
- The low bits of the rounded signed integer result.
- South edge (output, bit width 1)
- ERR: 1 if the input is NaN; otherwise 0.
Attributes
- Data Bits
- The integer output width, from 1 to 64 bits.
- Float size
- The floating-point input width: 8, 16, 32, or 64 bits.
- Rounding mode
- Selects the rounding operation used before the result is reduced to the output width.
Poke Tool Behavior
None.
Text Tool Behavior
None.