From: Andy on
On Sep 23, 10:06 am, gabor <ga...(a)alacron.com> wrote:
> It turns out that even with simple binary encoding, the values
> -1 to 2 (or any set of four contiguous integer values) can
> always be decoded using only bits 1 and 0 as these are
> different for each value.  In the case of -1 to 2 they are
> 11 00 01 10, and so even though bit 2 also changes it is
> not necessary to use bit 2 for decoding IF the optimising
> agent is smart enough to detect that bit 2 can be described
> as a function of bits 1 and 0 and is therefore redundant.

You know that, and I know that, but I have yet to see a synthesis tool
that knows that and takes advantage of it.

Make an enumerated type with values minus_one, zero, one and two, and
it might, but only because it has no clue that "one" in english is 1.

Andy
From: glen herrmannsfeldt on
Andy <jonesandy(a)comcast.net> wrote:
(snip)

< You know that, and I know that, but I have yet to see a synthesis tool
< that knows that and takes advantage of it.

It is probably right to say that the synthesis tool doesn't
know that. But following synthesis on most systems is a redundant
logic removal pass which will likely figure out many cases.

More often, non-redundant logic is removed due to errors
in the input. Signals may be constant for testing purposes,
or otherwise accidentally, and be removed. With a little luck,
the whole design is removed!

< Make an enumerated type with values minus_one, zero, one and two, and
< it might, but only because it has no clue that "one" in english is 1.

If you assign it to a two bit bus it will know.

(I think in verilog, not VHDL, but I don't think that matters
for this question.)

-- glen
First  |  Prev  | 
Pages: 1 2 3
Prev: xc3sprog
Next: USB programmable Open Source Hardware