Discussion Forums

Re: Edit logicOperator="XOR"
Sergey Axenov / Metabit Systems Co., Ltd.
10 May 2010 9:25PM ET

Thank you, everyone, for your opinions. I agree that the safest approach is to ask the client to refactor atdl file. That's what I am going to do.

However, just a small comment on ...

> All logical operators are binary....

Yes, it is true that all logical operators (AND, OR, XOR) can be considered as binary. But, for example, in Java and C# we can write an expression:
boolean result1 = true ^ true ^ true ^ true; (result1 = false - even number of true arguments)
boolean result2 = true ^ true ^ false ^ true; (result2 = true - odd number of true arguments)
boolean result3 = true ^ false ^ false ^ true; (result2 = false - even number of true arguments)
no matter what is your expression interpretation rules are:
- like that: true ^ (true ^ (true ^ true))
- or like that: (((true ^ true) ^ true) ^ true)
result going to be the same because the XOR operator in those languages is associative. I believe it is associative in many other languages too.
The same in logic gates, you can cascade two-input XOR gates into a multi-inputs XOR gate.
Therefore, generally speaking, I would not limit XOR operator in ATDL to two operand I would rather make it clearer in the spec that XOR is associative, which means
(A XOR B) XOR C = A XOR (B XOR C) = A XOR B XOR C
to avoid interpretations.


Edit logicOperator="XOR"
Sergey Axenov / Metabit Systems Co., Ltd.   6 May 2010 10:47PM ET
Re: Edit logicOperator="XOR"
Witold Sames / Portware   7 May 2010 5:37AM ET
Re: Edit logicOperator="XOR"
Richard Labs / CL&B Capital Management, LLC   7 May 2010 9:09AM ET
Re: Edit logicOperator="XOR"
Greg Malatestinic / Jordan & Jordan   7 May 2010 10:14AM ET
Re: Edit logicOperator="XOR"
Steve Wilkinson / Cornerstone Technology Limited   10 May 2010 7:13AM ET
Re: Edit logicOperator="XOR"
Sergey Axenov / Metabit Systems Co., Ltd.   10 May 2010 9:25PM ET
Re: Edit logicOperator="XOR"
John Shields / Nomura Securities Co.   15 May 2010 9:26AM ET