K
KJ
Guest
On Apr 15, 8:16 pm, JimLewis <j...@synthworks.com> wrote:
you're creating the logic for "=5" by virtue of your simply counting
the one bits and "due to properties of counters" but not applying that
same thinking to the ">=" case.
The only way you can get the logic that you listed for the "=5" case
is by 'knowing' that count=7 can not occur therefore count(1) is not
needed in the decode. Fair enough. But to be fair on the >=5 case
you should also acknowledge that if one 'knows' that count=7 is
impossible, then count=6 is just as impossible and therefore the "or
(Count(2) and Count(1))" term would not be needed and the exact same
logic would be produced.
A given revision of a given synthesis tool would either have the
capability to detect this condition or not and I think would not
generate the logic that you listed for '>=5' if it was capable of
producing the logic that you listed for '=5'.
smart one (the rising tide will lift all boats after all). My point
was that for a given compiler, I believe you'll get equivalent or
better logic by using >=5 than by using =5. I'll accept that there
might be some instance where this is not true, but I've seen far more
instances where it is and have yet to run across the case where it is
not.
Kevin Jennings
I'm not sure that this is a fair comparison, specifically the wayOn Apr 15, 4:11 am, "KJ" <kkjenni...@sbcglobal.net> wrote:
"JimLewis" <j...@synthworks.com> wrote in message
news:7082d731-d77d-406d-b347-2774cd918d83@y33g2000prg.googlegroups.com....
another contributing factor with the last 2 examples. With an
incrementer
and a smart synthesis tool, the condition "counter = 4" is the same
as
(converting to unsigned for notation only) "counter(2) = '1'"
Which is why it is usually better to code it as "counter >= 4". Then you
don't need to have as smart of a synthesis tool in order to reach the
conclusion that only bit 2 of the counter is needed.
KJ
KJ,
I don't think I agree. While >= 4 seems to produce similar results
to the bit comparison, what about >= 5? If I did my kmaps right -
yikes this is digging back some, decoding the general sense of >= 5
requires:
((Count(2) and Count(0)) or (Count(2) and Count(1))
OTOH, if I count up to 5 and think "=" rather than ">=", due to
properties of counters, I can decode just the bits that are 1
and the resulting logic is:
(Count(2) and Count(0)) ='1'.
you're creating the logic for "=5" by virtue of your simply counting
the one bits and "due to properties of counters" but not applying that
same thinking to the ">=" case.
The only way you can get the logic that you listed for the "=5" case
is by 'knowing' that count=7 can not occur therefore count(1) is not
needed in the decode. Fair enough. But to be fair on the >=5 case
you should also acknowledge that if one 'knows' that count=7 is
impossible, then count=6 is just as impossible and therefore the "or
(Count(2) and Count(1))" term would not be needed and the exact same
logic would be produced.
A given revision of a given synthesis tool would either have the
capability to detect this condition or not and I think would not
generate the logic that you listed for '>=5' if it was capable of
producing the logic that you listed for '=5'.
My point wasn't that a smart compiler wouldn't do better than a not soFor =5 or >=5 to do as good as decoding bits, you need a smart
compiler.
smart one (the rising tide will lift all boats after all). My point
was that for a given compiler, I believe you'll get equivalent or
better logic by using >=5 than by using =5. I'll accept that there
might be some instance where this is not true, but I've seen far more
instances where it is and have yet to run across the case where it is
not.
OTOH, in a LUT based design, will I notice the
difference of 1 LUT pin? Probably not - unless I have alot
of counters.
But that's the reason for these discussions huh?
Kevin Jennings