RE: [vhdl-200x] Modular types

From: <whygee@f-cpu.org>
Date: Fri Jul 11 2014 - 03:57:39 PDT
Le 2014-07-11 09:51, Martin.J Thompson a écrit :
>> 
>> What does a modular construct brings that the "range" does not ?
> 
> The fact that you make clear to the tools and other readers that you
> intend the 'wraparound' behaviour from the beginning.  Integers with
> range do not give this behaviour.
> 
> Rather than (for example) having to write if..then..else conditional
> increments on your counters.  And being able to do bitwise things
> directly on the numbers, rather than having to cast them to unsigned
> vectors and back again.

Thanks !
written like that, it's clear :-)

Now, the details must be done right because modular arithmetic is 
tricky.
Can we just start with
  "don't mix bases in expressions"
  "cast to integer otherwise"
  "don't assign to a modular with a smaller base"
and refine from there ?

> Cheers,
> Martin

yg

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

This archive was generated by hypermail 2.1.8 : Fri Jul 11 2014 - 03:58:51 PDT