Re: [myhdl-list] Wraparound addition?
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2008-08-19 09:08:40
|
Günter Dannoritzer wrote: > 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. Ok, what about this: http://myhdl.jandecaluwe.com/doku.php/faq#how_do_i_describe_wrap-around_behaviour -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |