Re: [myhdl-list] essay about integer arithmetic
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2009-03-06 16:49:34
|
Michael Baxter wrote: > There are no data types in hardware! No, but that doesn't this prove that there shoudn't be data types in hardware description languages. Even a simple bit-vector is an abstraction that "doesn't exist" as such in hardware. Isn't this just a matter of what you're used to and what you trust? > Bits do what their hardware says to do, > and it may be completely unrelated to signedness, or even to values. The rules > of Verilog for arithmetic DO make sense: they do what hardware does, and that > is good. I insist that Verilog's implicit casting of signed's to unsigned's in an expression does *not* make sense. The rules could have been different, and then they would makes sense in terms of their integer interpretation. But they would *still* do "what the hardware does": the difference would be sign-bit extension (= routing) instead of zero padding. > That is why software is different than hardware, and it's why HDLs > are completely different than computer programming languages. Needless to say, one of my goals with MyHDL is to prove that this is false. Seems I'm not succeeding :-) > Applying computer programming language models (such as data types) to hardware > is a very dangerous idea for efficient, high-performance hardware engineering > of logic. Programming models don't work the way hardware works. Many models don't. But with data types such as integers, booleans, and enums there is no loss of efficiency, only a gain in clarity and productivity. > As a designer, I want complete and total control over the number of bits > represented in the (simulated or synthesized) hardware. A program should NOT > do that for me, because a computer program is too stupid to understand what I > want those bits to do, or to mean. In case of integer arithmetic, which is really the sole topic of the essay, that statement is evidently incorrect. The support of VHDL integer subtypes in synthesis tools proves it. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a hardware description language: http://www.myhdl.org |