Re: [vhdl-200x] RE: Modular types

From: <whygee@f-cpu.org>
Date: Fri Jul 25 2014 - 05:57:19 PDT
Le 2014-07-25 09:58, Martin.J Thompson a écrit :
> Thanks Andy, that's great - I'll add that detail to the wiki.
> 
> I take it from the below that you seen no need to allow modular ranges
> such as -1 to 6 (for example)? I've had no reponse from anyone else
> which indicates support for that kind of "modularity" (which I guess
> is not modular in the maths sense anyway!) either, which I imagine
> means we can not make it a requirement.
> 
> Cheers,
>  Martin

I agree that "-1 to 6" is not "modular in the math sense",
since traditionally, x mod y returns a positive integer,
but in practice, technicians come up with all sorts of weird stuff too 
:-D

Now, negative ranges could be useful in certain situations.
They would be more complex to handle and not complex for the user
to "fix", (s)he would have to manage an "offset",
which is -1 in our example. This offset would be optimised/propagated
to the rest of the computations by the user.
In the end, it's all bits and wires so their sign is just a handy 
convention.

My opinion : negative ranges would be handy and nicely orthogonal
but they are not an absolute requirement.
I would like to have them because it would be a parallel with the 
integer's "range".
However if we consider that "modular" is restricted to positive numbers 
starting at 0
(just like the math convention) then it's fine, and it must be clearly 
stated.
And since there is no possibility to define a "range" then "modular" is 
a new
type (or co-type ?), not a subtype of integer or positive.

Question : how do you declare a modular type ?
I've seen "modular(base)" and it differs significantly from other 
declarations.
it can be good (show that this type requires a specific treatment) and 
bad
(confusing, breaking the traditional syntax). I have no opinion but I 
would
prefer a syntax that remains close to other kinds of declarations (and I 
haven't
noticed parens in them yet).

yg

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jul 25 05:57:56 2014

This archive was generated by hypermail 2.1.8 : Fri Jul 25 2014 - 05:58:56 PDT