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

From: Martin.J Thompson <>
Date: Thu Jul 24 2014 - 05:03:59 PDT
In general the answer to "why not?" is that it takes effort to both specify and implement the behaviour.  If said behaviour is not going to be used, then that effort would be better spent on more useful functionality.


-----Original Message-----
From: [] On Behalf Of
Sent: 24 July 2014 12:27
Subject: Re: [vhdl-200x] RE: Modular types

Le 2014-07-24 11:20, Martin.J Thompson a écrit :
> Hi all, and thanks to Jim for the reminder J
> I've summarised the past discussions on the implementation of a 
> modular type. You can find a proposal here:
> [1]

Thanks ! I added my 2 cents (I hope the formatting is correct)

> A number of questions are still outstanding…
> First and foremost:
> Do we implement as a "new type", or by "extending the operation of 
> resolution functions"?
> Andy, I'm not sure I've grasped all the implications of your proposed 
> solution through the use of resolution functions. In particular - 
> would it be possible to perform logical operations on modular types 
> merely by overloading the resolution function?

I have no idea. My understanding of VHDL is too shallow for this so I won't dive.

> Also,
> * Should logical, shift, etc. operators be allowed on 
> non-power-of-2-modulus?

well, why not ?
As long as the operators are understood as base-2 AND the wrap-around is correctly applied afterwards, it "should work" if it's needed.

> * Should assignment operate like Ada or in what has been described as 
> "the expected way"?

I have not followed or understood this discussion, what are those two ways ?

> * Should modular types *have* to go from 0 to something? Or would -1 
> to 6 be acceptable? And would it allow logicals, shifts and rotates?

1) ideally, I see the modular type just like an integer with a user-defined range,
    so ranges that don't start at 0 are not ruled out, and could even be useful.
    It might be less practical to map/synthesise (adds protection circuits to preserve
    the range or representation) but i see no reason against.
2) see the previous question and answer : why not ? :-)

> Comments welcome!

as well as feedback on my edits on the twiki page :-)

> Cheers,
>  Martin


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 Thu Jul 24 05:04:07 2014

This archive was generated by hypermail 2.1.8 : Thu Jul 24 2014 - 05:04:24 PDT