Re: {Spam?} Re: EXTERNAL: [vhdl-200x] A compromise about modular type, boolean operations, integers...

From: <tgingold@free.fr>
Date: Thu Oct 23 2014 - 10:08:20 PDT
> subtype mod4 is modular4 integer;
> 	
> signal mysig : mod4;
> 
> mysig <= 5; -- takes the value (5 mod 4) = 1

So your solution doesn't provide the modular semantic.  The problem
is that it looks to work only for small modulus values, and fail
completely for non-trivial operations.

For example: mysig <= (3 + 2) mod 3;

If the type of mysig was really a modular of 4 type, mysig would be
assigned to 1 (the result of 3 + 2 is 1, and 1 mod 3 is 1).
With your resolved type, mysig is assigned to 2 (the result of 3 + 2 is
5, and 5 mod 3 is 2).

So no, your solution doesn't work.  If you want a modular type, you
need operator with the modular semantic.

Tristan.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Oct 23 10:08:34 2014

This archive was generated by hypermail 2.1.8 : Thu Oct 23 2014 - 10:08:39 PDT