![]() |
logic gates question
1 Attachment(s)
Could this be implemented in LabVIEW? And if so, what would it do? note: the intent of the small circle on the bottom input of each AND gate is that the bottom input is inverted |
It can be, I coded it up quickly while I was waiting for something, but I'm not sure what it is trying to do.
The second set of ANDs require the last output to be True, so unless you initialized the output to be true, the Ands would never let the code output True. |
Re: logic gates question
note: the intent of the small circle on the bottom input of each AND gate is that the bottom input is inverted |
Re: logic gates question
1 Attachment(s)
I wasn't sure who the question was for. Here is what it looks like in LV if you use the growable logic nodes.
I'll let others do the implementation to see the end result. There are many many ways to write this by the way. Greg McKaskle |
Re: logic gates question
1 Attachment(s)
Greg beat me with the exact implimentation for a toggle
Here is a simple one that has been posted before Attachment 14053 |
Quote:
|
Re: logic gates question
Quote:
@ Greg: how much different is the code that LabVIEW generates for the following two different approaches? http://www.chiefdelphi.com/forums/at...3&d=1361055503 http://www.chiefdelphi.com/forums/at...8&d=1360772515 |
Re: logic gates question
Quote:
|
Re: logic gates question
The LV compiler supports optimization transforms, but I don't expect there to be one that will turn the select and negate into the XOR. So I expect the XOR to be just a bit more efficient. I put the code into timing sequences and ran it 100,000,000 times and indeed, at least for intel code gen, the XOR is just a bit faster.
Greg McKaskle |
Re: logic gates question
1 Attachment(s)
Quote:
|
Re: logic gates question
My testing showed that at least on Intel, the top one that used XOR was more efficient.
I rewrote the other to use a case statement instead of a select and it was then the fastest. Selects tend to execute both the true and false and then select the appropriate one whereas case statements will only execute one or the other. But at this level for toggle on a button on a joystick, we are in the weeds. Write what is readable. Greg McKaskle |
Re: logic gates question
Quote:
http://www.chiefdelphi.com/forums/sh...5&postcount=10 Quote:
Quote:
|
Re: logic gates question
The > was a bit faster than the logic. This is again only on testing on intel and it was about 20% different.
Greg McKaskle |
| All times are GMT -5. The time now is 12:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi