RE: [vhdl-200x-ft] More ideas on 1164 and 1076.3

From: Hinton, Ryan W @ CSW-SLC <@>
Date: Wed Jun 23 2004 - 10:10:27 PDT

Jim,

My personal opinion is the opposite of yours in this case.

> > Another one is that in the numeric_std package, often you need
> > to do operations on both signed and unsigned numbers. The way
> > we handle this now with casting is clumsy.
> >
> > <proposal>
> > Add the following functions to numeric_std and numeric_bit:
> > function "+"(L : UNSIGNED; R: SIGNED) return SIGNED;
> > function "+"(L : SIGNED; R: UNSIGNED) return SIGNED;
> . . .
> > function "<="(L : UNSIGNED; R: SIGNED) return boolean;
> > function "<="(L : SIGNED; R: UNSIGNED) return boolean;
> > </proposal>
>
> This would be bad. Currently this is done in std_logic_arith
> and causes ambiguity with literals:
>
> signal A_sv, Y_sv : signed(7 downto 0) ;
>
> Y_sv <= A_sv + "1111" ; -- is it signed or unsigned.

I have written my own versions of these functions, and I use them often.

Is the literal signed or unsigned? Excellent question! Should it be signed
just because the other operand is signed? I don't see an unambiguous
"right" way to interpret the bit literal, so I think we're missing useful
functionality to preserve an ambiguous interpretation of intent. (I think
using a qualified expression or integer is a better indication of intent.)

---
Ryan Hinton
L-3 Communications / Communication Systems - West
ryan.w.hinton@L-3com.com
Received on Wed Jun 23 10:11:12 2004

This archive was generated by hypermail 2.1.8 : Wed Jun 23 2004 - 10:11:15 PDT