Frankly, before we go supporting modular types, I'd like to see longer integers than 32 bit signed integers. That limitation is more of a pain to work around than working with modular arithmetic using the language as-is. On 10/23/2014 5:47 PM, Joseph M Gwinn wrote: > > I've been listening in to the debate on modular types et al, and have > a practical comment to offer, from the days when we coded directly on > the iron: > > Most or all modern computer instruction sets support multi-precision > integer arithmetic to some degree, especially addition and > subtraction, where "multi-precision" means integer multiples of a > 32-bit or sometimes 64-bit integer words. Such arithmetic can execute > very fast, even though it's done in software, and the code is simple. > > To get the details, look at the CPU hardware instruction set > documentation. One can always access the data and instruction using > assembly code. Some kinds of C probably also have the hooks and > handles. We are talking about maybe ten lines of code, so portability > between hardware platforms isn't really necessary. One just provides > an assembly-coded C function for each CPU type. > > Joe > > > Inactive hide details for Jim Lewis ---10/23/2014 05:34:21 PM---Hi > Tristan, >> The second proposes adding discriminants (anotheJim Lewis > ---10/23/2014 05:34:21 PM---Hi Tristan, >> The second proposes adding > discriminants (another concept borrowed > > From: Jim Lewis <jim@synthworks.com> > To: vhdl-200x@eda.org > Date: 10/23/2014 05:34 PM > Subject: Re: [vhdl-200x] Modular types, alternative solutions > Sent by: owner-vhdl-200x@eda.org > > ------------------------------------------------------------------------ > > > > Hi Tristan, > >> The second proposes adding discriminants (another concept borrowed > >> from ADA). I am actually surprised that ADA did not do modular > >> types this way as this provides a general feature that we can use > >> for other things, such as saturating types. > > Your discriminant proposal doesn't allow large modular types, and > > doesn't provide strong typing :-( > The proposal shows an example using current VHDL types. > > Certainly if integers are extended, the extended integers could be > used. Hard to base a proposal on something that does not exist yet. > In addition, as a general feature, discriminants could be used > to create a saturating integer type or even a real number with a > modulus (independent as to whether it makes sense or not). > > Cheers, > Jim > p.s. I added notes on your thoughts about generics. It would be > interesting to hear your reply. Also note that Cliff W has been > experimenting with a package that uses generics to do modulo types. > > -- > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Jim Lewis Jim@SynthWorks.com > VHDL Training Expert http://www.SynthWorks.com > IEEE VHDL Working Group Chair > OSVVM, Chief Architect and Cofounder > 1-503-590-4787 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > -- > 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* <http://www.mailscanner.info/>, and is > believed to be clean. -- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Oct 23 15:16:52 2014
This archive was generated by hypermail 2.1.8 : Thu Oct 23 2014 - 15:16:53 PDT