Re: [myhdl-list] Bit-wise inversion issue
Brought to you by:
jandecaluwe
From: Christopher L. F. <cf...@uc...> - 2008-03-04 15:04:22
|
On Mar 3, 2008, at 10:55 AM, Jan Decaluwe wrote: > Ok, let's try to reach a decision. > > I believe there are 2 solutions that can be defended. > > Possible solutions > ------------------ > > 1) "Pure Python" > Bit inversion for intbv's behaves like for Python int's. > > 2) "Practical Hardware" > Make an exception for intbv's whose allowed values are > a finite set of positive values. Let's call these p-intbv's. > For a p-intbv, bits outside the bit range of an unsigned > representation, are assumed to remain zero upon bit-inversion. > > Analysis > -------- > Both solutions have advantages and drawbacks. > > The major drawback of the "Pure Python" solution is that it > may be counter-intuitive to hardware designers. Many designs > mainly use p-intbvs, e.g. created by the form intbv(0)[n:]. > But with this solution it would not be possible to represent > the bit-inversion of a p-intbv by another p-intbv. Negative > values would have to be introduced just for this purpose. > > The major drawback of the "Practical Hardware" solution is > that the result of a bit-inversion would not just depend > on the intbv value, but also on its constraints. It is the > only operator for which this would be so. This is disturbing. > > Conclusion > ---------- > > The drawback of the "Pure Python" solution is probably fatal > for practical purposes. Therefore, I propose to keep the > "Practical Hardware" solution. This is in line with the > feedback from this thread thus far. If I am following, the "Practical Hardware" solution is the proposal, but it has the "disturbing" attribute (operate(s) having to look at the constraints). The solution will include the positive and negative intbv (as far as the ~ operator goes)? I agree with the "disturbing" to a new user it may not be clear why or how a negative number is represented. And it also falls out of the standard implementation (kinda a kludge). Overall I think it is a fair compromise / solution. > > > Jan > > -- > Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com > Kaboutermansstraat 97, B-3000 Leuven, Belgium > From Python to silicon: > http://myhdl.jandecaluwe.com > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list |