PerMalmberg / node-red-contrib-boolean-logic

Node-RED nodes to perform Boolean logic
MIT License
11 stars 7 forks source link

XOR not working correctly #9

Open Ansbjerg opened 7 months ago

Ansbjerg commented 7 months ago

Been trying to use XOR with 3 inputs = XOR(3) But it does not behave as it should (see attached video)

If you have 3 switches that outputs TRUE, XOR(3) should return TRUE but is stays FALSE. Also tried with XOR(4) and up with same result. Only XOR(2) works as it should...

https://github.com/PerMalmberg/node-red-contrib-boolean-logic/assets/38882883/f887ce65-42ee-442d-a3af-16e73f152957

PerMalmberg commented 7 months ago

Looks to be working as intended. See https://electronics.stackexchange.com/a/93719, It is implemented as "one and only one".

Feel free to make a PR to add a new variant, or a configuration to change behavior. Alternatively, you can instead cascade multiple XOR gates to get the desired functionality I think.

Ansbjerg commented 7 months ago

Hi,

Weird as all other programs use this version of XOR (see below). And yes - I had to cascade XOR(2) to get the right XOR(3) function. Where and how can I make a request for this function to be added?

image

On Mon, Mar 11, 2024 at 7:46 AM Per Malmberg @.***> wrote:

Looks to be working as intended. See https://electronics.stackexchange.com/a/93719, It is implemented as "one and only one".

Feel free to make a PR to add a new variant, or a configuration to change behavior. Alternatively, you can instead cascade multiple XOR gates to get the desired functionality I think.

— Reply to this email directly, view it on GitHub https://github.com/PerMalmberg/node-red-contrib-boolean-logic/issues/9#issuecomment-1987731399, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJIU4Q76KZGI2BH75NSCNGTYXVHLJAVCNFSM6AAAAABEPBU53SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXG4ZTCMZZHE . You are receiving this because you authored the thread.Message ID: @.*** com>

PerMalmberg commented 7 months ago

Where and how can I make a request for this function to be added?

You don't. You fork this repository, implement it and then make a Pull Request to have it added.

Alternatively, you can create a composite (reusable component) instead, with as many inputs as you need.