Re: power saving condition test ?

If you write down the truth table, you will see the two equations are not equivalent.

Jim Wu snipped-for-privacy@yahoo.com

Is there any benefit in terms of power consumption or performance in doing > something like the following ? > > if (a && b) a > It seems to me it could be re-written as > > if (b) a > to save some logic. > > I think the difference is the 'a' reg would be clocked more often using

the

second line of code, but does it make a difference if the same > (pre-existing) value is written to the register ? > > Thanks, > Rob > > > >
Reply to
Jim Wu
Loading thread data ...

Sorry, my mistake. I was thinking in a case where another branch exists to set a = 1. e.g

if (a&b) a equivalent.

Reply to
Jim Wu

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.