RE: [vhdl-200x] Logical (and shift) operations on Integers

From: Martin.J Thompson <Martin.J.Thompson@trw.com>
Date: Fri Aug 29 2014 - 05:00:26 PDT
Thanks Peter,

Can I clarify -  by "be represented by integers of those values" I assume you mean the 157 would be represented by the normal 2-s complement bit pattern for "157" at all times, even when part of a constrained subtype as in the example?

Presumably the shift wouldn't produce an out-of-range error if the result of the shift was being assigned to a suitably ranged (or unconstrained range) integer?

Thanks,
Martin


From: owner-vhdl-200x@eda.org [mailto:owner-vhdl-200x@eda.org] On Behalf Of Peter Flake
Sent: 29 August 2014 12:34
To: vhdl-200x@eda.org
Subject: RE: [vhdl-200x] Logical (and shift) operations on Integers

Hi Martin,

I would allow logical and shift operators on all integers and subtypes of integers.  A subtype with range 157 to 160 would be represented by integers of those values.  Applying a shift should therefore produce an out-of range error!

Regards,

Peter


From: owner-vhdl-200x@eda.org<mailto:owner-vhdl-200x@eda.org> [mailto:owner-vhdl-200x@eda.org] On Behalf Of Martin.J Thompson
Sent: 29 August 2014 11:20
To: vhdl-200x@eda.org<mailto:vhdl-200x@eda.org>
Subject: [vhdl-200x] Logical (and shift) operations on Integers

Hi all,

There was some discussion on yesterday's telecon of allowing logical operations on integers.  There is also quite a lot of previous discussion here:

http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/IntegerOperators

Shift operators could also be considered.

One of the implications of doing this is that it would define a definite representation for integers which have these operations applied to them (ie 2-s complement binary).

So in terms of gathering requirements, what would people like to use these operators for?  Some examples which occur to me off the top of my head:

*         Masking bits

*         Shift registers (should simulate faster than vectors, but whether this is significant I don't know!)

*         Xoring in crc generators

*         What else?

Things it probably shouldn't be used for (in future) could be:

*         Power-of-2 Wraparound counters - we'll have modular types for this

*         Others?


Is this a proposal worth further consideration or not?  I see three options at this stage, but am of course open to others!


*         Don't allow it, it's too constraining on the implementation - use a modular type if you want bit operations.

*         Allow it, but only on integers which have a range covering a 'full power-of-2'

*         Allow it on all integer ranges - in which case how to treat things like integers ranged 157 to 160 - should the compiler normalise that to 0 to 3 for logical and shifting purposes or treat them as effectively full-width 2s complement vectors

Thanks,
Martin


--
Martin Thompson BEng(Hons) MIET CEng
martin.j.thompson@trw.com<mailto:martin.j.thompson@trw.com>  +44 121 627 3569
TRW Conekt, Stratford Road, Solihull, B90 4GW
http://www.conekt.co.uk/

This message, together with any of its attachments, is strictly confidential and intended solely for the addressee(s).  It may contain information which is covered by legal, professional or other privilege.  If you are not the intended recipient, you must not disclose, copy or take any action in reliance of this transmission.  If you have received this message in error, please notify us as soon as possible.

TRW Limited, Registered in England, No. 872948, Registered Office Address: Stratford Road, Solihull B90 4AX


--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, 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.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Aug 29 05:00:57 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 29 2014 - 05:01:06 PDT