Single-precision (float32) instantiation of FLOAT_GENERIC_PKG.
- Use clause
-
library IEEE;
use IEEE.FLOAT_PKG.all; - Source
-
ieee/float_pkg.vhdlin the IEEE 1076 OSR, tag1076-2019
Apache License 2.0, © 2019 IEEE P1076 WG Authors - Length
- 55 lines
- VHDL revisions
- Added in 1076-2008; updated through 1076-2019
Overview
FLOAT_PKG is a single instantiation of
FLOAT_GENERIC_PKG
at single-precision IEEE-754 (8-bit exponent, 23-bit fraction), with
round-nearest rounding, denormals enabled, NaN/overflow processing on,
and 3 guard bits. Use it directly for float32 work;
instantiate FLOAT_GENERIC_PKG yourself for other precisions
(e.g. float64) or different rounding modes.
Per §16.11 of IEEE Std 1076-2019, the instantiation declaration here
represents the formal semantics of FLOAT_PKG; the actual
operator and conversion bodies live in
FLOAT_GENERIC_PKG’s
body.
What's defined here
- Generic instantiation
-
float_exponent_width => 8,float_fraction_width => 23,float_round_style => round_nearest,float_denormalize => true,float_check_error => true,float_guard_bits => 3,no_warning => false,fixed_pkg => IEEE.fixed_pkg - Underlying package
-
FLOAT_GENERIC_PKG- the generic package this is an instantiation of. - Related
-
FIXED_FLOAT_TYPES(rounding enums),FIXED_PKG(fixed-point peer used internally for some conversions)
VHDL source listing
docFile header
lines 1–42
-- -----------------------------------------------------------------
--
-- Copyright 2019 IEEE P1076 WG Authors
--
-- See the LICENSE file distributed with this work for copyright and
-- licensing information and the AUTHORS file.
--
-- This file to you under the Apache License, Version 2.0 (the "License").
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
--
-- Title : Floating-point package (Instantiated package declaration)
-- :
-- Library : This package shall be compiled into a library
-- : symbolically named IEEE.
-- :
-- Developers: Accellera VHDL-TC and IEEE P1076 Working Group
-- :
-- Purpose : This packages defines basic binary floating point
-- : arithmetic functions
-- :
-- Note : This package may be modified to include additional data
-- : required by tools, but it must in no way change the
-- : external interfaces or simulation behavior of the
-- : description. It is permissible to add comments and/or
-- : attributes to the package declarations, but not to change
-- : or delete any original lines of the package declaration.
-- : The package body may be changed only in accordance with
-- : the terms of Clause 16 of this standard.
-- :
-- --------------------------------------------------------------------
-- $Revision: 1220 $
-- $Date: 2008-04-10 17:16:09 +0930 (Thu, 10 Apr 2008) $
-- --------------------------------------------------------------------
library ieee;
package float_pkg is new IEEE.float_generic_pkg
generic map (
float_exponent_width => 8, -- float32'high
float_fraction_width => 23, -- -float32'low
float_round_style => IEEE.fixed_float_types.round_nearest, -- round nearest algorithm
float_denormalize => true, -- Use IEEE extended floating
float_check_error => true, -- Turn on NAN and overflow processing
float_guard_bits => 3, -- number of guard bits
no_warning => false, -- show warnings
fixed_pkg => IEEE.fixed_pkg
);
