Re: [vhdl-200x] Modular types

From: Sharad Sinha <>
Date: Sat Jul 12 2014 - 22:56:02 PDT
I agree with YG. I have been following this discussion about support for
modular math etc. and though I have not made any comment so far, the
threads tend to give me an impression that the discussion has veered around
personal tastes, hacking simulators etc. to get one's job done. I think a
language should support general constructs that is needed in all (or most)
of the application areas and aim to support specific constructs through
libraries etc. This keeps the language easy to learn and still useful for
people who are engaged at the extreme end of requirements. I don't think we
want to bloat up VHDL into something similar to C++ (now or in future)
which is just so difficult to master in its entirety. Of course no
computing language will ever be perfect enough for us to describe our
intent easily all the time but assuming we had one then I guess it would
exist in a reductionist form where for every thing that we want to do there
will exist an in-built function....something like the Wolfram language (;

Though such a language will have its own benefits, it takes away the joy of
learning and doing, doesn't it?

HKUST, Hong Kong

On Sun, Jul 13, 2014 at 6:12 AM, <> wrote:

> Le 2014-07-11 18:41, a écrit :
>  There is no obvious definition of logicals
>> and shift operators for not mod 2**n types.
> Well, in certain Galois fields, shifts are multiplies or divisions
> (depending on the direction), AND is multiply, (X)OR is
> addition/subtraction...
> This is how LFSR are derived from the equations :-)
>  So I suppose nobody would
>> use them (and we could revisit this issue at a later revision).
> The first thing is to allow people to do it, then let them do it...
> We all have personal tastes and we shouldn't let ours prevent
> others from doing their own stuff (to a reasonable extent).
> The 2^N case can be defined, and other bases left undefined for now,
> but I have another issue to raise.
> Going back to my experience of "emulating" modulars with plain VHDL,
> in the case of GHDL, integers can be "shifted" left by using 2**N
> wich internally uses the "pow()" subroutine... Which is SLOW,
> while a shift should take at most a few cycles and instructions.
> IF we define/provide non-binary bases, the simulator writers will
> want to implement the general case, potentially disregarding the
> other important case (base=2) which requires a specific, and
> desired fast, implementation. Because it requires 2 handling strategies
> and reasonable people will want to code for the "general cases"
> that gives the same result as the "special case" anyway.
> Just like using "pow()" with base 2.0 gives the same result as
> a shift.
> If we start deciding that "base=2 also defines booleans and shifts",
> this would force people to implement "the expected" behaviour" in 2^N
> (using the native CPU instructions and map to std_logic_vector or
> bit_vector).
> After all, what decent CPU doesn't have shift/rotate/and/or/xor
> instructions ?
> And why would a language prevent the user from using them ?
>  Tristan.
> yg
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Jul 12 22:56:16 2014

This archive was generated by hypermail 2.1.8 : Sat Jul 12 2014 - 22:56:48 PDT