Re: [vhdl-200x] [RFC] Rounding functions proposal

From: nkavvadias <nkavvadias@ajaxcompilers.com>
Date: Mon May 20 2013 - 08:44:36 PDT
Hi David and Ryan,

>> I believe the resize function in fixed_pkg already provides the
>> beginning of the rounding capabilities you describe.  I would rather
>> expand the fixed_round_style options and then add some or all of the
>> functions you describe to call resize with the appropriate
>> fixed_round_style.

Since the infrastructure is there, this seems the proper way of 
implementing the additional rounding modes.

> The current enumeration handles two of the eight possibilities. Matlab 
> doesn't (directly) offer two of the eight.

Indeed, the MATLAB language offers ceil, floor, fix, round, nearest, 
convergent.

A quick overview of these modes follows (just for reference):

| Mode          | Description |
| ceil              | Round to plus infinity |
| floor             | Round to minus infinity |
| fix                | Round to zero |
| nearest       | Round to nearest; ties to greatest absolute value |
| round          | Round to nearest; ties to plus infinity |
| convergent | Round to nearest; ties to closest even |

Ryan: do you mean that some rounding modes e.g. round to nearest; ties 
to minus infinity are missing?
Such cases could be added for symmetry and in order to have all options 
there.

> My plan was to implement the new rounding functions as described int 
> IEEE-754-2008 in both fixed and floating point.    Options were made 
> in the original packages to allow for more rounding modes.

Indeed, the same principles apply to floating-point rounding.

Best regards
Nikolaos Kavvadias
CEO
Ajax Compilers
Athens, Greece


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon May 20 08:47:01 2013

This archive was generated by hypermail 2.1.8 : Mon May 20 2013 - 08:47:15 PDT