Re: [myhdl-list] essay about integer arithmetic
Brought to you by:
jandecaluwe
From: Pieter <pie...@gm...> - 2009-03-06 13:23:20
|
That's funny, only yesterday I saw someone write this: some_signal <= '0' if ((a-b) = 1 or (b-a) = 1) then some_signal <= '1'; end if; The arithmetic rules in Verilog are confusing and just wrong. The rules in VHDL are hard to grasp for students, but there's some logic behind it. If only the result of an operation would be as wide as the target, that would solve many issues. It doesn't feel right to change the size of the operand, to get the right size for the result. (and of course you should be able to add a signed and an unsigned operand without having to cast the unsigned to signed + adding a zero to the front) @ Michael Baxter I don't have a lot experience in hardware design. For me this doesn't feel like automating bit-widths. You still define max and min values for the intbev, so you declare the bit width explicitly. Isn't it about the arithmetic rules that are counter-intuitive? I can't see there's anything wrong with those of MyHDL, they are intuitive and create the hardware you want. Can you explain why you believe this automates bit widths and this should never be done? kind regards, pieter 2009/3/6 Michael Baxter <ma...@cr...>: > IMHO, though informed with years of hardware implementation experience, > automating bit-widths should be 100% a non-goal. It should never be done under > any circumstances whatsoever. > > IMHO, this is a serious failing of MyHDL. > > Best, > Michael > California > > On Fri, 06 Mar 2009 07:21:50 -0500, Neal Becker wrote >> Jan Decaluwe wrote: >> >> > This is an essay that I wanted to write for a long time. >> > It describes what I think is wrong with integer arithmetic >> > in VHDL and Verilog, and why MyHDL provides a solution. >> > >> > Before releasing it to the general public, I'm interested >> > to hear what you think about it. >> > >> > http://www.jandecaluwe.com/hdldesign/counting.html >> > >> > >> > >> >> If you really want to automate the bit widths, perhaps some kind of >> interval arithmetic is wanted? >> >> python mpmath and pyinterval both supply some interval arithmetic, >> but these are over reals, not integers. >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San >> Francisco, CA -OSBC tackles the biggest issue in open source: Open >> Sourcing the Enterprise -Strategies to boost innovation and cut >> costs with open source participation -Receive a $600 discount off >> the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> myhdl-list mailing list >> myh...@li... >> https://lists.sourceforge.net/lists/listinfo/myhdl-list > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > myhdl-list mailing list > myh...@li... > https://lists.sourceforge.net/lists/listinfo/myhdl-list > -- Pieter Cogghe Iepenstraat 43 9000 Gent 0487 10 14 21 |