Re: [myhdl-list] Wraparound addition?
Brought to you by:
jandecaluwe
From: Günter D. <dan...@we...> - 2008-08-11 05:15:48
|
Andrew Lentvorski wrote: > How do I add two unsigned intbv() objects such that the addition wraps > around? > > Obviously, I can do the addition and then mask it and reassign like so: > > new = (old0 + old1) & 0xffff > > However, I doubt that is going to translate to verilog properly. There had been a discussion about that feature back in June of last year on this mailing list. Here is a link to the achieve of that: http://sourceforge.net/mailarchive/forum.php?forum_name=myhdl-list&max_rows=25&style=ultimate&viewmonth=200706 Jan had written some background information about the intention of intbv there in connection with the wrap around functionality. This might be a good question to be answered on the FAQ page. Cheers, Guenter |