I think I’d leave as is because the synthesiser will do something smart (right?) and it’s then about clarity for humans.
-
-
-
It's just for fun. Logic synthesis will produce the same circuit in all cases. Especially for such a small vector.
- Show replies
New conversation -
-
-
Does ~&foo reduce correctly or do you need ~(&foo)? I’d go with ~(&foo) && |foo to mean “not all and not none”
-
Unary operators bind tight
- Show replies
New conversation -
-
-
My foo-fu is weak at the moment. Just too tired to think about it right now.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I would never actually use option 3. I just stumbled upon it by mistake when trying to come up with the most convoluted solution of xor statements. I do like how simple and very non-intuitive it is
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Personally I'd never use any of those options. They're not readable to me. Only foo != 15 && foo != 0, or even foo != 4'd15 && foo != 4'd0. I never trust the compiler to know what I want.
-
I might even put parens around each term because I know the state of Verilog processors is stuck in the last millenium
- Show replies
New conversation -
-
-
For this example #1 is more intuitive. Although #3 gives more control to optimize the gates irrespective of compiler.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.