From jose  Thu Oct 13 18:56:05 1994
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA20514; Thu, 13 Oct 94 18:56:05 PDT
Date: Thu, 13 Oct 94 18:56:05 PDT
From: jose (Jose Torres)
Message-Id: <9410140156.AA20514@vhdl.vhdl.org>
To: math@vhdl.org
Subject: 9/94 minutes from Math package meeting


VHDL MATH PACKAGE WORKING GROUP, P1076.2 

Minutes of meeting in Grenoble, 23 September 1994 


Present: Jose Torres, Synopsys (Chair), jose@synopsys.com 
	 Peter Sinander, European Space Agency (Minutes), psi@wd.estec.esa.nl 
	 Sylvie Hurat, Thomson-CSF, hurat@sctf.thomson.fr 
	 Adam Morawiec, Artemis/ECSI, Adam.Morawiec@imag.fr 

Next meeting: most probably at VIUF in November at Washington, DC, USA. 


1. INTRODUCTION

P1076.2 Working Group members are:
- J. Torres, Synopsys (Chair)
- C. Swart, Mentor Graphics
- A. Zamfirescu, Intergraph
- D. Hanson, University of Mississippi

The VHDL math packages consist of basic functions and type conversions for real 
and complex types, and will be placed in the IEEE library. There are two 
packages: MATH_REAL and MATH_COMPLEX. 

A testbench will be prepared for each package, but it will not formally be part 
of the standard just a reference (see further section 4).


2. NEW RELEASE OF MATH PACKAGE

A new release of the math package will be placed on the VI server in October. 
Several bugs were detected in the previous version, which have been corrected 
in the new version. The package is available through anonymous ftp from 
vhdl.org, in the directory /vi/math/package, file names are: 
	math_head.9.30.94.vhd
	math_body.9.30.94.vhd

The packages can be retrieved as follows:

ftp vhdl.org
username: anonymous
password: <your e-mail address>
ftp> cd /vi/math/package
ftp> get math_head.9.30.94.vhd
ftp> get math_body.9.30.94.vhd
ftp> bye


3. PLANNED ACTIVITIES

The work on the testbench is still in progress. There is a need for more effort 
in this task, and anybody that could provide help should contact Jose Torres.

The ballot constituency will take place in October/November, by invitation 
through the math package reflector as well as direct e-mail to certain persons. 

The balloting is planned for January 1995. 

The IEEE approval is currently foreseen for mid 1995. There is a possibility 
that Rita Clover will help with the preparation of the standard, which need to 
be written according to the IEEE standard format. 


4. IMPLEMENTATION DETAILS

The body of the math package is written in VHDL, though in most cases simulator 
vendors will implement it in C-code for optimized performance. 

The minimum precision is that of the VHDL LRM; minimum 6 bits precision in a 
range from -1E38 to 1E38 is required, but an implementation is allowed to 
provide higher precision.

Sylvie Hurat stressed the importance of a double precision version of the Math 
packages becoming available, since this is required for system simulations and 
analog VHDL. It is important that other WGs (particularly the analog WG) do not 
define their own packages. It is proposed to ballot the single-precision version
of the packages now, and later create a double precision version by overloading 
the funtions when the double precision data type is defined by the analog WG. 
No new functions should be added for the double precision versions. See further section 5. 

It was agreed at the meeting that the precision of the constants declared 
should at least cover the IEEE-754 double precision accuracy, i.e. 16 digits. 

It is required that the functions detect and report invalid parameters (out of 
range), but underflow/overflow detection is optional. The severity level can be 
defined by the user, with the default being Error. 

The package will be written to conform with both VHDL-1987 and VHDL-1993. 

4. TESTBENCHES AND VERIFICATION APPROACH 

The testbench, which is not part of the standard and will be provided as a 
reference only.  In principle, the test bench will exercise all data points 
for all the functions in each package, it will compare the outputs from an 
implementation against a set of "golden" outputs, and will produce a report
with differences found.  Final details on the process are still being worked
out.

It is important to note that the math package results may be slightly different
on different workstation combinations due to the workstations particular support
for floating point arithmetic, which may not be immediately apparent to the 
average VHDL user. However, since most workstations use the IEEE-754 floating 
point format the variations will be limited in practice.


5. OPEN ISSUES

Jose Torres has proposed to start the balloting process even though the 
testbenches have not been completed. This was considered as a practical 
approach by the meeting participants, since the testbench is not part of the 
standard. The final decision will be taken by the WG members.

It is desirable that all IEEE packages should report errors in a standardized 
way, so contact is necessary with the other IEEE WGs. The contents of the error 
messages should also be reviewed to be understandable and useful for the 
average VHDL user (and not only for numerical experts). 

The coordination with the analog WG is minimal, no formal feedback has yet been 
received from this WG. However, Sylvie Hurat who is following that WG stated 
that they have basically defined what functions they need. Another question is 
whether double precision reals will be called Real or renamed to a new type 
called Float. Jose Torres will contact J.-M. Berge or A. Vachoux to obtain 
formal comments from the analog WG.


6. MISCELLANEOUS

Jose Torres mentioned that the activity on the e-mail reflector has been low 
during the past months, but should increase with the event of the new release 
of the package and the balloting process. 

It was stated that no problems are expected with vendors adopting the Math 
packages, since this topic does not seem to be a controversial one and 
different vendors have provided input or offered a version of their own 
packages as a starting point for this standard. 

From jose@Synopsys.COM  Fri Oct 14 15:47:21 1994
Return-Path: <jose@Synopsys.COM>
Received: from chronos.synopsys.com by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA02527; Fri, 14 Oct 94 15:47:21 PDT
Received: from gaea.synopsys.com by chronos.synopsys.com with SMTP id AA21826
  (5.65c/IDA-1.4.4 for <math@vhdl.org>); Fri, 14 Oct 1994 15:43:25 -0700
Received: from jose.synopsys.com by gaea.synopsys.com with SMTP id AA28903
  (5.65c/IDA-1.4.4 for <math@vhdl.org>); Fri, 14 Oct 1994 15:43:23 -0700
Received: by jose.synopsys.com (4.1/SNPS-Sub02)
	id AA24261; Fri, 14 Oct 94 15:43:22 PDT
Date: Fri, 14 Oct 94 15:43:22 PDT
From: jose@Synopsys.COM (Jose Torres)
Message-Id: <9410142243.AA24261@jose.synopsys.com>
To: math@vhdl.org
Subject: vhdl math package (declaration)


------------------------------------------------------------------------
--
-- This source file may be used and distributed without restriction.
-- No declarations or definitions shall be included in this package. 
-- This package cannot be sold or distributed for profit.
--
--   ****************************************************************
--   *                                                              *
--   *                      W A R N I N G		 	    *
--   *								    *
--   *   This DRAFT version IS NOT endorsed or approved by IEEE     *
--   *								    *
--   ****************************************************************
--
-- Title:    PACKAGE MATH_REAL
--
-- Library:  This package shall be compiled into a library 
--           symbolically named IEEE.
--
-- Purpose:  VHDL declarations for mathematical package MATH_REAL
--	     which contains common real constants, common real
--	     functions, and real trascendental functions.
--
-- Author:   IEEE VHDL Math Package Study Group 
--
-- Notes:
-- 	The package body shall be considered the formal definition of 
-- 	the semantics of this package. Tool developers may choose to implement 
-- 	the package body in the most efficient manner available to them.
--
-- History:
-- 	Version 0.1  (Strawman) Jose A. Torres	6/22/92
-- 	Version 0.2		Jose A. Torres	1/15/93
-- 	Version	0.3		Jose A. Torres	4/13/93
--	Version 0.4		Jose A. Torres	4/19/93
--	Version 0.5		Jose A. Torres	4/20/93 Added RANDOM()
--	Version 0.6		Jose A. Torres	4/23/93 Renamed RANDOM as
--							UNIFORM.  Modified
--							rights banner.
--	Version 0.7		Jose A. Torres	5/28/93 Rev up for compatibility
--							with package body.
--	Version 0.8		Jose A. Torres	9/2/94  Rev up for compatibility
--							with package body.
--	Version 0.9		Jose A. Torres	9/30/94 Rev up for distribution
-------------------------------------------------------------
Library IEEE;

Package MATH_REAL is

    -- 
    -- commonly used constants
    --
    constant  MATH_E :   real := 2.71828_18284_59045_23536;  
    						  -- value of e
    constant  MATH_1_E:  real := 0.36787_94411_71442_32160;
  						  -- value of 1/e
    constant  MATH_PI :  real := 3.14159_26535_89793_23846;  
    						  -- value of pi
    constant  MATH_1_PI :  real := 0.31830_98861_83790_67154;  
    						  -- value of 1/pi
    constant  MATH_LOG_OF_2:  real := 0.69314_71805_59945_30942;
    						  -- natural log of 2
    constant  MATH_LOG_OF_10: real := 2.30258_50929_94045_68402;
    						  -- natural log of10
    constant  MATH_LOG2_OF_E:  real := 1.44269_50408_88963_4074;
    						  -- log base 2 of e
    constant  MATH_LOG10_OF_E: real := 0.43429_44819_03251_82765;
    						  -- log base 10 of e
    constant  MATH_SQRT2: real := 1.41421_35623_73095_04880; 
    						  -- sqrt of 2
    constant  MATH_SQRT1_2: real := 0.70710_67811_86547_52440; 
    						  -- sqrt of 1/2
    constant  MATH_SQRT_PI: real := 1.77245_38509_05516_02730; 
    						  -- sqrt of pi
    constant  MATH_DEG_TO_RAD: real := 0.01745_32925_19943_29577;
    			  	-- conversion factor from degree to radian
    constant  MATH_RAD_TO_DEG: real := 57.29577_95130_82320_87685;
    			   	-- conversion factor from radian to degree

    --
    -- attribute for functions whose implementation is foreign (C native)
    --
    attribute FOREIGN : string; -- predefined attribute in VHDL-1992

    --
    -- function declarations
    --
    function SIGN (X: real ) return real;
    	-- returns 1.0 if X > 0.0; 0.0 if X == 0.0; -1.0 if X < 0.0

    function CEIL (X : real ) return real;
    	-- returns smallest integer value (as real) not less than X

    function FLOOR (X : real ) return real;
    	-- returns largest integer value (as real) not greater than X

    function ROUND (X : real ) return real;
    	-- returns integer FLOOR(X + 0.5) if X > 0;
    	-- return integer CEIL(X - 0.5) if X < 0
    
    function FMAX (X, Y : real ) return real;
    	-- returns the algebraically larger of X and Y

    function FMIN (X, Y : real ) return real;
    	-- returns the algebraically smaller of X and Y

    procedure UNIFORM (variable Seed1,Seed2:inout integer; variable X:out real);
	-- returns a pseudo-random number with uniform distribution in the 
	-- interval (0.0, 1.0).
	-- Before the first call to UNIFORM, the seed values (Seed1, Seed2) must
	-- be initialized to values in the range [1, 2147483562] and 
	-- [1, 2147483398] respectively.  The seed values are modified after 
	-- each call to UNIFORM.
	-- This random number generator is portable for 32-bit computers, and
	-- it has period ~2.30584*(10**18) for each set of seed values.
	--

    function SRAND (seed: in integer ) return integer;
    	--
	-- sets value of seed for sequence of 
    	-- pseudo-random numbers.   
    	-- It uses the foreign native C function srand().
    attribute FOREIGN of SRAND : function is "C_NATIVE"; 

    function RAND return integer;		
    	--
	-- returns an integer pseudo-random number with uniform distribution.
	-- It uses the foreign native C function rand(). 
    	-- Seed for the sequence is initialized with the
    	-- SRAND() function and value of the seed is changed every
        -- time SRAND() is called,  but it is not visible.
    	-- The range of generated values is platform dependent.
    attribute FOREIGN of RAND : function is "C_NATIVE"; 

    function GET_RAND_MAX  return integer;		
    	--
	-- returns the upper bound of the range of the
    	-- pseudo-random numbers generated by  RAND().
    	-- The support for this function is platform dependent, and
	-- it uses foreign native C functions or constants.
	-- It may not be available in some platforms.
    	-- Note: the value of (RAND() / GET_RAND_MAX()) is a
    	--       pseudo-random number distributed between 0 & 1.
    attribute FOREIGN of GET_RAND_MAX : function is "C_NATIVE"; 

    function SQRT (X : real ) return real;
    	-- returns square root of X;  X >= 0

    function CBRT (X : real ) return real;
    	-- returns cube root of X

    function "**" (X : integer; Y : real) return real;
    	-- returns Y power of X ==>  X**Y;
    	-- error if X = 0 and Y <= 0.0
    	-- error if X < 0 and Y does not have an integer value

    function "**" (X : real; Y : real) return real;
    	-- returns Y power of X ==>  X**Y;
    	-- error if X = 0.0 and Y <= 0.0
    	-- error if X < 0.0 and Y does not have an integer value

    function EXP  (X : real ) return real;
    	-- returns e**X; where e = MATH_E

    function LOG (X : real ) return real;
    	-- returns natural logarithm of X; X > 0

    function LOG (BASE: positive; X : real) return real;
    	-- returns logarithm base BASE of X; X > 0

    function  SIN (X : real ) return real;
    	-- returns sin X; X in radians

    function  COS ( X : real ) return real;
    	-- returns cos X; X in radians

    function  TAN (X : real ) return real;
    	-- returns tan X; X in radians
    	-- X /= ((2k+1) * PI/2), where k is an integer

    function  ASIN (X : real ) return real; 
    	-- returns  -PI/2 < asin X < PI/2; | X | <= 1

    function  ACOS (X : real ) return real;
    	-- returns  0 < acos X < PI; | X | <= 1

    function  ATAN (X : real) return real;
    	-- returns  -PI/2 < atan X < PI/2

    function  ATAN2 (X : real; Y : real) return real;
    	-- returns  atan (X/Y); -PI < atan2(X,Y) < PI; Y /= 0.0

    function SINH (X : real) return real;
    	-- hyperbolic sine; returns (e**X - e**(-X))/2

    function  COSH (X : real) return real;
    	-- hyperbolic cosine; returns (e**X + e**(-X))/2

    function  TANH (X : real) return real;
    	-- hyperbolic tangent; -- returns (e**X - e**(-X))/(e**X + e**(-X))
    
    function ASINH (X : real) return real;
    	-- returns ln( X + sqrt( X**2 + 1))

    function ACOSH (X : real) return real;
    	-- returns ln( X + sqrt( X**2 - 1));   X >= 1

    function ATANH (X : real) return real;
    	-- returns (ln( (1 + X)/(1 - X)))/2 ; | X | < 1

end  MATH_REAL;



--------------------------------------------------------------- 
--
-- This source file may be used and distributed without restriction.
-- No declarations or definitions shall be included in this package.
-- This package cannot be sold or distributed for profit. 
--
--   ****************************************************************
--   *                                                              *
--   *                      W A R N I N G		 	    *
--   *								    *
--   *   This DRAFT version IS NOT endorsed or approved by IEEE     *
--   *								    *
--   ****************************************************************
--
-- Title:    PACKAGE MATH_COMPLEX
--
-- Purpose:  VHDL declarations for mathematical package MATH_COMPLEX
--	     which contains common complex constants and basic complex
--	     functions and operations.
--
-- Author:   IEEE VHDL Math Package Study Group 
--
-- Notes:     
--	The package body uses package IEEE.MATH_REAL
--
-- 	The package body shall be considered the formal definition of 
-- 	the semantics of this package. Tool developers may choose to implement 
-- 	the package body in the most efficient manner available to them.
--
-- History:
-- 	Version	0.1  (Strawman) Jose A. Torres	6/22/92
-- 	Version	0.2		Jose A. Torres	1/15/93
-- 	Version	0.3		Jose A. Torres	4/13/93
-- 	Version	0.4		Jose A. Torres 	4/19/93
-- 	Version	0.5		Jose A. Torres 	4/20/93
--	Version 0.6		Jose A. Torres  4/23/93  Added unary minus
--							 and CONJ for polar
--	Version 0.7		Jose A. Torres	5/28/93 Rev up for compatibility
--							with package body.
--	Version 0.8		Jose A. Torres	9/2/94  Rev up for compatibility
--							with package body.
--	Version 0.9		Jose A. Torres	9/30/94 Rev up for distribution
-------------------------------------------------------------
Library IEEE;

Package MATH_COMPLEX is


    type COMPLEX        is record RE, IM: real; end record;
    type COMPLEX_VECTOR is array (integer range <>) of COMPLEX;
    type COMPLEX_POLAR  is record MAG: real; ARG: real; end record;

    constant  CBASE_1: complex := COMPLEX'(1.0, 0.0);
    constant  CBASE_j: complex := COMPLEX'(0.0, 1.0);
    constant  CZERO: complex := COMPLEX'(0.0, 0.0);

    function CABS(Z: in complex ) return real;
    	-- returns absolute value (magnitude) of Z

    function CARG(Z: in complex ) return real;
    	-- returns argument (angle) in radians of a complex number

    function CMPLX(X: in real;  Y: in real:= 0.0 ) return complex;
    	-- returns complex number X + iY

    function "-" (Z: in complex ) return complex;
    	-- unary minus

    function "-" (Z: in complex_polar ) return complex_polar;
    	-- unary minus

    function CONJ (Z: in complex) return complex;
    	-- returns complex conjugate

    function CONJ (Z: in complex_polar) return complex_polar;
    	-- returns complex conjugate

    function CSQRT(Z: in complex ) return complex_vector;
    	-- returns square root of Z; 2 values

    function CEXP(Z: in complex ) return complex;
    	-- returns e**Z

    function COMPLEX_TO_POLAR(Z: in complex ) return complex_polar;
    	-- converts complex to complex_polar

    function POLAR_TO_COMPLEX(Z: in complex_polar ) return complex;
    	-- converts complex_polar to complex

    		
    -- arithmetic operators

    function "+" ( L: in complex;  R: in complex ) return complex;
    function "+" ( L: in complex_polar; R: in complex_polar) return complex;
    function "+" ( L: in complex_polar; R: in complex ) return complex;
    function "+" ( L: in complex;  R: in complex_polar) return complex;
    function "+" ( L: in real;     R: in complex ) return complex;
    function "+" ( L: in complex;  R: in real )    return complex;
    function "+" ( L: in real;  R: in complex_polar) return complex;
    function "+" ( L: in complex_polar;  R: in real) return complex;

    function "-" ( L: in complex;  R: in complex ) return complex;
    function "-" ( L: in complex_polar; R: in complex_polar) return complex;
    function "-" ( L: in complex_polar; R: in complex ) return complex;
    function "-" ( L: in complex;  R: in complex_polar) return complex;
    function "-" ( L: in real;     R: in complex ) return complex;
    function "-" ( L: in complex;  R: in real )    return complex;
    function "-" ( L: in real;  R: in complex_polar) return complex;
    function "-" ( L: in complex_polar;  R: in real) return complex;

    function "*" ( L: in complex;  R: in complex ) return complex;
    function "*" ( L: in complex_polar; R: in complex_polar) return complex;
    function "*" ( L: in complex_polar; R: in complex ) return complex;
    function "*" ( L: in complex;  R: in complex_polar) return complex;
    function "*" ( L: in real;     R: in complex ) return complex;
    function "*" ( L: in complex;  R: in real )    return complex;
    function "*" ( L: in real;  R: in complex_polar) return complex;
    function "*" ( L: in complex_polar;  R: in real) return complex;


    function "/" ( L: in complex;  R: in complex ) return complex;
    function "/" ( L: in complex_polar; R: in complex_polar) return complex;
    function "/" ( L: in complex_polar; R: in complex ) return complex;
    function "/" ( L: in complex;  R: in complex_polar) return complex;
    function "/" ( L: in real;     R: in complex ) return complex;
    function "/" ( L: in complex;  R: in real )    return complex;
    function "/" ( L: in real;  R: in complex_polar) return complex;
    function "/" ( L: in complex_polar;  R: in real) return complex;
end  MATH_COMPLEX;
From jose@Synopsys.COM  Fri Oct 14 15:48:06 1994
Return-Path: <jose@Synopsys.COM>
Received: from chronos.synopsys.com by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA02535; Fri, 14 Oct 94 15:48:06 PDT
Received: from gaea.synopsys.com by chronos.synopsys.com with SMTP id AA21848
  (5.65c/IDA-1.4.4 for <math@vhdl.org>); Fri, 14 Oct 1994 15:43:59 -0700
Received: from jose.synopsys.com by gaea.synopsys.com with SMTP id AA28918
  (5.65c/IDA-1.4.4 for <math@vhdl.org>); Fri, 14 Oct 1994 15:43:55 -0700
Received: by jose.synopsys.com (4.1/SNPS-Sub02)
	id AA24266; Fri, 14 Oct 94 15:43:54 PDT
Date: Fri, 14 Oct 94 15:43:54 PDT
From: jose@Synopsys.COM (Jose Torres)
Message-Id: <9410142243.AA24266@jose.synopsys.com>
To: math@vhdl.org
Subject: VHDL math package (body) -- current version


--------------------------------------------------------------- 
--
-- This source file may be used and distributed without restriction.
-- No declarations or definitions shall be included in this package.
-- This package cannot be sold or distributed for profit. 
--
--   ****************************************************************
--   *                                                              *
--   *                      W A R N I N G		 	    *
--   *								    *
--   *   This DRAFT version IS NOT endorsed or approved by IEEE     *
--   *							            *
--   ****************************************************************
--
-- Title:    PACKAGE BODY MATH_REAL
--
-- Library:  This package shall be compiled into a library 
--           symbolically named IEEE.
--
-- Purpose:  VHDL declarations for mathematical package MATH_REAL
--	     which contains common real constants, common real
--	     functions, and real trascendental functions.
--
-- Author:   IEEE VHDL Math Package Study Group 
--
-- Notes:
-- 	The package body shall be considered the formal definition of 
-- 	the semantics of this package. Tool developers may choose to implement 
-- 	the package body in the most efficient manner available to them.
--
--      Source code and algorithms for this package body comes from the 
--	following sources: 
--		IEEE VHDL Math Package Study Group participants,
--		U. of Mississippi, Mentor Graphics, Synopsys,
--		Viewlogic/Vantage, Communications of the ACM (June 1988, Vol
--		31, Number 6, pp. 747, Pierre L'Ecuyer, Efficient and Portable
--		Random Number Generators), Handbook of Mathematical Functions
--	        by Milton Abramowitz and Irene A. Stegun (Dover), Regents of
--		the University of California.
--
-- History:
-- 	Version 0.1	Jose A. Torres	4/23/93	First draft
-- 	Version 0.2	Jose A. Torres	5/28/93	Fixed potentially illegal code
--	Version 0.3	Jose A. Torres	11/21/93 Fixed code in log,ceil,floor
--						 and round
--	Version 0.4	Jose A. Torres	9/2/94	Modified/fixed code in the
--						following functions:
--						ceil, floor, round, "**",
--						exp, log, sqrt, cbrt, sin, cos,
--					 	asin, acos, atan, atan2, tanh,
--						acosh, atanh
--	Version 0.9	Jose A. Torres	9/30/94 Rev'd up for distribution.
--						and additional changes in sqrt
-------------------------------------------------------------
Library IEEE;

Package body MATH_REAL is

    -- 
    -- some constants for use in the package body only
    --
    constant  Q_PI :   real := MATH_PI/4.0;
    constant  HALF_PI :   real := MATH_PI/2.0;
    constant  TWO_PI :   real := MATH_PI*2.0;
    constant  MAX_ITER:  integer := 27; -- max precision factor for cordic
    constant  MAX_COUNT: integer := 50; -- max count for number of tries
    constant  MIN_EPS: real := 0.000001; -- min eps for convergence criteria

    --
    -- some type declarations for cordic operations
    -- 
    
    constant KC : REAL := 6.0725293500888142e-01; -- constant for cordic
    type REAL_VECTOR is array (NATURAL range <>) of REAL; 
    type NATURAL_VECTOR is array (NATURAL range <>) of NATURAL; 
    subtype REAL_VECTOR_N is REAL_VECTOR (0 to max_iter);
    subtype REAL_ARR_2 is REAL_VECTOR (0 to 1); 
    subtype REAL_ARR_3 is REAL_VECTOR (0 to 2); 
    subtype QUADRANT is INTEGER range 0 to 3; 
    type CORDIC_MODE_TYPE is (ROTATION, VECTORING); 
  

    --
    -- auxiliary functions for cordic algorithms
    --
    function POWER_OF_2_SERIES (d : NATURAL_VECTOR; initial_value : REAL;
                number_of_values : NATURAL) return REAL_VECTOR is 

      variable v : REAL_VECTOR (0 to number_of_values);  
      variable temp : REAL := initial_value; 
      variable flag : boolean := true; 
    begin
      for i in 0 to number_of_values loop 
         v(i) := temp; 
         for p in d'range loop 
            if i = d(p) then 
               flag := false;
            end if;                  
         end loop; 
         if flag then
            temp := temp/2.0;
         end if; 
         flag := true;
      end loop; 
      return v;
    end POWER_OF_2_SERIES; 


   constant two_at_minus : REAL_VECTOR := POWER_OF_2_SERIES(
                                               NATURAL_VECTOR'(100, 90),1.0,
                                                                  MAX_ITER);  

   constant epsilon : REAL_VECTOR_N := (
                                        7.8539816339744827e-01,
                                        4.6364760900080606e-01,
                                        2.4497866312686413e-01,
                                        1.2435499454676144e-01,
                                        6.2418809995957351e-02,
                                        3.1239833430268277e-02,
                                        1.5623728620476830e-02,
                                        7.8123410601011116e-03,
                                        3.9062301319669717e-03,
                                        1.9531225164788189e-03,
                                        9.7656218955931937e-04,
                                        4.8828121119489829e-04,
                                        2.4414062014936175e-04,
                                        1.2207031189367021e-04,
                                        6.1035156174208768e-05,
                                        3.0517578115526093e-05,
                                        1.5258789061315760e-05,
                                        7.6293945311019699e-06,
                                        3.8146972656064960e-06,
                                        1.9073486328101870e-06,
                                        9.5367431640596080e-07,
                                        4.7683715820308876e-07,
                                        2.3841857910155801e-07,
                                        1.1920928955078067e-07,
                                        5.9604644775390553e-08,
                                        2.9802322387695303e-08,
                                        1.4901161193847654e-08,
                                        7.4505805969238281e-09
                                       );

   function CORDIC ( x0 : REAL;  
                     y0 : REAL;  
                     z0 : REAL;  
                      n : NATURAL;                 --       precision factor 
            CORDIC_MODE : CORDIC_MODE_TYPE         --      rotation (z -> 0) 
                                                   --  or vectoring (y -> 0) 
                    ) return REAL_ARR_3 is 
     variable x : REAL := x0;
     variable y : REAL := y0;
     variable z : REAL := z0;
     variable x_temp : REAL; 
   begin
      if CORDIC_MODE = ROTATION then 
         for k in 0 to n loop 
            x_temp := x;
            if ( z >= 0.0) then
               x := x - y * two_at_minus(k);
               y := y + x_temp * two_at_minus(k); 
               z := z - epsilon(k);
            else 
               x := x + y * two_at_minus(k);
               y := y - x_temp * two_at_minus(k);
               z := z + epsilon(k);
            end if; 
         end loop;
      else 
         for k in 0 to n loop 
            x_temp := x;
            if ( y < 0.0) then
               x := x - y * two_at_minus(k);
               y := y + x_temp * two_at_minus(k); 
               z := z - epsilon(k);
            else 
               x := x + y * two_at_minus(k);
               y := y - x_temp * two_at_minus(k);
               z := z + epsilon(k);
            end if; 
         end loop;
      end if;
      return REAL_ARR_3'(x, y, z);
   end CORDIC;          

    --
    -- non-trascendental functions
    --
    function SIGN (X: real ) return real is
    	-- returns 1.0 if X > 0.0; 0.0 if X == 0.0; -1.0 if X < 0.0
    begin
	   if  ( X > 0.0 )  then
		return 1.0;
	   elsif ( X < 0.0 )  then
		return -1.0;
	   else
		return 0.0;
	   end if;
    end SIGN; 

    function CEIL (X : real ) return real is
    	-- returns smallest integer value (as real) not less than X
	-- No conversion to an integer type is expected, so truncate cannot 
	-- overflow for large arguments.

         variable large: real  := 1073741824.0;
         type long is range -1073741824 to 1073741824;
         -- 2**30 is longer than any single-precision mantissa
         variable rd: real;
   
      begin
         if abs( X) >= large then
   	    return X;
         else
   	    rd := real ( long( X));
   	    if X > 0.0 then
   	    	if rd >= X then
   	       		return rd;
   	    	else
   	       		return rd + 1.0;
   	    	end if;
   	    elsif  X = 0.0  then
			return 0.0;
	    else
   	    	if rd <= X then
   	       		return rd + 1.0;
   	    	else
   	       		return rd;
   	    	end if;
   	    end if;
         end if;
      end CEIL;

    function FLOOR (X : real ) return real is
    	-- returns largest integer value (as real) not greater than X
   	-- No conversion to an integer type is expected, so truncate 
	-- cannot overflow for large arguments.
   	-- 
         variable large: real  := 1073741824.0;
         type long is range -1073741824 to 1073741824;
         -- 2**30 is longer than any single-precision mantissa
         variable rd: real;
   
      begin
         if abs( X ) >= large then
   	 	return X;
         else
   	 	rd := real ( long( X));
   	 	if X > 0.0 then
   	    		if rd <= X then
   	       			return rd;
   	    		else
   	       			return rd - 1.0;
   	    		end if;
   	 	elsif  X = 0.0  then
			return 0.0;
		else
   	    		if rd >= X then
   	       			return rd - 1.0;
   	    		else
   	       			return rd;
   	    		end if;
   	 	end if;
         end if;
      end FLOOR;

    function ROUND (X : real ) return real is
    	-- returns integer FLOOR(X + 0.5) if X > 0;
    	-- return integer CEIL(X - 0.5) if X < 0
    begin
	   if  X > 0.0  then
		return FLOOR(X + 0.5);
	   elsif  X < 0.0  then
		return CEIL( X - 0.5);
	   else
		return 0.0;
	   end if;
    end ROUND;
    
    function FMAX (X, Y : real ) return real is
    	-- returns the algebraically larger of X and Y
    begin
	if X > Y then
	   return X;
	else
	   return Y;
	end if;
    end FMAX;

    function FMIN (X, Y : real ) return real is
    	-- returns the algebraically smaller of X and Y
    begin
	if X < Y then
	   return X;
	else
	   return Y;
	end if;
    end FMIN;

    --
    -- Pseudo-random number generators
    --

    procedure UNIFORM(variable Seed1,Seed2:inout integer;variable X:out real) is
	-- returns a pseudo-random number with uniform distribution in the 
	-- interval (0.0, 1.0).
	-- Before the first call to UNIFORM, the seed values (Seed1, Seed2) must
	-- be initialized to values in the range [1, 2147483562] and 
	-- [1, 2147483398] respectively.  The seed values are modified after 
	-- each call to UNIFORM.
	-- This random number generator is portable for 32-bit computers, and
	-- it has period ~2.30584*(10**18) for each set of seed values.
	--
	variable z, k: integer;
    begin
	k := Seed1/53668;
	Seed1 := 40014 * (Seed1 - k * 53668) - k * 12211;
	
	if Seed1 < 0  then
		Seed1 := Seed1 + 2147483563;
	end if;


	k := Seed2/52774;
	Seed2 := 40692 * (Seed2 - k * 52774) - k * 3791;
	
	if Seed2 < 0  then
		Seed2 := Seed2 + 2147483399;
	end if;

	z := Seed1 - Seed2;
	if z < 1 then
		z := z + 2147483562;
	end if;

	X :=  REAL(Z)*4.656613e-10;
    end UNIFORM;


    function SRAND (seed: in integer ) return integer is
    	--
	-- sets value of seed for sequence of 
    	-- pseudo-random numbers.   
	-- Returns the value of the seed.
    	-- It uses the foreign native C function srand().
    begin
	return(-1);	-- *** dummy return value for VHDL compliance ***
			-- (actual return value is the one generated by
			--  the C function srand())    
    end SRAND;

    function RAND return integer is
    	--
	-- returns an integer pseudo-random number with uniform distribution.
	-- It uses the foreign native C function rand(). 
    	-- Seed for the sequence is initialized with the
    	-- SRAND() function and value of the seed is changed every
        -- time SRAND() is called,  but it is not visible.
    	-- The range of generated values is platform dependent.
    begin
	return(-1);	-- *** dummy return value for VHDL compliance ***
			-- (actual return value is the one generated by
			--  the C function rand())    
    end RAND;

    function GET_RAND_MAX  return integer is
    	--
	-- returns the upper bound of the range of the
    	-- pseudo-random numbers generated by  RAND().
    	-- The support for this function is platform dependent, and
	-- it uses foreign native C functions or constants.
	-- It may not be available in some platforms.
    	-- Note: the value of (RAND / GET_RAND_MAX) is a
    	--       pseudo-random number distributed between 0 & 1.
    begin
	return(-1);	-- *** dummy return value for VHDL compliance ***
			-- (actual return value is a function of the platform)
    end GET_RAND_MAX;

    --
    -- trascendental and trigonometric functions
    --

    function SQRT (X : real ) return real is
    	-- returns square root of X;  X >= 0
	--
	-- Computes square root using the Newton-Raphson approximation:
	-- F(n+1) = 0.5*[F(n) + x/F(n)];
	--

	constant eps : real := MIN_EPS;
	constant relative_err : real := eps*X;
	variable count : integer := 1;

	variable inival: real;
	variable oldval : real ;
	variable newval : real ;

    begin
	-- check validity of argument
	if ( X < 0.0 ) then
		assert false report "X < 0 in SQRT(X)" 
			severity ERROR;
		return (0.0);
	end if;

	-- get the square root for special cases
	if X = 0.0 then
	  	return 0.0;
	else
		if ( X = 1.0 ) then
			return 1.0; -- return exact value
		end if;
	end if;

	-- get the square root for general cases

	inival := exp(log(x)*(0.5)); -- Mathematically correct but imprecise
	oldval := inival;
	newval := (X/oldval + oldval)/2.0;

	-- check for both absolute and relative error
	while ( (( abs(newval -oldval) > eps ) OR 
		 ( abs(newval -oldval) > relative_err)) AND
		( count < MAX_COUNT ) ) loop
		oldval := newval;
		newval := (X/oldval + oldval)/2.0;
		count := count + 1;  -- for future use if a count limit needed
	end loop;

	return newval;
    end SQRT;

    function CBRT (X : real ) return real is
    	-- returns cube root of X
	-- Computes square root using the Newton-Raphson approximation:
	-- F(n+1) = (1/3)*[2*F(n) + x/F(n)**2];
	--

		constant eps : real := MIN_EPS;
		constant relative_err : real := eps*abs(X);

		variable inival: real;
		variable xlocal : real := X;
		variable negative : boolean := X < 0.0;
		variable oldval : real ;
		variable newval : real ;
		variable count : integer := 1;

    begin 
		
		-- compute root for special cases
		if X = 0.0 then
			return 0.0;
		elsif ( X = 1.0 ) then
			return 1.0;
		else
			if X = -1.0 then
				return -1.0;
			end if;
		end if;

		-- compute root for general cases
		if negative then
			xlocal := -X;
		end if;
		
		inival := exp(log(xlocal)/(3.0)); -- mathematically correct but
						  -- imprecise
		oldval := inival;
		newval := (xlocal/(oldval*oldval) + 2.0*oldval)/3.0;

		-- check for absolut and relative errors and max count
		while ( (( abs(newval -oldval) > eps ) OR 
			 ( abs(newval -oldval) > relative_err)) AND
			( count < MAX_COUNT ) ) loop
			oldval := newval;
			newval :=(xlocal/(oldval*oldval) + 2.0*oldval)/3.0;
			count := count + 1;
		end loop;

		if negative then
			newval := -newval;
		end if;

		return newval;

    end CBRT;

    function "**" (X : integer; Y : real) return real is
    	-- returns Y power of X ==>  X**Y;
    	-- error if X = 0 and Y <= 0.0
    	-- error if X < 0 and Y does not have an integer value
    begin
	-- check validity of argument
	if ( X = 0  ) and ( Y <= 0.0 ) then
		assert false report "X = 0 and Y <= 0.0 in X**Y" 
			severity ERROR;
		return (0.0);
	end if;

	if ( X < 0  ) and ( Y /= REAL(INTEGER(Y)) ) then
		assert false report "X < 0 and Y \= integer in X**Y" 
			severity ERROR;
		return (0.0);
	end if;

	-- compute the result
	if ( X = 0  ) then
		return (0.0);
	end if;

	return EXP (Y * LOG (REAL(X)));
    end "**";

    function "**" (X : real; Y : real) return real is
    	-- returns Y power of X ==>  X**Y;
    	-- error if X = 0.0 and Y <= 0.0
    	-- error if X < 0.0 and Y does not have an integer value
    begin
	-- check validity of argument
	if ( X = 0.0  ) and ( Y <= 0.0 ) then
		assert false report "X = 0.0 and Y <= 0.0 in X**Y" 
			severity ERROR;
		return (0.0);
	end if;

	if ( X < 0.0  ) and ( Y /= REAL(INTEGER(Y)) ) then
		assert false report "X < 0.0 and Y \= integer in X**Y" 
			severity ERROR;
		return (0.0);
	end if;

	-- compute the result
	if ( X = 0.0  ) then
		return (0.0);
	end if;

	return EXP (Y * LOG (X));
    end "**";

    function EXP  (X : real ) return real is
    	-- returns e**X; where e = MATH_E
  	--
  	-- This function computes the exponential using the following series:
  	--    exp(x) = 1 + x + x**2/2! + x**3/3! + ... ; x > 0
  	--
	constant eps : real := MIN_EPS;	-- precision criteria

    	variable reciprocal: boolean := x < 0.0;-- check sign of argument
    	variable xlocal : real := abs(x);       -- use positive value
    	variable oldval: real ;			-- following variables are
    	variable count: integer ;
    	variable newval: real ;
    	variable last_term: real ;

     begin
    	-- compute value for special cases
	if X = 0.0 then
		return 1.0;
	else
		if  X = 1.0  then
			return MATH_E;
		end if;
	end if;

    	-- compute value for general cases
    	oldval := 1.0;
    	last_term := xlocal;
    	newval:= oldval + last_term;
    	count := 2;

    	while ( abs(newval - oldval) > eps OR count < MAX_COUNT ) loop
		if reciprocal and newval > 1.0E19 then
			return 0.0;
		end if;

		oldval := newval;
		last_term := (last_term / (real(count))) * xlocal;
        	newval := oldval + last_term;
        	count := count + 1;
    	end loop;

    	if reciprocal then
        	newval := 1.0/newval;
    	end if;

    	return newval;
     end EXP;


    --
    -- auxiliary functions to compute LOG
    --
    function ILOGB(X: real) return integer IS --return n such that 
					      --1 <= abs(x)/2^n < 2 

	variable n: integer := 0;
	variable y: real := abs(x);

    begin
	if(y = 1.0 or y = 0.0) then 
		return 0; 
	end if; 

	if( y > 1.0) then
		while y >= 2.0 loop
			y := y/2.0;
			n := n+1;
		end loop;
		return n;
	end if;

	-- O < y < 1

	while y < 1.0 loop
		y := y*2.0;
		n := n -1;
	end loop;
	return n;
    end ILOGB;

    function LDEXP(x:real; n:integer) RETURN real IS --return x*2^n
    begin
	return x*(2.0 ** n);
    end LDEXP;

    function LOG (X : real ) return real IS

	-- Copyright (c) 1992 Regents of the University of California. 
	-- All rights reserved.
	--
	-- Redistribution and use in source and binary forms, with or without 
	-- modification, are permitted provided that the following conditions 
	-- are met:
	-- 1. Redistributions of source code must retain the above copyright 
	-- notice, this list of conditions and the following disclaimer. 
	-- 2. Redistributions in binary form must reproduce the above copyright 
	-- notice, this list of conditions and the following disclaimer in the 
	-- documentation and/or other materials provided with the distribution.
	-- 3. All advertising materials mentioning features or use of this 
	-- software must display the following acknowledgement: 
	-- This product includes software developed by the University of 
	-- California, Berkeley and its contributors. 
	-- 4. Neither the name of the University nor the names of its 
	-- contributors may be used to endorse or promote products derived 
	-- from this software without specific prior written permission. 
	--
	-- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' 
	-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
	-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
	-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 
	-- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
	-- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
	-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
	-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
	-- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
	-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
	-- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
	-- DAMAGE.
	--
	-- NOTE: This VHDL version was generated using the C version of the
	--	 original function by the IEEE VHDL Mathematical Package 
	--	 Working Group (CS/JT)

	constant N: integer := 128;

	-- Table of log(Fj) = logF_head[j] + logF_tail[j], for Fj = 1+j/128. 
	-- Used for generation of extend precision logarithms. 
	-- The constant 35184372088832 is 2^45, so the divide is exact. 
	-- It ensures correct reading of logF_head, even for inaccurate 
	-- decimal-to-binary conversion routines. (Everybody gets the 
	-- right answer for integers less than 2^53.) 
	-- Values for log(F) were generated using error < 10^-57 absolute 
	-- with the bc -l package.

	type REAL_VECTOR is array (NATURAL range <>) of REAL; 

	constant A1:real := 0.08333333333333178827; 
	constant A2:real := 0.01250000000377174923; 
	constant A3:real := 0.002232139987919447809; 
	constant A4:real := 0.0004348877777076145742; 

	constant logF_head:real_vector(0 TO N) := ( 
		0.0,
		0.007782140442060381246,
		0.015504186535963526694,
		0.023167059281547608406,
		0.030771658666765233647,
		0.038318864302141264488,
		0.045809536031242714670,
		0.053244514518837604555,
		0.060624621816486978786,
		0.067950661908525944454,
		0.075223421237524235039,
		0.082443669210988446138,
		0.089612158689760690322,
		0.096729626458454731618,
		0.103796793681567578460,
		0.110814366340264314203,
		0.117783035656430001836,
		0.124703478501032805070,
		0.131576357788617315236,
		0.138402322859292326029,
		0.145182009844575077295,
		0.151916042025732167530,
		0.158605030176659056451,
		0.165249572895390883786,
		0.171850256926518341060,
		0.178407657472689606947,
		0.184922338493834104156,
		0.191394852999565046047,
		0.197825743329758552135,
		0.204215541428766300668,
		0.210564769107350002741,
		0.216873938300523150246,
		0.223143551314024080056,
		0.229374101064877322642,
		0.235566071312860003672,
		0.241719936886966024758,
		0.247836163904594286577,
		0.253915209980732470285,
		0.259957524436686071567,
		0.265963548496984003577,
		0.271933715484010463114,
		0.277868451003087102435,
		0.283768173130738432519,
		0.289633292582948342896,
		0.295464212893421063199,
		0.301261330578199704177,
		0.307025035294827830512,
		0.312755710004239517729,
		0.318453731118097493890,
		0.324119468654316733591,
		0.329753286372579168528,
		0.335355541920762334484,
		0.340926586970454081892,
		0.346466767346100823488,
		0.351976423156884266063,
		0.357455888922231679316,
		0.362905493689140712376,
		0.368325561158599157352,
		0.373716409793814818840,
		0.379078352934811846353,
		0.384411698910298582632,
		0.389716751140440464951,
		0.394993808240542421117,
		0.400243164127459749579,
		0.405465108107819105498,
		0.410659924985338875558,
		0.415827895143593195825,
		0.420969294644237379543,
		0.426084395310681429691,
		0.431173464818130014464,
		0.436236766774527495726,
		0.441274560805140936281,
		0.446287102628048160113,
		0.451274644139630254358,
		0.456237433481874177232,
		0.461175715122408291790,
		0.466089729924533457960,
		0.470979715219073113985,
		0.475845904869856894947,
		0.480688529345570714212,
		0.485507815781602403149,
		0.490303988045525329653,
		0.495077266798034543171,
		0.499827869556611403822,
		0.504556010751912253908,
		0.509261901790523552335,
		0.513945751101346104405,
		0.518607764208354637958,
		0.523248143765158602036,
		0.527867089620485785417,
		0.532464798869114019908,
		0.537041465897345915436,
		0.541597282432121573947,
		0.546132437597407260909,
		0.550647117952394182793,
		0.555141507540611200965,
		0.559615787935399566777,
		0.564070138285387656651,
		0.568504735352689749561,
		0.572919753562018740922,
		0.577315365035246941260,
		0.581691739635061821900,
		0.586049045003164792433,
		0.590387446602107957005,
		0.594707107746216934174,
		0.599008189645246602594,
		0.603290851438941899687,
		0.607555250224322662688,
		0.611801541106615331955,
		0.616029877215623855590,
		0.620240409751204424537,
		0.624433288012369303032,
		0.628608659422752680256,
		0.632766669570628437213,
		0.636907462236194987781,
		0.641031179420679109171,
		0.645137961373620782978,
		0.649227946625615004450,
		0.653301272011958644725,
		0.657358072709030238911,
		0.661398482245203922502,
		0.665422632544505177065,
		0.669430653942981734871,
		0.673422675212350441142,
		0.677398823590920073911,
		0.681359224807238206267,
		0.685304003098281100392,
		0.689233281238557538017,
		0.693147180560117703862);

	constant logF_tail:real_vector(0 TO N) := ( 
		0.0,
		-0.00000000000000543229938420049,
		0.00000000000000172745674997061,
		-0.00000000000001323017818229233,
		-0.00000000000001154527628289872,
		-0.00000000000000466529469958300,
		0.00000000000005148849572685810,
		-0.00000000000002532168943117445,
		-0.00000000000005213620639136504,
		-0.00000000000001819506003016881,
		0.00000000000006329065958724544,
		0.00000000000008614512936087814,
		-0.00000000000007355770219435028,
		0.00000000000009638067658552277,
		0.00000000000007598636597194141,
		0.00000000000002579999128306990,
		-0.00000000000004654729747598444,
		-0.00000000000007556920687451336,
		0.00000000000010195735223708472,
		-0.00000000000017319034406422306,
		-0.00000000000007718001336828098,
		0.00000000000010980754099855238,
		-0.00000000000002047235780046195,
		-0.00000000000008372091099235912,
		0.00000000000014088127937111135,
		0.00000000000012869017157588257,
		0.00000000000017788850778198106,
		0.00000000000006440856150696891,
		0.00000000000016132822667240822,
		-0.00000000000007540916511956188,
		-0.00000000000000036507188831790,
		0.00000000000009120937249914984,
		0.00000000000018567570959796010,
		-0.00000000000003149265065191483,
		-0.00000000000009309459495196889,
		0.00000000000017914338601329117,
		-0.00000000000001302979717330866,
		0.00000000000023097385217586939,
		0.00000000000023999540484211737,
		0.00000000000015393776174455408,
		-0.00000000000036870428315837678,
		0.00000000000036920375082080089,
		-0.00000000000009383417223663699,
		0.00000000000009433398189512690,
		0.00000000000041481318704258568,
		-0.00000000000003792316480209314,
		0.00000000000008403156304792424,
		-0.00000000000034262934348285429,
		0.00000000000043712191957429145,
		-0.00000000000010475750058776541,
		-0.00000000000011118671389559323,
		0.00000000000037549577257259853,
		0.00000000000013912841212197565,
		0.00000000000010775743037572640,
		0.00000000000029391859187648000,
		-0.00000000000042790509060060774,
		0.00000000000022774076114039555,
		0.00000000000010849569622967912,
		-0.00000000000023073801945705758,
		0.00000000000015761203773969435,
		0.00000000000003345710269544082,
		-0.00000000000041525158063436123,
		0.00000000000032655698896907146,
		-0.00000000000044704265010452446,
		0.00000000000034527647952039772,
		-0.00000000000007048962392109746,
		0.00000000000011776978751369214,
		-0.00000000000010774341461609578,
		0.00000000000021863343293215910,
		0.00000000000024132639491333131,
		0.00000000000039057462209830700,
		-0.00000000000026570679203560751,
		0.00000000000037135141919592021,
		-0.00000000000017166921336082431,
		-0.00000000000028658285157914353,
		-0.00000000000023812542263446809,
		0.00000000000006576659768580062,
		-0.00000000000028210143846181267,
		0.00000000000010701931762114254,
		0.00000000000018119346366441110,
		0.00000000000009840465278232627,
		-0.00000000000033149150282752542,
		-0.00000000000018302857356041668,
		-0.00000000000016207400156744949,
		0.00000000000048303314949553201,
		-0.00000000000071560553172382115,
		0.00000000000088821239518571855,
		-0.00000000000030900580513238244,
		-0.00000000000061076551972851496,
		0.00000000000035659969663347830,
		0.00000000000035782396591276383,
		-0.00000000000046226087001544578,
		0.00000000000062279762917225156,
		0.00000000000072838947272065741,
		0.00000000000026809646615211673,
		-0.00000000000010960825046059278,
		0.00000000000002311949383800537,
		-0.00000000000058469058005299247,
		-0.00000000000002103748251144494,
		-0.00000000000023323182945587408,
		-0.00000000000042333694288141916,
		-0.00000000000043933937969737844,
		0.00000000000041341647073835565,
		0.00000000000006841763641591466,
		0.00000000000047585534004430641,
		0.00000000000083679678674757695,
		-0.00000000000085763734646658640,
		0.00000000000021913281229340092,
		-0.00000000000062242842536431148,
		-0.00000000000010983594325438430,
		0.00000000000065310431377633651,
		-0.00000000000047580199021710769,
		-0.00000000000037854251265457040,
		0.00000000000040939233218678664,
		0.00000000000087424383914858291,
		0.00000000000025218188456842882,
		-0.00000000000003608131360422557,
		-0.00000000000050518555924280902,
		0.00000000000078699403323355317,
		-0.00000000000067020876961949060,
		0.00000000000016108575753932458,
		0.00000000000058527188436251509,
		-0.00000000000035246757297904791,
		-0.00000000000018372084495629058,
		0.00000000000088606689813494916,
		0.00000000000066486268071468700,
		0.00000000000063831615170646519,
		0.00000000000025144230728376072,
		-0.00000000000017239444525614834);


	variable m, j:integer;
	variable F1, f2, g, q, u, u2, v: real;
	variable zero:real := 0.0;--made variable so no constant folding occurs 
	variable one:real := 1.0; --made variable so no constant folding occurs 
	
	-- double logb(), ldexp();

	variable u1:real;

     begin

	-- check validity of argument
	if ( x <= 0.0 ) then
		assert false report "X <= 0 in LOG(X)"
		severity ERROR;
		return(REAL'LOW);
	end if;

	-- Argument reduction: 1 <= g < 2; x/2^m = g; 
	-- y = F*(1 + f/F) for |f| <= 2^-8

	m := ilogb(x);
	g := ldexp(x, -m);
	j := integer(real(N)*(g-1.0)); -- C code adds 0.5 for rounding 
	F1 := (1.0/real(N)) * real(j) + 1.0; --F1*128 is an integer in [128,512]
	f2 := g - F1;

	-- Approximate expansion for log(1+f2/F1) ~= u + q 
	g := 1.0/(2.0*F1+f2);
	u := 2.0*f2*g;
	v := u*u;
	q := u*v*(A1 + v*(A2 + v*(A3 + v*A4)));

	-- case 1: u1 = u rounded to 2^-43 absolute. Since u < 2^-8, 
	--	u1 has at most 35 bits, and F1*u1 is exact, as F1 has < 8 bits.
	--	It also adds exactly to |m*log2_hi + log_F_head[j] | < 750
	--
	if ( j /= 0 or m /= 0) then
		u1 := u + 513.0; 
		u1 := u1 - 513.0;

		-- case 2: |1-x| < 1/256.The m- and j- dependent terms are zero 
		--	u1 = u to 24 bits.
		--
	else
		u1 := u;
		--TRUNC(u1); --in c this is u1 = (double) (float) (u1) 
	end if;

	u2 := (2.0*(f2 - F1*u1) - u1*f2) * g;
	-- u1 + u2 = 2f/(2F+f) to extra precision. 

	-- log(x) = log(2^m*F1*(1+f2/F1)) =
	-- (m*log2_hi+logF_head(j)+u1) + (m*log2_lo+logF_tail(j)+q); 
	-- (exact) + (tiny)

	u1 := u1 + real(m)*logF_head(N) + logF_head(j);	-- exact
	u2 := (u2 + logF_tail(j)) + q;	-- tiny
	u2 := u2 + logF_tail(N)*real(m);
	return (u1 + u2);
    end LOG;

    function LOG (BASE: positive; X : real) return real is
    	-- returns logarithm base BASE of X; X > 0
    begin
    	-- check validity of argument
    	if ( x <= 0.0 ) then
       	  assert false report "X <= 0.0 in LOG(BASE, X)" 
				severity ERROR;
            return(REAL'LOW);
    	end if;

	-- compute the value
	return ( LOG(X)/LOG(REAL(BASE)));
    end LOG;


    function  SIN (X : real ) return real is
    	-- returns sin X; X in radians
        variable n : INTEGER;
        variable nx : real;
	constant eps : real := MIN_EPS;
    begin 
      if (abs(x) < eps) then
	  return (0.0);
      elsif ( x > 0.0) then
	  nx := x / MATH_PI;
	  nx := nx - floor(nx);
	  if (nx < eps) then
	      return (0.0);
	  end if;
      else
	  nx := x / MATH_PI;
	  nx := nx - ceil(nx);
	  if (abs(nx) < eps) then
	      return (0.0);
	  end if;
      end if;

      if (x < 1.6 ) and (x > -1.6) then
         return    CORDIC( KC, 0.0, x, 27, ROTATION)(1);
      end if; 

      n := INTEGER( x / HALF_PI );
      case QUADRANT( n mod 4 ) is 
         when 0 => 
            return  CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(1);
         when 1 => 
            return  CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(0);
         when 2 =>
            return -CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(1);
         when 3 => 
            return -CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(0);
       end case;
    end SIN;

   
   function COS (x : REAL) return REAL is 
    	-- returns cos X; X in radians
      variable n : INTEGER;
      variable xlocal, int_part : real;
      constant eps : real := MIN_EPS;
   begin 
      if (abs(x) = HALF_PI) then
	  return (0.0);
      elsif ( x > 0.0) then
	  xlocal := x / HALF_PI;
	  int_part := floor(xlocal);
	  xlocal := xlocal - int_part;
	  if (xlocal < eps) and ((INTEGER(int_part) rem 2) = 1) then
	      return (0.0);
	  end if;
      else
	  xlocal := x / HALF_PI;
	  int_part := ceil(xlocal);
	  xlocal := xlocal - int_part;
	  if (abs(xlocal) < eps) and ((INTEGER(int_part) rem 2) = 1) then
	      return (0.0);
	  end if;
      end if;

      if (x < 1.6 ) and (x > -1.6) then
         return CORDIC( KC, 0.0, x, 27, ROTATION)(0);
      end if; 

      n := INTEGER( x / HALF_PI );
      case QUADRANT( n mod 4 ) is 
         when 0 => 
            return  CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(0);
         when 1 => 
            return -CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(1);
         when 2 =>
            return -CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(0);
         when 3 => 
            return  CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION)(1);
       end case;
   end COS;
   
   function TAN (x : REAL) return REAL is 
    	-- returns tan X; X in radians
    	-- X /= ((2k+1) * PI/2), where k is an integer
      variable n : INTEGER := INTEGER( x / HALF_PI );
      variable v : REAL_ARR_3 :=
                       CORDIC( KC, 0.0, x - REAL(n) * HALF_PI, 27, ROTATION);
   begin
      if n mod 2 = 0 then
         return v(1)/v(0);
      else
         return -v(0)/v(1);
      end if;
   end TAN; 
    
   function ASIN (x : real ) return real is
    	-- returns  -PI/2 < asin X < PI/2; | X | <= 1
   begin   
      if abs x > 1.0 then 
         assert false report "Out of range parameter passed to ASIN" 
			severity ERROR;
         return x;
      elsif abs x = 0.0 then 
         return 0.0;
      elsif abs x < 0.9 then 
         return atan(x/(sqrt(1.0 - x*x)));
      elsif x > 0.0 then 
         return HALF_PI - atan(sqrt(1.0 - x*x)/x);
      else 
         return - HALF_PI + atan((sqrt(1.0 - x*x))/x);
      end if;
   end ASIN; 
   
   function ACOS (x : REAL) return REAL is
    	-- returns  0 < acos X < PI; | X | <= 1
   begin  
      if abs x > 1.0 then 
         assert false report "Out of range parameter passed to ACOS" 
			severity ERROR; 
         return x;
      elsif abs x = 1.0 then
	 return 0.0;
      elsif abs x > 0.9 then
         if x > 0.0 then  
            return atan(sqrt(1.0 - x*x)/x);
         else
            return MATH_PI - atan(sqrt(1.0 - x*x)/x); 
         end if; 
      else 
         return HALF_PI - atan(x/sqrt(1.0 - x*x));
      end if;
   end ACOS; 
   
   function ATAN (x : REAL) return REAL is
    	-- returns  -PI/2 < atan X < PI/2
   begin
      return  CORDIC( 1.0, x, 0.0, 27, VECTORING )(2);      
   end ATAN; 

   function ATAN2 (x : REAL; y : REAL) return REAL is 
    	-- returns  atan (X/Y); -PI < atan2(X,Y) < PI; Y /= 0.0
   begin   
     if y = 0.0 then 
           assert false report "atan2(x, 0.0) is undetermined, returned 0,0" 
           	severity NOTE;
           return 0.0; 
     end if;     

     if x = 0.0 then 
        if y > 0.0 then 
           return 0.0;
        else 
           return MATH_PI;
        end if;
     end if;     

     if y > 0.0 then
	 if x > 0.0 then
            return  CORDIC( y, x, 0.0, 27, VECTORING )(2); 
	 else
            return  -CORDIC( y, -x, 0.0, 27, VECTORING )(2); 
	 end if;
     else 
	 if x > 0.0 then
            return  MATH_PI - CORDIC( -y, x, 0.0, 27, VECTORING )(2); 
	 else
            return -MATH_PI + CORDIC( -y, -x, 0.0, 27, VECTORING )(2); 
	 end if;
     end if;     
   end ATAN2; 


    function SINH (X : real) return real is
    	-- hyperbolic sine; returns (e**X - e**(-X))/2
    begin
		return ( (EXP(X) - EXP(-X))/2.0 );
    end SINH;

    function  COSH (X : real) return real is
    	-- hyperbolic cosine; returns (e**X + e**(-X))/2
    begin
		return ( (EXP(X) + EXP(-X))/2.0 );
    end COSH;

    function  TANH (X : real) return real is
    	-- hyperbolic tangent; -- returns (e**X - e**(-X))/(e**X + e**(-X))

	variable xlocal, pos_result: real;
	variable negative: boolean;
    begin
	negative := ( x < 0.0);
	if negative then
	    xlocal := -x;
	else
	    xlocal := x;
	end if;

	if ( xlocal <= 1.0e-10 ) then
	    pos_result := xlocal;
	elsif ( xlocal > 22.0 ) then
	    pos_result := 1.0;
	else
	    pos_result := (EXP(xlocal)-EXP(-xlocal))/(EXP(xlocal)+EXP(-xlocal));
	end if;

	if negative then
	    return -pos_result;
	else
	    return pos_result;
	end if;
    end TANH;
    
    function ASINH (X : real) return real is
    	-- returns ln( X + sqrt( X**2 + 1))
    begin
		return ( LOG( X + SQRT( X**2 + 1.0)) );
    end ASINH;

    function ACOSH (X : real) return real is
    	-- returns ln( X + sqrt( X**2 - 1));   X >= 1
    begin
      	if abs x < 1.0 then 
         	assert false report "Out of range parameter passed to ACOSH" 
			severity ERROR; 
         	return x;
      	end if;

	return ( LOG( X + SQRT( X**2 - 1.0)) );
    end ACOSH;

    function ATANH (X : real) return real is
    	-- returns (ln( (1 + X)/(1 - X)))/2 ; | X | < 1
    begin
      	if abs x >= 1.0 then 
        	assert false report "Out of range parameter passed to ATANH" 
			severity ERROR; 
        	return x;
      	end if;

	return( LOG( (1.0+X)/(1.0-X) )/2.0 );
    end ATANH;

end  MATH_REAL;



--------------------------------------------------------------- 
--
-- This source file may be used and distributed without restriction.
-- No declarations or definitions shall be included in this package.
-- This package cannot be sold or distributed for profit. 
--
--   ****************************************************************
--   *                                                              *
--   *                      W A R N I N G		 	    *
--   *								    *
--   *   This DRAFT version IS NOT endorsed or approved by IEEE     *
--   *								    *
--   ****************************************************************
--
-- Title:    PACKAGE BODY MATH_COMPLEX
--
-- Purpose:  VHDL declarations for mathematical package MATH_COMPLEX
--	     which contains common complex constants and basic complex
--	     functions and operations.
--
-- Author:   IEEE VHDL Math Package Study Group 
--
-- Notes:     
--	The package body uses package IEEE.MATH_REAL
--
-- 	The package body shall be considered the formal definition of 
-- 	the semantics of this package. Tool developers may choose to implement 
-- 	the package body in the most efficient manner available to them.
--
--   Source code for this package body comes from the following
--	following sources: 
--		IEEE VHDL Math Package Study Group participants,
--		U. of Mississippi, Mentor Graphics, Synopsys,
--		Viewlogic/Vantage
--
-- History:
-- 	Version	0.1	Jose A. Torres	4/23/93	First draft
-- 	Version	0.2	Jose A. Torres	5/28/93	Fixed potentially illegal code
-- 	Version	0.3	Jose A. Torres	9/2/94 	Fixed COMPLEX_TO_POLAR()
-- 	Version	0.9	Jose A. Torres	9/30/94	Rev'd up for distribution
--
-------------------------------------------------------------
Library IEEE;

Use IEEE.MATH_REAL.all;		-- real trascendental operations

Package body MATH_COMPLEX is

    function CABS(Z: in complex ) return real is
    	-- returns absolute value (magnitude) of Z
	variable ztemp : complex_polar;
    begin
		ztemp := COMPLEX_TO_POLAR(Z);
		return ztemp.mag;
    end CABS;

    function CARG(Z: in complex ) return real is
    	-- returns argument (angle) in radians of a complex number
     variable ztemp : complex_polar;
    begin
    		ztemp := COMPLEX_TO_POLAR(Z);
		return ztemp.arg;
    end CARG;

    function CMPLX(X: in real;  Y: in real := 0.0 ) return complex is
    	-- returns complex number X + iY
    begin
		return COMPLEX'(X, Y);
    end CMPLX;

    function "-" (Z: in complex ) return complex is
    	-- unary minus; returns -x -jy for z= x + jy
    begin
    		return COMPLEX'(-z.Re, -z.Im);
    end "-";

    function "-" (Z: in complex_polar ) return complex_polar is
    	-- unary minus; returns (z.mag, z.arg + MATH_PI)
    begin
    		return COMPLEX_POLAR'(z.mag, z.arg + MATH_PI);
    end "-";

    function CONJ (Z: in complex) return complex is
    	-- returns complex conjugate (x-jy for z = x+ jy)
    begin
    		return COMPLEX'(z.Re, -z.Im);
    end CONJ;

    function CONJ (Z: in complex_polar) return complex_polar is
    	-- returns complex conjugate (z.mag, -z.arg)
    begin
    		return COMPLEX_POLAR'(z.mag, -z.arg);
    end CONJ;

    function CSQRT(Z: in complex ) return complex_vector is
    	-- returns square root of Z; 2 values
		variable ztemp : complex_polar;
		variable zout : complex_vector (0 to 1);
		variable temp : real;
    begin
		ztemp := COMPLEX_TO_POLAR(Z);
		temp := SQRT(ztemp.mag);
		zout(0).re := temp*COS(ztemp.arg/2.0);
		zout(0).im := temp*SIN(ztemp.arg/2.0); 
    		
		zout(1).re := temp*COS(ztemp.arg/2.0 + MATH_PI);
		zout(1).im := temp*SIN(ztemp.arg/2.0 + MATH_PI);
		
		return zout;
    end CSQRT;

    function CEXP(Z: in complex ) return complex is
    	-- returns e**Z
    begin
		return COMPLEX'(EXP(Z.re)*COS(Z.im), EXP(Z.re)*SIN(Z.im));
    end CEXP;

    function COMPLEX_TO_POLAR(Z: in complex ) return complex_polar is
    	-- converts complex to complex_polar
    begin
	if ( z.re = 0.0 ) then
	    if ( z.im = 0.0 ) then
		return COMPLEX_POLAR'(0.0, 0.0);
	    elsif ( z.im > 0.0 ) then
		return COMPLEX_POLAR'(z.im, MATH_PI/2.0);
	    else
		return COMPLEX_POLAR'(-z.im, -MATH_PI/2.0);
	    end if;
	end if;

    	return COMPLEX_POLAR'(sqrt(z.re**2 + z.im**2),atan2(z.im,z.re));
    end COMPLEX_TO_POLAR;

    function POLAR_TO_COMPLEX(Z: in complex_polar ) return complex is
    	-- converts complex_polar to complex
    begin
    		return COMPLEX'( z.mag*cos(z.arg), z.mag*sin(z.arg) ); 
    end POLAR_TO_COMPLEX;

    		
    --
    -- arithmetic operators
    --

    function "+" ( L: in complex;  R: in complex ) return complex is
    begin
    		return COMPLEX'(L.Re + R.Re, L.Im + R.Im);
    end "+";

    function "+" (L: in complex_polar; R: in complex_polar) return complex is
		variable zL, zR : complex;
    begin
		zL := POLAR_TO_COMPLEX( L );
		zR := POLAR_TO_COMPLEX( R );
		return COMPLEX'(zL.Re + zR.Re, zL.Im + zR.Im);
    end "+";

    function "+" ( L: in complex_polar; R: in complex ) return complex is
    		variable zL : complex;
    begin
    		zL := POLAR_TO_COMPLEX( L );
		return COMPLEX'(zL.Re + R.Re, zL.Im + R.Im);
    end "+";

    function "+" ( L: in complex;  R: in complex_polar) return complex is
    		variable zR : complex;
    begin
    		zR := POLAR_TO_COMPLEX( R );
		return COMPLEX'(L.Re + zR.Re, L.Im + zR.Im);
    end "+";

    function "+" ( L: in real;     R: in complex ) return complex is
    begin
    		return COMPLEX'(L + R.Re, R.Im);
    end "+";

    function "+" ( L: in complex;  R: in real )    return complex is
    begin
    		return COMPLEX'(L.Re + R, L.Im);
    end "+";

    function "+" ( L: in real;  R: in complex_polar) return complex is
    		variable zR : complex;
    begin
    		zR := POLAR_TO_COMPLEX( R );
		return COMPLEX'(L + zR.Re, zR.Im);
    end "+";

    function "+" ( L: in complex_polar;  R: in real) return complex is
    		variable zL : complex;
    begin
    		zL := POLAR_TO_COMPLEX( L );
		return COMPLEX'(zL.Re + R, zL.Im);
    end "+";

    function "-" ( L: in complex;  R: in complex ) return complex is
    begin
    		return COMPLEX'(L.Re - R.Re, L.Im - R.Im);
    end "-";

    function "-" ( L: in complex_polar; R: in complex_polar) return complex is
    		variable zL, zR : complex;
    begin
    		zL := POLAR_TO_COMPLEX( L );
		zR := POLAR_TO_COMPLEX( R );
		return COMPLEX'(zL.Re - zR.Re, zL.Im - zR.Im);
    end "-";

    function "-" ( L: in complex_polar; R: in complex ) return complex is
    		variable zL : complex;
    begin
    		zL := POLAR_TO_COMPLEX( L );
		return COMPLEX'(zL.Re - R.Re, zL.Im - R.Im);
    end "-";

    function "-" ( L: in complex;  R: in complex_polar) return complex is
    		variable zR : complex;
    begin
    		zR := POLAR_TO_COMPLEX( R );
		return COMPLEX'(L.Re - zR.Re, L.Im - zR.Im);
    end "-";

    function "-" ( L: in real;     R: in complex ) return complex is
    begin
    		return COMPLEX'(L - R.Re, -1.0 * R.Im);
    end "-";

    function "-" ( L: in complex;  R: in real )    return complex is
    begin
    		return COMPLEX'(L.Re - R, L.Im);
    end "-";

    function "-" ( L: in real;  R: in complex_polar) return complex is
    		variable zR : complex;
    begin
    		zR := POLAR_TO_COMPLEX( R );
		return COMPLEX'(L - zR.Re, -1.0*zR.Im);
    end "-";

    function "-" ( L: in complex_polar;  R: in real) return complex is
    		variable zL : complex;
    begin
    		zL := POLAR_TO_COMPLEX( L );
		return COMPLEX'(zL.Re - R, zL.Im);
    end "-";

    function "*" ( L: in complex;  R: in complex ) return complex is
    begin
        return COMPLEX'(L.Re * R.Re - L.Im * R.Im, L.Re * R.Im + L.Im * R.Re);
    end "*";

    function "*" ( L: in complex_polar; R: in complex_polar) return complex is
		variable zout : complex_polar;
    begin
		zout.mag := L.mag * R.mag;
		zout.arg := L.arg + R.arg;
		return POLAR_TO_COMPLEX(zout);
    end "*";

    function "*" ( L: in complex_polar; R: in complex ) return complex is
		variable zL : complex;
    begin
	zL := POLAR_TO_COMPLEX( L );
	return COMPLEX'(zL.Re*R.Re - zL.Im * R.Im, zL.Re * R.Im + zL.Im*R.Re);
    end "*";

    function "*" ( L: in complex;  R: in complex_polar) return complex is
    		variable zR : complex;
    begin
    	zR := POLAR_TO_COMPLEX( R );
	return COMPLEX'(L.Re*zR.Re - L.Im * zR.Im, L.Re * zR.Im + L.Im*zR.Re);
    end "*";

    function "*" ( L: in real;     R: in complex ) return complex is
    begin
    		return COMPLEX'(L * R.Re, L * R.Im);
    end "*";

    function "*" ( L: in complex;  R: in real )    return complex is
    begin
    		return COMPLEX'(L.Re * R, L.Im * R);
    end "*";

    function "*" ( L: in real;  R: in complex_polar) return complex is
    		variable zR : complex;
    begin
    		zR := POLAR_TO_COMPLEX( R );
    		return COMPLEX'(L * zR.Re, L * zR.Im);
    end "*";

    function "*" ( L: in complex_polar;  R: in real) return complex is
    		variable zL : complex;
    begin
    		zL := POLAR_TO_COMPLEX( L );
    		return COMPLEX'(zL.Re * R, zL.Im * R);
    end "*";

    function "/" ( L: in complex;  R: in complex ) return complex is
    		variable magrsq : REAL := R.Re ** 2 + R.Im ** 2;
   begin 
      if (magrsq = 0.0) then
         assert FALSE report "Attempt to divide by (0,0)"
         	severity ERROR;
         return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      else 
         return COMPLEX'( (L.Re * R.Re + L.Im * R.Im) / magrsq,
                    (L.Im * R.Re - L.Re * R.Im) / magrsq);
      end if;
    end "/";

    function "/" ( L: in complex_polar; R: in complex_polar) return complex is
		variable zout : complex_polar;
    begin
    	if (R.mag = 0.0) then
         	assert FALSE report "Attempt to divide by (0,0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	zout.mag := L.mag/R.mag;
		zout.arg := L.arg - R.arg;
		return POLAR_TO_COMPLEX(zout);
      	end if;
    end "/";

    function "/" ( L: in complex_polar; R: in complex ) return complex is
		variable zL : complex;
		variable temp : REAL := R.Re ** 2 + R.Im ** 2;
    begin
    	if (temp = 0.0) then
         	assert FALSE report "Attempt to divide by (0.0,0.0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	zL := POLAR_TO_COMPLEX( L );
         	return COMPLEX'( (zL.Re * R.Re + zL.Im * R.Im) / temp,
                    (zL.Im * R.Re - zL.Re * R.Im) / temp);
      	end if; 
    end "/";

    function "/" ( L: in complex;  R: in complex_polar) return complex is
    		variable zR : complex := POLAR_TO_COMPLEX( R );
		variable temp : REAL := zR.Re ** 2 + zR.Im ** 2;
    begin
    	if (R.mag = 0.0) or (temp = 0.0) then
         	assert FALSE report "Attempt to divide by (0.0,0.0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	return COMPLEX'( (L.Re * zR.Re + L.Im * zR.Im) / temp,
                    (L.Im * zR.Re - L.Re * zR.Im) / temp);
      	end if; 
    end "/";

    function "/" ( L: in real;     R: in complex ) return complex is
    		variable temp : REAL := R.Re ** 2 + R.Im ** 2;
    begin 
      	if (temp = 0.0) then
         	assert FALSE report "Attempt to divide by (0.0,0.0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	temp := L / temp;
         	return  COMPLEX'( temp * R.Re, -temp * R.Im );
      	end if; 
    end "/";

    function "/" ( L: in complex;  R: in real )    return complex is
    begin
    	if (R = 0.0) then
         	assert FALSE report "Attempt to divide by (0.0,0.0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	return COMPLEX'(L.Re / R, L.Im / R);
      	end if; 
    end "/";

    function "/" ( L: in real;  R: in complex_polar) return complex is
    		variable zR : complex := POLAR_TO_COMPLEX( R );
		variable temp : REAL := zR.Re ** 2 + zR.Im ** 2;
    begin
    	if (R.mag = 0.0) or (temp = 0.0) then
         	assert FALSE report "Attempt to divide by (0.0,0.0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	temp := L / temp;
         	return  COMPLEX'( temp * zR.Re, -temp * zR.Im );
      	end if; 
    end "/";

    function "/" ( L: in complex_polar;  R: in real) return complex is
    		variable zL : complex := POLAR_TO_COMPLEX( L );
    begin
    	if (R = 0.0) then
         	assert FALSE report "Attempt to divide by (0.0,0.0)"
         		severity ERROR;
         	return COMPLEX'(REAL'RIGHT, REAL'RIGHT);
      	else 
         	return COMPLEX'(zL.Re / R, zL.Im / R);
      	end if; 
    end "/";
end  MATH_COMPLEX;

From jose  Mon Oct 17 10:58:16 1994
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA07571; Mon, 17 Oct 94 10:58:16 PDT
Date: Mon, 17 Oct 94 10:58:16 PDT
From: jose (Jose Torres)
Message-Id: <9410171758.AA07571@vhdl.vhdl.org>
To: analog, isac, math, parallel, tac, vhdledif, vhdlsynth, vital, waves
Subject: Call for participants in the VHDL Math Package balloting group


*************************************************************************
				ATTENTION!
	  STANDARD VHDL MATHEMATICAL PACKAGES ARE COMING .... 
************************************************************************* 

YOU ARE INVITED TO PARTICIPATE IN THE BALLOTING GROUP for STANDARDIZING 
VHDL MATHEMATICAL PACKAGES. IF INTERESTED, PLEASE USE THE APPLICATION FORM 
that appears below. "CUT" along the dotted line, fill out the form and either: 

Send a hard copy by mail to Rosemary Tennis at the address given at the bottom,
or Fax it to Rosemary Tennis at 908-562-1571,
or E-mail to rtennis@stdsmail.ieee.org

For e-mail, please make sure to enter 
		Re: P1076.2 
in the subject line.


If you are interested in previewing the packages, these can be downloaded 
from the vhdl.org machine.

The packages are in ftp:
	//vhdl.org/vi/math/package/math_head.9.30.94.vhd
	//vhdl.org/vi/math/package/math_body.9.30.94.vhd

			or

	//vhdl.org/vi/math/package/math_package.tar.Z

or in other words:

ftp vhdl.org
username: anonymous
password: <your e-mail address>
ftp> cd /vi/math/package
ftp> get math_package.tar.Z
ftp> bye

Please send all technical feedback on these packages to: 
math-request@vhdl.org


Thank you,

- Jose A. Torres, Working Group Chair, PAR 1076.2 
(jose@vhdl.org)

----------------------------- cut here ---------------------------------------- 


		The Design Automation Standards Committee 
	of the IEEE Computer Society invites you to ballot on 

	P1076.2: Standard VHDL Language Mathematical Package 

		Return deadline:	November 17, 1994


SCOPE:	Definition of a set of standard mathematical packages for VHDL that
	include most oftenly used real and complex elementary functions. 
	Examples are trigonometric, hyperbolic, random number generators, etc. 

PURPOSE:Many model descriptions need this type of mathematical functions. 
	However, IEEE Standard 1076 does not provide as	part of the language a 
	pre-defined standard set of mathematical functions for this purpose. 
	This Standard will define a set of packages, with a basic set of 
	mathematical functions, to allow portability of VHDL descriptions that 
	use this type of functionality.  

Your Category of Interest in this Standards Ballot (i.e., do you use or produce 
the items in this standard?):
	User__	Producer__	Academic__	 General Interest__

(Note: Please choose only ONE of the above. If you have any combination of 
Interests, check the General Interest Category) 

Please Print Clearly:			New address? Yes or No

Name:

Phone:

Fax:

Company:

Mailing Address:

EMail:

Home address (important: confidential; it will only be used in case of 
    		returned mail): 


IEEE or Computer Society Membership Number_______________ 

Check here if not a member of IEEE or the Computer Society ______ 

Balloter's Responsibility

If you become part of the balloting body, you will have 30 days to review and 
respond to the draft. In order for the Sponsor Ballot to be valid, at least 
75% of the ballots sent must be returned. For that reason: VOTERS HAVE AN 
OBLIGATION TO RESPOND. Eligible voters are members of the IEEE or Computer 
Society and non-members will comment as Parties of Interest. For Membership 
Application, Call (908) 562-5524


Signature:			 Date:



If you want confirmation that this form has been received by the IEEE Standards 
Office, please enclose a stamped, pre-addressed post card along with this form
(if sent by mail) or indicate that you want a "return receipt" if sent by 
e-mail. 

____Yes, I want to be part of the DASC Balloting Pool. 

Please return by November 17, 1994 to:
			Rosemary Tennis
			IEEE Standards Office
			445 Hoes Lane, PO. Box 1331
			Piscataway, NJ 08855-1331
			Fax: 908/562-1571


From EEHANSON@VM.CC.OLEMISS.EDU  Tue Feb  7 14:52:06 1995
Return-Path: <EEHANSON@VM.CC.OLEMISS.EDU>
Received: from VM.CC.OLEMISS.EDU by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA20145; Tue, 7 Feb 95 14:52:06 PST
Message-Id: <9502072252.AA20145@vhdl.vhdl.org>
Received: from VM.CC.OLEMISS.EDU by VM.CC.OLEMISS.EDU (IBM VM SMTP V2R2)
   with BSMTP id 5446; Tue, 07 Feb 95 16:46:25 CST
Received: by UMSVM (Mailer R2.10 ptf000) id 2725; Tue, 07 Feb 95 16:46:24 CST
Date:         Tue, 07 Feb 95 16:45:22 CST
From: Don Hanson <EEHANSON@VM.CC.OLEMISS.EDU>
Subject:      Comments on FAXed Document
To: Math Package Folks <math@vhdl.org>
Cc: Jose <jose@synopsys.com>

Comments on FAXed
  IEEE VHDL Math Package - draft

Under 2.1 Math_Real   line 20  trascendental -> transcendental  (sp)

page 12
  function "**" (X: integer; Y: real ) return real;  --X**Y
  function "**" (X: real; Y: real ) return real;  --X**Y

  We have (X: integer; Y: real ) and (X: real; Y: real )
  do we need (X: integer; Y: integer ) and (X: real; Y: integer )  ??
   or are these recommended to use the integer (Y) function explicitly.

Page 13
   previous functions have had error lines
   Do we need error lines for LOG, TAN, etc functions??
     function LOG( X: real) return real;
     --returns natural logarithm of X; X>0
     --error if X<=0        <<---??

Page 13
    Should PI be MATH_PI in comments??

Page 13
   function ASINH(X:real) return real;
    -- returns ln(x + sqrt( x**2 + 1 ))
  Should this comment be in the VHDL Math package style or otherwise??
   -- return LOG(X + SQRT( X**2 + 1 ))
    NOTE:   X**2  is not defined currently...  we need a function-->>
             function "**" (X: real; Y: integer ) return real;  --X**Y

  same for ACOSH and ATANH ??

Page 15
  function CABS(Z: in complex) return real;
   -- return absolute value (magnitude) of Z
Should we give the formula  SQRT( Z.re**2 + Z.im**2 ) in another comment??

  function CARG(Z: in complex) return real;
  -- returns argument (angle) in radians of a complex number
Should we say:  returns ATAN2(Z.re, Z.im)

We have two functions with complex_polar returned...
   These are "-" and CONJ.  As far as I can tell, these are the only
   functions with complex_polar returned besides the explicit
      COMPLEX_TO_POLAR  function.
Since all arithmetic operators return only complex and never
   complex_polar, it isn't clear why these are needed??  All arithmetic
   operations end up with a complex result.
Why use complex_polar at all except for final output results??

Page 18..
   A.4  Precision and convergence of functions in Math_Real
  The iterative nature of the algorithms is undesirable, and unneeded.
  The usual approach is to study the algorithm analytically for an
  upper bound to the error and take a FIXED number of terms.  However,
  I have used the same basic algorithms that you are using with good
  success.  Given the maximum error, one can find the maximum argument
  that can be used to within that error.  So there is a tradeoff.  Do
  you want to have maximum speed for small to medium arguments, or do
  you want maximum accuracy for all arguments.
  With a little analytical work, the values of the "counters" that stop
  the iteration can be found.  I would prefer to see this work done--it
  is probably already done somewhere in the literature--than to imply
  that the functions are inaccurate.  Further optimization of speed of
  the functions would require storing arrays of numbers, so that they
  would not have to be computed every time they are used, which is the
  algorithm you are using.


The bodies that I am looking at were the last e-mailed to me::

The series for exp(x) that is used is
  exp(x) = 1+x+x**2/2!+x**3/3!+...  x >0
This approach is asking for trouble.  It is better to use that fact that:
  exp(x+y) = exp(x)*exp(y)
There are many ways this can be used.  For example, if  y is made an integer
value, then x is non-integral (in general) and this limits the range of the
arguments   exp(x) = 1+x+x**2/2!+...   for  1<=x <=2  or some such thing.
Then limits on the accuracy of this part of the function can be found.  Then
it is just necessary to take e to an integral power.  There are many
references that I could find that use this approach.

Since all of the hyperbolic functions are based on EXP, it is important to
get the EXP efficient.  Also, your hyperbolic functions may be error prone
for certain arguments and you are also recomputing the EXP function twice,
when it only needs to be done once.  This needs to be fixed.

Your use of eps in the SIN function in some cases seems overly harsh.
For example,  If (  abs(x) <=  eps )  then return 0.0;
  There are many times when we want the SIN ( 1.0E-30 ) and want
significant digits.  Your approach gives 0.0 instead of 1.0E-30.  It
gives 0.0 instead of significant digits as long as x <= 1.E-06.  Most
people don't want this.

One problem that I have is that the only VHDL I have right now is several years
old, from MCC.  This limits my ability to test the package body.  However, I am
trying to get an updated version of VHDL.  This makes it impossible for me to
test any of these functions.  However, they could be done much better in light
of the SIN issue above.

Let me know if I can help in any way.

      _______
     /       |
====/   *    |===============================================================
|  /  Oxford |  Dr. Donald F. Hanson          Department of                 |
|  /         |  Associate Professor                  Electrical Engineering |
|  \         |  Fax: (601)232-7231            University of Mississippi     |
|   |        |  Phone: (601)232-5389          University, MS                |
|   /        |  eehanson@vm.cc.olemiss.edu    38677                         |
===/         |===============================================================
  |______    |
        /    |
        \____|

From jose  Fri Feb 10 01:06:24 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA21312; Fri, 10 Feb 95 01:06:24 PST
Date: Fri, 10 Feb 95 01:06:24 PST
From: jose (Jose Torres)
Message-Id: <9502100906.AA21312@vhdl.vhdl.org>
To: math@vhdl.org
Subject: vhdl math package status


The purpose of this message is to let you know where we are at regarding
the math package.

A balloting group has been approved by IEEE and a draft of the documentation
is currently under review by the working group and IEEE.

We hope to be able to send the documentation out for general distribution 
and balloting by March.

***************************** HELP ********************************
> We NEED VOLUNTEERS to help finish a test suite for the whole package.
> We have a template for the test bench with some data points for
> the functions which can be used as a guideline.  If you are interested, please
> send a message to jose@vhdl.org
************************************************************************

As part of the process of balloting the package, I am working on putting
together a tutorial to disseminate information on the package, its
purpose, usage, and applications.

***************************** HELP ********************************
> I would appreciate any feedback/comments on applications that you are planning
> to use this functionality for or are currently using it, as well as
> any warnings you may have for other people.  I would like to include 
> this information in the tutorial, since one of the objectives is to spread
> knowledge on where and how you can use this functionality and also provide
> an insight on things to watch for when using it.
************************************************************************

I am also planning to talk with some people in the technical press, and it
very likely that they would be interested in talking with users of the
package or this type of functionality.  

***************************** HELP ********************************
> If you are a user and would be interested in participate in a telephone 
> conference call with the press for this purpose, please let me know as soon 
> as possible (no later  than Tuesday  2/15).
************************************************************************

We are in the process of running additional checks and fixing reported
problems.  As soon as a new version is available for general consumption
I will let you know.

Thanks for your interest.

Regards,


Jose A. Torres
(jose@vhdl.org)

From jose  Sat Mar 25 00:26:34 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA04790; Sat, 25 Mar 95 00:26:34 PST
Date: Sat, 25 Mar 95 00:26:34 PST
From: jose (Jose Torres)
Message-Id: <9503250826.AA04790@vhdl.vhdl.org>
To: math@vhdl.org
Subject: new version of the math package
Cc: jose


Hello everyone,

There is a new version of the package that incorporates several of the 
suggestions and feedback that we received through the reflector, as well as
feedback generated during the creation of the template for the test bench.

The new version of the package is located in the following directory
(server machine: vhdl.org):

	/vi/math/package

under the following file names:
	math_head.3.24.95.vhd	-- contains the package declaration
	math_body.3.24.95.vhd   -- contains the package body
	math.3.24.95.tar.Z	-- compacted tar file that contains the
				   previous two.

If you do not have access to ftp and would like to receive a copy through
e-mail, please let me know.

This new version of the package has several changes with respect the previous
broadcasted version.  In summary, the changes in the package include:
- fixes to the algorithms in functions that were generating incorrect results,
- changes in the order of arguments in some functions for consistency with
  usage of equivalent functionality in other languages
- changes in the name of some functions for clarity and consistency with
  names in ADA and to take advantage of the overloading capabilities of VHDL
- addition of new functions that were considered necessary as part of
  the basic building blocks
- deletion of the foreign functions in order to have a package that is
  VHDL only
- enhancements in comments to include valid ranges and domains for the
  functions, as well as error conditions.

We would appreciate your feedback on this new version as soon as possible,
since we are planning to send the ballots out around the middle of next
month.  We are still in the process of finishing the template for the
test bench.  For those of you who have volunteered to help on the 
completion of the test bench, we will let you know pretty soon how
you can help us to finish this task.


A detailed list of all the major changes follows:

1) For most of the functions,  the comments after their declaration were
   modified to include the purpose of the function, the domain of its arguments,
   the range of its return value, error conditions, and predefined results
   for special cases.

2) Changed the usage of LOG(BASE, X) to be LOG(X, BASE) for consistency with 
   ADA, and as per request of some users

3) Removed the definition of COMPLEX_VECTOR in math-complex for consistency
   with math_real

4) Renamed the following functions for consistency with ADA and to take
   advantage of VHDL overloading facilities:
	CABS -> ABS
	CARG -> ARG
	CSQRT -> SQRT
	CEXP -> EXP

	ASIN -> ARCSIN
	ACOS -> ARCCOS
	ATAN -> ARCTAN
	ATAN2 -> ARCTAN
	ASINH -> ARCSINH
	ACOSH -> ARCCOSH
	ATANH -> ARCTANH

5) Changed CSQRT (now SQRT) to return only one value; the one with positive
   real part.

6) Added the following constants:
	MATH_HALF_PI
	MATH_Q_PI
	MATH_3_HALF_PI
	MATH_TWO_PI

7) Modified CEIL and FLOOR to fix error

8) Modified FMAX and FMIN to return X when X = Y

9) Modified convergence criteria in SQRT and CBRT

10) Modified MATH_EPS to represent 5 fractional decimal digits for
    consistency with minimum LRM requirements.

11) Modified all trigonometric functions to return predefined values for
    special cases such as 0, pi, pi/2, 3pi/2, and 2pi

12) Modified SINH, COSH, and TANH to fix computation for special cases

13) Modified "**" check for error condition and value computation

14) Modified EXP to make use of the relation EXP(x+y) = EXP(x)*EXP(y) for
    better accuracy

15) Modified EXP and LOG to check for illegal ranges and to compute
    predefined values for special cases

16) Modified SIN, COS, TAN for greater accuracy

17) Modified ASINH, ACOSH, and ATANH for special cases

18) Added the following functions in math_real:
	TRUNC(X)
	MOD(X,Y)

19) Added the following function in math_complex:
	LOG(Z)

20) Modified the order of arguments in ARCTAN() from ARCTAN(X,Y) to
    ARCTAN(Y,X) for consistency with usage in other languages 

21) Added complete support for the type COMPLEX_POLAR in MATH_COMPLEX.
    The new version now supports the same functions for both COMPLEX
    and COMPLEX_POLAR.  Some people feel that complex_polar should
    be part of a different package, I would like to hear your position
    regarding this matter.

22) Removed the complex arithmetic operators that had a combination of
    COMPLEX and COMPLEX_POLAR argument types, as part of the process
    of providing same functionality for both types.

23) Removed all the foreign functions, so that the package has no
    dependencies on non-VHDL functions.  The deleted functions are
	SRAND
	RAND
	GET_RAND_MAX

24) Modified package banners to fit IEEE requirements.

25) The draft of the documentation has been revised by IEEE and the
    corresponding changes have been incorporated.

From baker@prl.philips.nl  Mon May  8 08:51:52 1995
Return-Path: <baker@prl.philips.nl>
Received: from relay.philips.nl by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA23230; Mon, 8 May 95 08:51:52 PDT
Received: from prl.philips.nl ([130.144.1.112]) by relay.philips.nl (8.6.9/8.6.9-950414) with SMTP id RAA13249 for <math@vhdl.org>; Mon, 8 May 1995 17:33:43 +0200
From: baker@prl.philips.nl
Received: by prl.philips.nl; Mon, 8 May 1995 17:33:42 +0200
Received: by elaps.prl.philips.nl ; Mon, 8 May 1995 17:33:41 +0200
Message-Id: <199505081533.AA292117221@elaps.prl.philips.nl>
Subject: help
To: math@vhdl.org
Date: Mon, 08 May 1995 17:33:41 METDST
X-Mailer: Elm [revision: 109.14]

help



--
    Baker, m.sc. K.                  

    Philips Research Laboratories
    Building WAY4 101, Prof. Holstlaan 4, 5656 AA Eindhoven, The Netherlands
    Phone: +31-40-743640

    E-mail: baker@prl.philips.nl

From verstrae@prl.philips.nl  Tue May  9 07:46:23 1995
Return-Path: <verstrae@prl.philips.nl>
Received: from relay.philips.nl by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA07017; Tue, 9 May 95 07:46:23 PDT
Received: from prl.philips.nl ([130.144.1.112]) by relay.philips.nl (8.6.9/8.6.9-950414) with SMTP id QAA26738 for <math@vhdl.org>; Tue, 9 May 1995 16:40:34 +0200
From: verstrae@prl.philips.nl
Received: by prl.philips.nl; Tue, 9 May 1995 16:40:33 +0200
Received: by casarea.prl.philips.nl ; Tue, 9 May 1995 16:40:32 +0200
Message-Id: <199505091440.AA249300432@casarea.prl.philips.nl>
Subject: info
To: math@vhdl.org
Date: Tue, 09 May 1995 16:40:32 METDST
X-Mailer: Elm [revision: 109.14]


--
    Verstraelen, ing. M.J.W.         

    Philips Research Laboratories
    Building WAY4 073, Prof. Holstlaan 4, 5656 AA Eindhoven, The Netherlands
    Phone: +31-40-743728

    E-mail: verstrae@prl.philips.nl

From jose  Wed May 10 12:26:32 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA24906; Wed, 10 May 95 12:26:32 PDT
Date: Wed, 10 May 95 12:26:32 PDT
From: jose (Jose Torres)
Message-Id: <9505101926.AA24906@vhdl.vhdl.org>
To: math@vhdl.org
Subject: Standard Simulation Control Language


Please find enclosed information about a new standardization effort that
I have been asked to pass along.

>>>>>>>>>>>>>>>>>>

                    Announcing the formation of the
            Standard Simulation Control Language Study Group
                         of the IEEE DASC


A new Study Group has been approved by IEEE Computer Society Design
Automation Standards Committee.  The purpose of the Study Group is the
following:

   Standardize a simulation control language that is portable
   across simulation environments.

The Study Group is asking for participation from members of the
Verilog and VHDL community who are willing to work on this *HDL-
INDEPENDENT* effort.  We would like to have participation from the EDA
vendors as well as the user community.

To view the Study Group's home page, view:
        http://vhdl.org/vi/scl/Welcome.html

To find out more info about a group, send an email request to:
        scl-info@vhdl.org

To get added to an email exploder and be made aware of the groups
activities, send your email address to:
        scl-request@vhdl.org

To submit a message to an email exploder, email the message to:
        scl@vhdl.org  (Please do not send maintenance requests to
                       this address!!)

From eee3932d@descg2.desc.dla.mil  Wed May 10 12:33:04 1995
Return-Path: <eee3932d@descg2.desc.dla.mil>
Received: from descg2.desc.dla.mil by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA25013; Wed, 10 May 95 12:33:04 PDT
Received: by descg2.desc.dla.mil (5.61++/1.34)
	id AA15914; Wed, 10 May 95 15:27:35 -0400
Date: Wed, 10 May 95 15:27:35 -0400
From: eee3932d@descg2.desc.dla.mil (Tom Ricciuti)
Message-Id: <9505101927.AA15914@descg2.desc.dla.mil>
To: math@vhdl.org, verstrae@prl.philips.nl
Subject: Re:  info
Cc: tricciuti@descg2.desc.dla.mil

Prof. Holstlaan,

What information are you seeking?

Tom Ricciuti

From jose  Wed May 10 12:38:57 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA25069; Wed, 10 May 95 12:38:57 PDT
Date: Wed, 10 May 95 12:38:57 PDT
From: jose (Jose Torres)
Message-Id: <9505101938.AA25069@vhdl.vhdl.org>
To: math@vhdl.org
Subject: Math package status


The purpose of this message is to let you know where we are at regarding
the balloting of P1076.2.

The status is as follows:

1) All the material was submitted to IEEE about 2 weeks ago.

2) IEEE is currently in the process of putting together the balloting
   packages. Their distribution will most probably happen within the
   next three weeks.

3) The last version of the package is located in the directory
	/vi/math/package
   at vhdl.org in the following files
	math_head.3.24.95.vhd     -- package declaration
	math_body.3.24.95.vhd	  -- package body
  or
	math.3.24.95.tar.Z	  -- compressed tar file of the previous two

4) A template for the test bench is available now, but I need volunteers
   to fill in the information in the test bench before we can make it
   available.  The job consists on entering input and output values, as
   well as running a simulator on it to check that things are in order.
   

If you do not have access to ftp and want to have a copy of the package,
please let me know it and I will e-mail the package to you.

Regards,

Jose A. Torres

From jose  Sun May 14 18:18:21 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA18195; Sun, 14 May 95 18:18:21 PDT
Date: Sun, 14 May 95 18:18:21 PDT
From: jose (Jose Torres)
Message-Id: <9505150118.AA18195@vhdl.vhdl.org>
To: math
Subject: VITAL workshop

For your information.

If you are planning to attend DAC at San Francisco this year, then you may be
interested on this workshop.

>>>>> cut here

VHDL INTERNATIONAL TO CONDUCT VITAL WORKSHOP SERIES

First in Series Slated June 15-16

         VHDL International is sponsoring a series of comprehensive two-day
technical workshops to train ASIC library developement and modelling
engineers to develop VHDL Initiative Toward ASIC Libraries (VITAL) models.
The first workshop is scheduled June 15-16 at the Biltmore Hotel & Suites
in Santa Clara, California.

These seminars will help ASIC library developers world-wide to come up to
speed rapidly on the VITAL 3.0 standard.  Rapid adoption of the VITAL
strategy for ASIC modeling will be beneficial for the ASIC and VHDL
industry as a whole.

Members of the IEEE VITAL team will be present at the workshop to assist
partcipants and answer any questions during the design example session


Some of the topics to be covered at the workshop are:

*       VITAL Overview
*       What is new in VITAL 3.0 and what has changed since 2.2b
*       Back Annotation
                        Introduction to SDF (Purpose; Organization
                        SDF to VITAL Mapping
*       VITAL Model Classification
                         Level 0 Modeling (Requirements)
                         Level 1 Modeling (Requirements)
*       Tables
                        Truth Tables
                        State Tables
*       Modeling Strategy
                        Pin-to-pin Delay Modeling
                        Distributed Delay Modeling
                        Conditional delays and timing checks
*       Negative Timing Constraints
                         Back Annotation and Negative Constraint Calculation
                         Limitations
*       Application and Examples
                Combinational Model
                Sequential Models
                Bus Models
                Memories
*       Special Topics
                        Differential Inputs
                        Wired Logic

Preleminary Workshop Agenda

Day 1   June 15th, 1995         9:00 AM - 5:00 PM
                VITAL Basics
                SDF
                Delay styles
                Level 0 and level 1 requirements

Day 2   June 16th, 1995         9:00 AM - 4:00 PM
                Application
                Design examples
                Negative constraints
                Changes from 2.2b

Instructor:

Ray Ryan, a full-time member of the technical staff at Synopsys in Mountain
View, Calif., member of the IEEE Technical Action Group responsible for the
VITAL specification and a former principal of Ryan & Ryan, will teach the
workshop in Santa Clara.

Course materials were developed by Ryan & Ryan of San Jose, Calif.

Fees:

$ 150.00 per person for VI corporate members
$ 250.00 per person for non-members
The fees include materials and lunch for two days.

Cancellation Policy:

A fee of $ 20.00 will be charged for cancellation prior to June 2, 95.
50% of the fees wil  be refunded for cancellation between June 2 - June 9
No refund for cancellation after June 9th

Payment:

Cheque or credit card only. No Ppurchase orders. Make cheque payable to
VHDL International

Registration:

The workshop is open on a first-come, first-served basis, with a limit of
100 attendees.

For reservations, please provide the following info via fax or email to
Lilia Periana of VHDL International:

Name____________________________   Title_______________________
Company _______________________________________________________
Address________________________________________________________
       ________________________________________________________
Tel:   ____________________________Fax:________________________
email _____________________________

If paying by credit card then please provide the following:

Credit  card number:____________________________ Expires on:_______
Type of crdit card:  Visa/MasterCard/________________________________

VHDL International, 3140 De La Cruz Blvd, Suite 200, Santa Clara, CA 95054
Tel: 408-492-9806  Fax: 408-970-4274  Email: viadmin@vhdl.org


From jose  Mon Jun 19 01:29:22 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA17864; Mon, 19 Jun 95 01:29:22 PDT
Date: Mon, 19 Jun 95 01:29:22 PDT
From: jose (Jose Torres)
Message-Id: <9506190829.AA17864@vhdl.vhdl.org>
To: math
Subject: minutes from meeting on 6/16/95


VHDL MATH PACKAGE WORKING GROUP, P1076.2 

Minutes of meeting in San Jose, 16 June 1995 


Present: Jose Torres (Chair), jose@vhdl.org
	 Charles Swart
	 Chuck Swart
	 John Hines
	 Greg Peterson
	 Joanne DeGroat

Next meeting: most probably at VIUF in October at Boston, MA, USA.

SUMMARY OF MEETING

J. Torres presented an overview of deliverables for this group, status of the
standardization process for this standard, expected schedule, and open
issues.

C. Swart presented an overview on the test bench for 1076.2, as well as
issues regarding accuracy to compare results and compare with zero.

Open issues were discussed and proposals for resolution were presented


1. DELIVERABLES for P1076.2

The VHDL math packages (P1076.2) will consist of basic functions and type 
conversions for real and complex types.  It consists of two packages:
MATH_REAL and MATH_COMPLEX.  The packages will be installed in library IEEE.

The deliverables will consist of the following: package declarations,
package bodies, and documentation for the standard.

A testbench will be prepared for each package as a guideline for implementors, 
but it will not formally be part of the standard and/or the documentation.

The latest version of the packages is available through anonymous ftp from 
vhdl.org, in the directory /vi/math/package, file names are: 
	math_head.6.13.95.vhd
	math_body.6.13.95.vhd

		or

	math.6.13.95.tar.Z	-- for tar compressed version of the 2 files


The packages can be retrieved as follows:

ftp vhdl.org
username: anonymous
password: <your e-mail address>
ftp> cd /vi/math/package
ftp> get math_head.6.13.95.vhd
ftp> get math_body.6.13.95.vhd
ftp> bye

If you do not have access to ftp, send an e-mail request to jose@vhdl.org


2. STATUS of P1076.2

All documentation for P1076.2 has been sent to IEEE for balloting.  Based on
the most up-to-date information, IEEE is planning to start sending ballots
out by 6/15/95.

Assuming that ballots are mailed around 6/15/95, the current tentative schedule
is as follows:
	- balloting: 6/22 - 7/22
	- address negative ballots: 7/22- 8/22
	- submit standard to IEEE board: 9/15/95 
	- get IEEE approval: 12/95 (board gets together every quarter)

For all of you who are part of the balloting group, please MAKE SURE TO RETURN
YOUR MATERIALS ASAP so that we have time to address your answers and make the
9/15/95 date, which is critical.  If we miss the September date, then we may 
need to wait until 3/96 to get IEEE approval.

The following is an extract of the conformance rules discussed and mentioned 
in the documentation that apply and pertain to the use and implementation of 
this standard:

  a)	No modifications shall be made to the package declarations whatsoever
  b)	The standard mathematical definition and conventional meaning of the 
	mathematical functions that are part of this standard, which are 
	clarified by the Math_Real and 	Math_Complex package bodies, represent 
	the formal semantics of the implementation of the Math_Real and 
	Math_Complex package declarations.  Implementers  of these packages may 
	choose to simply compile the package bodies as they are; or they may 
	choose to implement the package bodies in the most efficient form 
	available to the user.  Users shall not implement a semantic that 
	differs from the formal semantic specified herein.
  c) 	The Math_Real package shall be built on top of the standard data type 
	and precision requirements for floating point operations defined in 
	IEEE P1076-1993 (STD.STANDARD)
  d)	The minimum precision required is that of the VHDL LRM (IEEE P1076): 
	minimum of six 	decimal digits of precision in a range contained within 
	the bounds -1E38 to 1E38 inclusive. 
	Because of this reason and the fact that the functions are implemented 
	on digital computers with only finite precision, the functions provided 
	in this set of packages can, at best, only approximate the corresponding
	mathematically defined functions.  An implementation is allowed to 
	provide a higher precision.
  e)	For some functions, the implementation must deliver "prescribed results"
	for certain special arguments, as defined in the comments for the 
	functions both in the function declaration and the function body.  The 
	purpose is to strengthen the accuracy requirements at special argument 
	values.  Prescribed results take precedence over maximum relative error 
	requirements.
  f)	The semantics of the standard require that all the functions in the 
	packages detect and report invalid parameters (out of range) through 
	an assert statement.  Domain of valid values is indicated in the 
	Math_Real and Math_Complex package declarations.  The default value 
	of the severity level shall be Error.  An implementation is allowed to 
	provide a mechanism for the user to redefine the value of the severity 
	level.
  g)	The semantics of the standard do not require detection of overflow or 
	underflow.  Therefore, 	detection of underflow/overflow is optional 
	and implementation dependent
  h)	A definition of what comprises the capability of representing and 
	distinguishing signed zeroes is beyond the scope of this standard.  
	Implementations are allowed the freedom not to exploit the capability 
	even when available.  
  i)	If an implementation chooses to provide any extensions beyond the 
	minimum requirements of this standard (e.g., precision, overflow 
	handling, ...), then it shall document its behavior accordingly.


3. ISSUES with P1076.2

Currently IEEE is in the process of reviewing the scope and text of copyright
declarations, as well as whether or not the source code part of a standard
will be available for free distribution or not.  Therefore, the current
copyright in the packages for P1076.2 is temporary and subject to change
based on IEEE's resolution on this matter.

This is a very controversial matter that is being reviewed by all the
standardization groups that are in the process of submitting documentation
for balloting.  

A proposal was presented to modify the documentation to document the standard
without including the source code for the packages (POSIX like), and put
the source code in a different place for free access.  We will address
this issue during the balloting period.  


4. TESTBENCH: Status and Issues

The testbench, which is not part of the standard, will be provided as a 
reference for implementors and will not be part of the documentation.

The testbench is completely self-contained and fully written in VHDL.

The test bench exercises data points for all the functions, compares the
values generated by an implementation against a set of "golden" outputs, and 
produces a report with min accuracy found for each function. The goal of the
test bench is to provide a clue on how close an implementation is to the 
expected results and accuracy, but not to be a validation tool.

It is important to note that the math package results may be slightly different
on different workstation combinations due to the workstations particular support
for floating point arithmetic, which may not be immediately apparent to the 
average VHDL user.   Also, there are issues regarding the comparison of values
against zero (i.e., should e-25 be considered close or far from e-40?).

The current status of the test bench is as follows: a template for all the
functions is available, a reasonable/adequate set of data points is available 
for some functions but not all, further work/help is needed to complete the
sets of data points, it has been run on 4 different commercial
VHDL simulation tools.  The current version of the test bench is only available
upon request, since it is not complete.  If you are interested on receiving
a copy, please send e-mail to jose@vhdl.org or cswart@analogy.com.

Once the test bench is complete, it will be placed in the /vi/math/package
directory and eventually will be transferred to John Hines, so that it
becomes part of the VHDL test suite his group is responsible for.



From VhdlCohen@aol.com  Tue Jun 20 20:53:18 1995
Return-Path: <VhdlCohen@aol.com>
Received: from mail04.mail.aol.com by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA08610; Tue, 20 Jun 95 20:53:18 PDT
Received: by mail04.mail.aol.com
	(1.37.109.11/16.2) id AA090476423; Tue, 20 Jun 1995 23:47:03 -0400
Date: Tue, 20 Jun 1995 23:47:03 -0400
From: VhdlCohen@aol.com
Message-Id: <950620234336_99068088@aol.com>
To: math@vhdl.org
Subject: Book Announcement: "VHDL Coding Styles and Methodologies"

VHDL Coding Styles and Methodologies
by Ben Cohen

VHDL Coding Styles and  Methodologies provides an in-depth  study
of the  VHDL language  rules, coding  styles, and  methodologies.
This   book   clearly   distinguishes   good   from  poor  coding
methodologies using an easy to remember symbology notation  along
with a rationale  for each guideline.   The VHDL  concepts, rules
and  styles  are  demonstrated  using  complete  compilable   and
simulatable examples which are also supplied on the  accompanying
disk.   VHDL Coding  Styles and  Methodologies provides practical
applications  of  VHDL  and  techniques  that  are current in the
industry.   It explains  how to  apply the  VHDL guidelines using
several complete  examples.   The 'learning  by example' teaching
approach  along  with  an  in-depth  presentation of the language
rules application methodology provides the necessary knowledge to
create digital  hardware designs  and models  that are  readable,
maintainable, predictable, and efficient.

VHDL Coding Styles and Methodologies is intended for both college
students and design engineers.  It provides a practical  approach
to  learning  VHDL.    Combining  methodologies and coding styles
along with VHDL  rules leads the  reader in the  rights direction
from the beginning.


Contents:

Preface.  About the Disk.  Notation Conventions. 1. VHDL Overview
and Concepts. 2. Basic Language Elements. 3. Control  Structures.
4. Drivers. 5. VHDL  Timing. 6. Elements of  Entity/Architecture.
7.  Subprograms.  8.   Packages.  9.  User   Defined  Attributes,
Specifications, and  Configurations. 10.   Functional  Models and
Testbenches.  11.    UART  Project.  12.   Vital. 13.  Design for
Synthesis.    Appendix  A:    VHDL'93 and VHDL'87 Syntax Summary.
Appendix B:   Package  Standard.   Appendix C:   Package  Textio.
Appendix  D:    Package  STD_Logic_1164.    Appendix  E:     VHDL
Predefined Attributes.



Kluwer Academic Publishers, Boston

Date of publishing: July 1995
392 pp.
Hardbound
ISBN: 0-7923-9598-0
Prices:
NLG: 160.00
USD: 94.00
GBP: 63.95

=================================================================

Author: Ben Cohen
Title: VHDL Coding Styles and Methodologies
( ) Hardbound / ISBN: 0-7923-9598-0
    NLG: 160.00 USD: 94.00 GBP: 63.95


Ref: KAPIS

( ) Payment enclosed to the amount of _____________________
( ) Please send invoice
( ) Please charge my credit card account:

Card no.: |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|  Expiry date: ________

() Access       () American Express     () Mastercard
() Diners Club  () Eurocard             () Visa

Name of Card holder: __________________________________________

Delivery address:

Title       : _____________________ Initials: ____________M/F______

First name  : ________________ Surname: ________________________

Organization: _____________________________________________________

Department  : _____________________________________________________

Address     : _____________________________________________________

Postal Code : ___________________ City: ___________________________

Country     : _______________________Telephone: ________________

Email       : _______________________________________________

Date        : _______________ Signature: _______________________

Our European VAT registration
                      number is: |_|_|_|_|_|_|_|_|_|_|_|_|_|_|

To be sent to:
For customers in Mexico, USA and Canada: Rest of the world:

Kluwer Academic Publishers               Kluwer Academic Publishers
Group
Order Department                         Order Department
P.O. Box 358                             P.O. Box 322
Accord Station                           3300 AH Dordrecht
Hingham, MA 02018-0358                   The Netherlands
U.S.A.

Tel    : 617 871 6600                    Tel   : +31 78 524400
Fax    : 617 871 6528                    Fax   : +31 78 524474
Email  : kluwer@world.std.com            Email : services@wkap.nl

Payment will  be accepted  in any  convertible currency.   Please
check the rate of exchange with your bank.  Prices are subject to
change without notice.  All  prices are exclusive of Value  Added
Tax  (VAT).    Customers  in  the  Netherlands please add 6% VAT.
Customers  from  other  countries  in  the European Community:

* please fill in  the VAT number  of your institute/company  in
the appropriate space on the orderform:  or

* please add 6% VAT to the total order amount (customers from the
U.K. are
  not charged VAT).

=================================================================
==============================================================================
=
Ben Cohen is the author of "VHDL Coding Styles and Methodologies 
   ... an In-Depth Tutorial"  (ISBN 0-7923-9598-0)  to be published in July
95  by Kluwer Academic -- Publishers. (see gopher://gopher.wkap.nl for more
information, or write to kluwer@world.std.com). 
(Book was  written as an independent project to help  teach VHDL)
Hughes Aircraft Co,  RE- R1/B507
2000 East Imperial Hwy
El Segundo, Ca, 90245 
(310) 334-7389,      fax: (310) 334-1749
======================================================================

From jose  Mon Jul 17 12:32:57 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA14996; Mon, 17 Jul 95 12:32:57 PDT
Date: Mon, 17 Jul 95 12:32:57 PDT
From: jose (Jose Torres)
Message-Id: <9507171932.AA14996@vhdl.vhdl.org>
To: math
Subject: balloting group for 1076a.

For your information, please find enclosed the application form to
become part of the balloting group for standard 1076a (shared variables).

If you want to participate, please follow directions shown at end of
attached document.  Otherwise, discard this message.  Thanks.

Jose A. Torres


------cut here-------------

P1076a:  SUPPLEMENT to the VHDL Standard LRM for Shared Variables


Return deadline:  September 24, 1995


SCOPE:      Add semantics for shared variables to the VHDL standard.

PURPOSE:    VHDL currently has no semantics defined for global
            variables.  This effort will solve that problem

  Your Category of Interest in this Standards Ballot
  (i.e. do you use or produce the items in this standard?):

    User
    Producer
    Academic
    General Interest

(Note:  Please choose only ONE of the above.  If you have any combination of
Interests, check the General Interest Category)

Please Print Clearly:
New address? ___ Yes or ____ No
    Name:
    Phone:
    Fax:
    EMail:
    Company:
    Mailing Address:

IEEE or Computer Society Membership Number:
    Check here if not a member of IEEE or the Computer Society ____

Balloter's Responsibility:

If you become part of the  balloting body, you will have 30 days to review and
respond to the draft.  In order for the Sponsor Ballot to be valid, at least
75% of the ballots sent must be returned.  For that reason:  VOTERS HAVE AN
OBLIGATION TO RESPOND.  Eligible voters are members of the IEEE or Computer
Society and non-members will comment as Parties of Interest. For Membership
Application, Call (908) 562-5524


Signature:
Date:

If you want confirmation that this form has been received by the IEEE Standards
Office, please press "return receipt" when sending electronically, or enclose a
stamped, pre-addressed post card along with this form.

_____Yes, I want to be part of the DASC Balloting Pool and receive invitations
to ballot future DASC drafts.

-----cut here------------

Please return by September 24, 1995 to:          Rosemary Tennis
IEEE Standards Office
445 Hoes Lane, PO. Box 1331
Piscataway, NJ  08855-1331
Fax:  908/562-1571

To respond by e-mail send to:  rtennis@stdsmail.ieee.org
With subject filled in to   :  1076a ballot
With CC to:                    stephen@srbailey.com

want 

From jose  Thu Sep 14 22:22:13 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA03529; Thu, 14 Sep 95 22:22:13 PDT
Date: Thu, 14 Sep 95 22:22:13 PDT
From: jose (Jose Torres)
Message-Id: <9509150522.AA03529@vhdl.vhdl.org>
To: math
Subject: DASC meetings in October -- for your information


===============================================================================

                        IEEE COMPUTER SOCIETY
                DESIGN AUTOMATION STANDARDS COMMITTEE

                   MEETINGS IN CONJUNCTION WITH THE
              FALL 1995 VHDL INTERNATIONAL USERS' FORUM

                        17-18 OCTOBER 1995

                        NEWTON MARRIOTT HOTEL
                   MASSACHUSETTS TURNPIKE AND I-95
                              NEWTON, MA

                   SCHEDULE AS OF 14 September 1995


THURSDAY, 17 OCTOBER

Note:  All rooms today (except Lexington) are available only until 5:00 PM.
Therefore, I have scheduled today's meetings from 8:00 AM to 5:00 PM.

8:00 AM-12:00 N                  OBJECT-ORIENTED EXTENSIONS TO VHDL STUDY GROUP

    Contact:    Doug Dunlop, Chair                      703-827-2606
                Intermetrics, Inc.                      703-827-2609 [Fax]
                7918 Jones Branch Drive, Suite 710      dunlop@wash.inmet.com
                McLean, VA  22102

    This meeting will take place in the Lexington room.

8:00 AM-12:00 N                                       OPEN MODELING STUDY GROUP

    Contact:    Gabe Moretti, Chair                     303-581-2324
                Intergraph Electronics                  303-581-9143 [Fax]
                6101 Lookout Road, Suite A              gmoretti@ingr.com
                Boulder, CO  80301

    This meeting will take place in Salon F.

8:00 AM-12:00 N                               LIBRARY IEEE CONTENTS STUDY GROUP

    Contact:    Andrew Guyler, Chair                    503-685-1163
                Mentor Graphics, Inc.                   503-685-1268 [Fax]
                C-3                                   andrew_guyler@mentorg.com
                8005 S.W. Boeckman Road
                Wilsonville, OR  97070-7777

    This meeting will take place in Salon G.

8:00 AM-10:00 AM                VHDL-EDIF INTEROPERABILITY WORKING GROUP--P1165

    Contact:    J. Bhasker, Chair                       215-770-3983
                AT&T Bell Labs                          215-770-2773 [Fax]
                1247 South Cedar Crest Boulevard, 2R242 jb7@mhcnet.att.com
                Allentown, PA  18103

    This meeting will take place in Salon H.

10:00 AM-12:00 N                       VHDL MATH PACKAGE WORKING GROUP--P1076.2

    Contact:    Jose Torres, Chair                      415-327-2023
                1540 Oak Creek Drive, #305              jose@vhdl.org
                Palo Alto, CA  94304

    This meeting will take place in Salon H.

1:00 PM-5:00 PM                     VHDL SHARED VARIABLES WORKING GROUP--P1076A

    Contact:    Steve Bailey, Chair                     408-271-7048
                SRBailey Consulting                     408-377-1206 [Fax]
                911-C Apricot Avenue                    stephen@srbailey.com
                Campbell, CA  95008

This meeting will take place in the Lexington room.

1:00 PM-5:00 PM                SYSTEM DESIGN & DESCRIPTION LANGUAGE STUDY GROUP

    Contact:    Dave Barton, Chair                      703-827-2606
                Intermetrics, Inc.                      703-827-2609 [Fax]
                7918 Jones Branch Drive, Suite 710    dlb@hudson.wash.inmet.com
                McLean, VA  22102

    This meeting will take place in Salon F.

1:00 PM-5:00 PM               VHDL ANALOG EXTENSIONS WORKING GROUP LDC--P1076.1

    Contact:    Jean-Michel Berge, Chair                +33 76 76 43 35
                CNS-CCI                                 +33 76 90 34 43
                Chemin Du Vieux Chene--BP 98            berge@cns.cnet.fr
                MEYLAN CEDEX F-38243 FRANCE

    This meeting will take place in Salon G.

1:00 PM-5:00 PM        WAVEFORM AND VECTOR EXCHANGE SPEC. WORKING GROUP--1029.1

    Contact:    Bob Hillman, Chair                      315-330-2813
                Rome Laboratory/ERG                     315-330-2885 [Fax]
                525 Brooks Road                         hillmanr@ernet.af.mil
                Griffiss AFB, NY  13441-4505

    This meeting will take place in Salon H.

5:30 PM-7:30 PM                                 DASC STEERING COMMITTEE MEETING

    Contact:    Paul Menchini, Chair                    919-990-9506
                Menchini & Associates                   919-990-9507 [Fax]
                2 Davis Drive                           mench@mench.com
                P.O. Box 13036
                Research Triangle Park, NC  27709-3036

    This meeting will take place in the Lexington room.


FRIDAY, 18 OCTOBER

8:30 AM-5:30 PM                   VHDL ANALOG EXTENSIONS WORKING GROUP--P1076.1

    Contact:    Jean-Michel Berge, Chair

    This meeting will take place in the Lexington room.

8:30 AM-12:30 PM                 VHDL TIMING METHODOLOGY WORKING GROUP--P1076.4

    Contact:    Victor Berman, Chair                    508-446-6276
                Cadence Design Systems, Inc.            508-262-6777 [Fax]
                270 Billerica Road                      berman@cadence.com
                Chelmsford, MA  01824

    This meeting will take place in Salon F.

1:30 PM-3:30 PM               VERILOG ANALYSIS AND STANDARDIZATION GROUP--P1364

    Contact:    Maq Mannan                              408-721-6340
                National Semiconductor, Inc.            408-721-5382 [Fax]
                2900 Semiconductor Drive                mannan@galaxy.nsc.com
                Santa Clara, CA  95051

    This meeting will take place in Salon F.

3:30 PM-5:30 PM                            VHDL PARALLEL SIMULATION STUDY GROUP

    Contact:    John Willis, Chair                      507-288-3154
                FTL Systems, Inc.                       507-288-3154 [Fax]
                924 Sierra Lane NE                      jwillis@acm.org
                Rochester, MN  55901

    This meeting will take place in Salon F.


From jose  Wed Oct  4 13:05:20 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA21844; Wed, 4 Oct 95 13:05:20 PDT
Date: Wed, 4 Oct 95 13:05:20 PDT
From: jose (Jose Torres)
Message-Id: <9510042005.AA21844@vhdl.vhdl.org>
To: math@vhdl.org
Subject: P1076.2 Passes!


I am glad to inform you that the balloting for the Math package
closed on 9/14/95 with a majority of affirmative votes.

Vital 95 passed, here's the results:

 
         76% Returned
         46  Affirmative
          7  Negative
          3  Abstentions
 
        =>  86% Afirmative
 
The next step for the working group is to review the comments and negative
votes and prepare an answer to address them, as well as to update schedule
for submitting the proposal to the IEEE Board. As soon as I have information
on the schedule I will let you know.

Thanks a lot to all of you who have contributed during the process.

Jose A. Torres
Chair of P1076.2

From jose  Mon Nov 20 21:09:52 1995
Return-Path: <jose>
Received: by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA10192; Mon, 20 Nov 95 21:09:52 PST
Date: Mon, 20 Nov 95 21:09:52 PST
From: jose (Jose Torres)
Message-Id: <9511210509.AA10192@vhdl.vhdl.org>
To: math
Subject: minutes from DASC meeting on 10/19/95


VHDL MATH PACKAGE WORKING GROUP, P1076.2 

Minutes of meeting in Newton, MA on October 19, 1995


Present: Jose Torres (Chair), jose@vhdl.org
	 John Hines
	 Ernst Christen
	 Bob Collins

Next meeting: most probably at next VIUF meeting

SUMMARY OF MEETING

J. Torres presented an overview of balloting results, gave a summary of main 
areas addressed by either negative ballots or comments, discussed status of the 
IEEE copyright issue regarding distribution of the source code for the packages,
and presented the tentative schedule to bring this effort to completion.

Ernst C. talked about needs of the Analog group and situation regarding the 
floating point precision in VHDL and the Analog group requirements.

There was a discussion on what to do regarding the source code for the packages
and the documentation for the standard.

1. BALLOTING RESULTS

Balloting for 1076.2 was closed around the middle of September with the 
following results:

	Affirmative votes:	46
	Negative votes:		 7	
	Abstentions:		 2
		TOTAL		55

	Number of eligible voters in the balloting group: 72

Therefore, 1076.2 PASSED with 86% affirmative votes, and 76% eligible ballots
were returned.

The main comments received in the ballots are in the following areas:
	- style and consistency (naming conventions, error messages, use of 
	  constants)
	- typos
	- rejection of IEEE copyright restriction on distribution of packages
	- extensions for additional functionality
	- problems found in some functions for corner cases

It was mentioned that the working group is working on addressing all the 
comments and making necessary changes to convert the negative ballots into
positive ones.  Depending on the magnitude of the changes, a decision will be
made at that point on whether or not a re-balloting is necessary.

2. IEEE COPYRIGHT ISSUE

There were 4 negative ballots due to the request from IEEE to remove the free
distribution clause from the packages.  People attending the meeting also
mentioned that they or their companies were not happy with such decision
and suggested to remove the source code from the documentation to avoid
this constraint and document the standard in the way is done in ADA for
similar functionality.

Jose took the action item to check with IEEE the status of this item and 
present the suggestion to the working group for their consideration when
addressing the comments from the ballots.

3. SCHEDULE

The following tentative schedule was presented (contingent on the decision to
re-ballot the standard):
	- Review Ballots and address comments:	10/15 - 11/30
	- Submit to IEEE board: 12/15
	- Approval: either Q4'95 or Q1'96

If reballoting is recommended, the the schedule would look like follows:
	- Review Ballots and address comments:	10/15 - 11/30
	- Re-ballot: 12/15 - 2/1
	- Review ballots: 2/15 - 3/15
	- Submit to IEEE board: 4/15
	- Approval: Q2'96
	
4. ANALOG GROUP STATUS on PRECISION for TYPE REAL

Ernst C. mentioned that the most likely direction in the Analog working group
regarding the precision issue (currently LRM only requires 6 digits of 
precision) was to request a change in the LRM to increase the precision for
type REAL.  If this is the final recommendation, then no additional changes
will be required in the Math packages to support the required precision by
Analog, since the changes would be in the simulators themselves to support
the new precision required by the LRM.

5. WHERE TO FIND INFORMATION

The latest version of the packages is available through anonymous ftp from 
vhdl.org, in the directory /vi/math/package, file names are: 
	math_head.6.13.95.vhd
	math_body.6.13.95.vhd

		or

	math.6.13.95.tar.Z	-- for tar compressed version of the 2 files


The packages can be retrieved as follows:

ftp vhdl.org
username: anonymous
password: <your e-mail address>
ftp> cd /vi/math/package
ftp> get math_head.6.13.95.vhd
ftp> get math_body.6.13.95.vhd
ftp> bye

If you do not have access to ftp, send an e-mail request to jose@vhdl.org



From ume@imaisun.tutics.tut.ac.jp  Fri Dec  1 06:55:54 1995
Received: from imaisun.tutics.tut.ac.jp by vhdl.vhdl.org (4.1/SMI-4.1/BARRNet)
	id AA20464; Fri, 1 Dec 95 06:55:54 PST
Received: by imaisun.tutics.tut.ac.jp (5.67+1.6W/6.4JAIN)
	id AA16724; Fri, 1 Dec 95 23:45:54 JST
Date: Fri, 1 Dec 95 23:45:54 JST
From: ume@imaisun.tutics.tut.ac.jp (Keijiro Umehara)
Return-Path: <ume@imaisun.tutics.tut.ac.jp>
Message-Id: <9512011445.AA16724@imaisun.tutics.tut.ac.jp>
To: math@vhdl.org
Subject: about transform floating pint number

Dear Sirs:

I am studying VLSI design in VHDL at Dept of Info. & Comp. Science,
Toyohashi Univ. of Tech., Aichi, Japan. I would like to have some
advices from you.

I want to transform a single precise floating point number, 
represented in the forms of IEEE754's std_logic_vector, into a
real value. But the VHDL simulator (synopsys inc.) cannot calculate 
the following expression because of the over_flow error.

(-1)**(s)*2**(e-127)*(1+f)   

ex. 11111111011111111111111111111111 
    -> (-1)**(1)*2**(127)*(2.0)    (can't calculate this)
    -> 3.40*10**38 

How to transform a single precise floating point number, 
represented in the forms of IEEE754's std_logic_vector, into a
real value?

Please teach me. Thank you.

--
Keijiro Umehara (e-mail : ume@imaisun.tutics.tut.ac.jp)

From owner-math  Tue Feb 20 17:16:09 1996
Received: (from jose@localhost) by vhdl.vhdl.org (8.7.3/8.7.3) id RAA23046 for math@vhdl.org; Tue, 20 Feb 1996 17:16:09 -0800 (PST)
Date: Tue, 20 Feb 1996 17:16:09 -0800 (PST)
From: Jose Torres <jose>
Message-Id: <199602210116.RAA23046@vhdl.vhdl.org>
To: math@vhdl.org
Subject: 1076.2 comments to ballots


As a result of the balloting process for 1076.2, we need your feedback
on the following proposed changes:

1) Since the package body is not normative (i.e., mandatory) and there
   are issues regarding free distribution of the package body due to
   IEEE copyright new policies, we are planning to remove the package
   body from the documentation, have a reference to it in the non-normative
   part of the standard, and place the package body in a central repository
   such as the "vhdl.org" machine sponsored by VI.

	Would this be OK with you? Please state your reasons for either
	a positive or a negative answer.

2) There have been requests to remove all complex functions that have
   polar arguments except the functions to convert between complex polar
   and complex non-polar.   Main reasons for this request are that these
   functions are not used very often and basic functionality is already
   provided with the availability of the conversion functions and the
   functions for non-polar complex arguments.

	Would you support this change? Please state your reasons for
	either a positive or a negative answer.

We need your feedback as soon as possible, since we would like to finish
the changes for the package by the end of the month to submit a new
revision by next month.

Thanks for your help on this matter.

Regards,

Jose A. Torres
Chair 1076.2


From owner-math  Tue Feb 20 18:22:26 1996
Received: from relay5.UU.NET (relay5.UU.NET [192.48.96.15]) by vhdl.vhdl.org (8.7.3/8.7.3) with ESMTP id SAA23496;