Re: Updated numeric_std


Subject: Re: Updated numeric_std
From: Rob Anderson (rob@reawebtech.com)
Date: Thu Oct 03 2002 - 12:15:24 PDT


Jim,

I wrote a memo on this point. Your functions came before
we voted and turned down the std_ulogic idea again. So I
assumed it was a mistake. Surely nobody wants just a
few functions to be different...

Unsigned and signed are arrays of std_logic;
T.1 and T.2 use std_logic;
No SIGNED|UNSIGNED functions use std_ulogic;

only the match operators use std_ulogic
but they are 1164 functions. (it was to fill a lack in 1164,
what are we going to do about that? I propose we move them out
of here to 1164, or are they already there?)

Could others please comment on these items?

--Rob

Jim Lewis wrote:

> Rob,
> The proposal (below) proposes the use of std_ulogic.
> How come the implementation uses std_logic?
>
> -- Id: A.3R
> function "+"(L: UNSIGNED; R: STD_LOGIC) return UNSIGNED;
> -- Result subtype: UNSIGNED(L'RANGE)
> -- Result: Similar to A.3 where R is a one bit UNSIGNED
>
>
>>From the perspective of a user using these functions, either will work.
> If you want to convince yourself of this, look in std_logic_1164 for:
> "and" (L,R: STD_LOGIC) return STD_LOGIC ;
>
> It is not there.
>
>
> Cheers,
> Jim
>
>
> -------- Original Message --------
> Subject: Re: Draft JIM_P1
> Date: Thu, 11 Jul 2002 18:16:56 -0700
> From: Jim Lewis <jim@SynthWorks.com>
> To: "Numeric_Std 1076.3" <vhdlsynth@server.eda.org>
> References: <31.29b73e2d.2a5f723a@aol.com>
>
> Alex and group,
>
> <JIM_P1>
>
> I would like to propose that the following eight functions
> be added to numeric_std and corresponding functions
> according to 1076.3 conventions (same result for operands
> containing only '0' and '1' values) to numeric_bit. Std_ulogic
> will be replaced by bit for numeric_bit.
>
> For J1 to J8 functions below the std_ulogic type operand
> is interpreted as a Unsigned'('0' & passed_value) when the other operand
> is unsigned, and as a Signed'('0' & passed_value) when the other operand
> is a signed value.
>
>
> --J1
> function "+"(L: unsigned; R: std_ulogic) return unsigned;
> --J2
> function "+"(L: std_ulogic; R: unsigned) return unsigned;
> --J3
> function "+"(L: signed; R: std_ulogic) return signed;
> --J4
> function "+"(L: std_ulogic; R: signed) return signed;
>
> --J5
> function "-"(L: unsigned; R: std_ulogic) return unsigned;
>
> --J6
> function "-"(L: std_ulogic; R: unsigned) return unsigned;
>
> For J5 and J6 in case L<R the result is unsigned
>
>
> --J7
> function "-"(L: signed; R: std_ulogic) return signed;
>
> --J8
> function "-"(L: std_ulogic; R: signed) return signed;
>
> </JIM_P1>
>
> Comments:
> This is identical to what Ben just posted except for
> "For J5 and J6 in case L<R the result is unsigned" rather than
> "For J5 and J6 in case L<R the result is null"
> This makes the J5 and J6 consistent with A.9 in numeric_std.
>>From the perspective of a decrementer having an unsigned result
> makes sense as "00000" - '1' = "11111"
>
>
> It is important to understand the std_ulogic value as a positive
> value. For signed, if '1' were understood as signed'("" & passed_value)
> then '1' would be come negative one and the equation:
> Y_signed <= A_Signed - '1' ;
> would be equivalent to: Y_signed <= A_Signed + '1' ;
>
> This function is in the -arith package.
>
>
>



This archive was generated by hypermail 2b28 : Thu Oct 03 2002 - 12:14:30 PDT