Package: float_pkg

Constants

Name Type Value Description
float_exponent_width NATURAL 8
float_fraction_width NATURAL 23
float_round_style round_type round_nearest Rounding algorithm, "round_nearest" is default, other valid values are "round_zero" (truncation), "round_inf" (round up), and "round_neginf" (round down)
float_denormalize BOOLEAN true Denormal numbers (very small numbers near zero) true or false
float_check_error BOOLEAN true Turns on NAN processing (invalid numbers and overflow) true of false
float_guard_bits NATURAL 3 Guard bits are added to the bottom of every operation for rounding. any natural number (including 0) are valid.
no_warning BOOLEAN (false ) If TRUE, then turn off warnings on "X" propagation

Types

Name Type Description
UNRESOLVED_float array (INTEGER range <>) of STD_ULOGIC main type
valid_fpstate (nan,
-- Signaling NaN (C FP_NAN) quiet_nan,
-- Quiet NaN (C FP_NAN) neg_inf,
-- Negative infinity (C FP_INFINITE) neg_normal,
-- negative normalized nonzero neg_denormal,
-- negative denormalized (FP_SUBNORMAL) neg_zero,
-- -0 (C FP_ZERO) pos_zero,
-- +0 (C FP_ZERO) pos_denormal,
-- Positive denormalized (FP_SUBNORMAL) pos_normal,
-- positive normalized nonzero pos_inf,
-- positive infinity isx)
--------------------------------------------------------------------------- The 128 bit floating point number is "long double" in C (on some systems this is a 70 bit floating point number) and FLOAT32 in Fortran. The exponent is 15 bits wide and the fraction is 112 bits wide. This number can handle approximately 33 decimal digits. Infinity is 2*32,767 in this number system. --------------------------------------------------------------------------- purpose: Checks for a valid floating point number

Functions

Description
deferred constant
Returns the class which X falls into

Description
Basic parameter list
round_style - Selects the rounding algorithm to use
guard - extra bits added to the end if the operation to add precision
check_error - When "false" turns off NAN and overflow checks
denormalize - When "false" turns off denormal number processing

Description
reciprocal

Description
Multiply accumulate result = l*r + c

Description
Square root (all 754 based implementations need this)

Description

compare functions
=, /=, >=, <=, <, >, maximum, minimum

Description
conversion functions
Converts one floating point number into another.

Description
Converts an fp into an SLV (needed for synthesis)

Description
Converts an fp into an std_ulogic_vector (sulv)

Description
std_ulogic_vector to float

Description
Integer to float

Description
real to float

Description
unsigned to float

Description
signed to float

Description
unsigned fixed point to float

Description
signed fixed point to float

Description
size_res functions
Integer to float

Description
real to float

Description
unsigned to float

Description
signed to float

Description
sulv to float

Description
unsigned fixed point to float

Description
signed fixed point to float

Description
float to unsigned

Description
float to signed

Description
purpose: Converts a float to unsigned fixed point

Description
float to signed fixed point

Description
size_res versions
float to unsigned

Description
float to signed

Description
purpose: Converts a float to unsigned fixed point

Description
float to signed fixed point

Description
float to real

Description
float to integer

Description
For Verilog compatability

Description
Maps metalogical values

Description
These two procedures were copied out of the body because they proved
very useful for vendor specific algorithm development
Break_number converts a floating point number into it's parts
Exponent is biased by -1

Description
Normalize takes a fraction and and exponent and converts them into
a floating point number. Does the shifting and the rounding.
Exponent is assumed to be biased by -1

Description
Exponent is assumed to be biased by -1

Description
Exponent is assumed to be biased by -1

Description
minimum and maximum overloads

Description
Reduction operators, same as numeric_std functions

Description

Note: "sla", "sra", "sll", "slr", "rol" and "ror" not implemented.

returns x with the sign of y.

Description
Returns y * 2n for integral values of N without computing 2n

Description
Returns y * 2n for integral values of N without computing 2n

Description
returns the unbiased exponent of x

Description
returns the next representable neighbor of x in the direction toward y

Description
Returns TRUE if X is unordered with Y.

Description
Function to return constants.

Description
size_res versions

Description
===========================================================================
string and textio Functions
===========================================================================
rtl_synthesis off
pragma synthesis_off
writes S:EEEE:FFFFFFFF

Description
width of field
Reads SEEEEFFFFFFFF, "." and ":" are ignored

Description
width of field
Octal read with padding, no separators used

Description
Hex write with padding, no separators

Description
width of field
Hex read with padding, no separators used

Description
returns "S:EEEE:FFFFFFFF"

Description
Returns a HEX string, with padding

Description
Returns and octal string, with padding

Description
rtl_synthesis on
pragma synthesis_on
IN VHDL-2006 std_logic_vector is a subtype of std_ulogic_vector, so these
extra functions are needed for compatability.

Description
For Verilog compatability