I made a XOR Block

untitled script pic

nice, man!
also, welcome to the forums!

I think that block computes OR, not XOR.

i think you ment to do something like this?
untitled script pic (29)
we all have to start somewhere tho, its nice youre getting into snap!

One problem with your block is that this is supposed to be false

wait no it doesn't...
it's different

@goriot XOR is different from not(() and ())
putting an AND operator inside of NOT operator

actually, XOR is more like this:

the extra details

a XOR (exclusive-or) gate activates only if ONE input is activated

here's XOR's truth table:

XOR Gate - Logic Gates Tutorial

That's still the same thing because it returns true if they are not equal, and it returns false if they are equal.

XOR Gate - Logic Gates TutorialNAND Gate - Logic Gates Tutorial

a single bit makes a difference

Well guess what?

wait, why does ≠ treat two false inputs as unequal?

Because false = false, which would return false because they're equal.

come again..?
i had a stroke trying to read that correctly...

Just look at the image, it's the same as before, but with = instead of ≠.

yeah i just realized that
but of course it's just checking whether or not two boolean inputs are equal like it would with strings and numbers
but talking about pure logic operators, that doesn't exactly count

Equality is equality, whatever the data type. False is equal to False and not equal to anything else. Same for True: only equal to True.

There's no one correct way to implement XOR. The one that matches what the words mean is

But A≠B also works if you restrict its domain to Booleans. (That is, if you use thie approach, FOO XOR BAR reports True instead of giving an error message.)

also works. There are infinitely many algorithms that work, most of them silly, but they work.
((A = True) AND (B = False)) OR ((A = False) AND (B = True))


This is a beautiful script, an elegant solution to a practical problem.

I call to your attention the newish

Also, why do you need the APPEND?

to show the full truth table

I actually meant that as a post to everyone, not specifically you.

By the way, here's another one: