From: Adam Krolnik (adamk@cyrix.com)
Date: Mon Sep 29 1997 - 01:02:27 PDT
>>On Sep 25, 3:23pm, Adam Krolnik wrote:
>On Thu Sep 25, 5:26pm, Thomas Fitzpatrick wrote:
Content-Length: 1189
X-Lines: 35
X-Status: $$$$
X-UID: 0000000242
Status: RO
>> 2. If I take a bit select, part select or concatenation, how can I
>> make it signed? Is this what the $signed() operator is for?
> Yes. Bit select and part selects are unsigned, so use
It would be nice to make the unsigned->signed operator look more like a unary operator
rather than a pli function call. Maybe "sxt" ?
> initial begin
> r= a[3:0];
> s = $signed(r);
s = sxt r;
end
And I guess $unsigned() is equivalent to "0+" as Mac later writes.
One unfortunate problem I see is the frequency of conversion back to signed when using the
"automatic unsigned" operators of <<, >>, {a,b}, a?b:c, etc. I would see this as annoying since
I started with signed and have to do something special to keep the results signed.
<p>>> 4. Arithmetic shift left seems redundant, what is the need?
> Yes, ASL is redundant, but it is included for completeness.
Many users aren't well versed when writing expressions. Why add another redundant operator
and tell people to use it on signed registers when it doesn't do anything different. Unless
using <<< and >>> doesn't convert signed to unsigned?!
I.e.
reg signed[5:0] a;
a = -4'sd7 <<< 2; / Yields -28
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:54:42 PDT
and
sponsored by Boyd Technology, Inc.