Nope. NAND is just "not all" (without the "any" part), so 0 NAND 0 is 1, whereas (0 OR 0) AND NOT (0 AND 0) is 0.If I'm not mistaken, isn't that the NAND gate?
Yeah, that's what I said - a diode. And now it's evenThis was possible to construct in pre-1.3.1 by connecting any number of switches/pressure plates to a wire connected to an output . So long as there are an odd number of inputs the output is always 1. We now have a dedicated gate for this function, but it might be easier to just use the previous approach.
Thank you for the clarification, I don't think I'll change the XOR we have right now in terms of functionality, I might look into updating its name / consider adding a new oneAccording to my sources (i.e. Wikipedia and common sense), polyadic XOR would be "addition modulo 2", that is, the output is 1 if an odd number of inputs is 1. That's what you get when evaluating a chain of A XOR B XOR C XOR ... XOR N in any order. Of course it's useful to have a =1 gate, since as I outlined previously, unless an even number of inputs of the XOR (addition modulo 2) gate are toggled (receive a pulse) at the same time, any change in input causes a change in output (a pulse), so in Terraria's pulse-based system, it's effectively the same as a diode. Still, maybe it shouldn't be called an XOR gate, and the XOR gate should be implemented seperately (if at all).
Also, while we're at suggesting new gates, an "any but not all" gate would be nice as well. Then we'd have three gates that would work the same with two inputs, but work differently at higher levels.
Though, then again, anything other than the current "=1" XOR gate could be constructed rather easily.
P.S. Did anyone get familiar with the faulty logic lamps yet?
I think I got it, but I'm not certain yet.P.S. Did anyone get familiar with the faulty logic lamps yet?
I think I got it, but I'm not certain yet.
What gate is used doesn't matter as far as I can tell; neither do lamps placed above the faulty one.
When the faulty lamp gets a signal, the gate is randomly activated with a certain chance. This chance seems to be determined by the logic gate lamps below the faulty one, more specifically (number of active lamps)/(number of total lamps), e.g. if you have three active ones and one inactive one between the faulty lamp and the gate, there's a 75% chance of activation.
holyyoujustsavedmealotoftroubleOh if that's how they work that sounds pretty handy
Here's a super compact RS latch I made using them
-img-
Oh come on, I just finished poking around inside the decompiled source code and then, of course, you just have to come and ruin everything before I can start boasting...NiraExecuto, your understanding of their works is correct =P
Order of implementation, when we started I only wanted to test AND and OROh come on, I just finished poking around inside the decompiled source code and then, of course, you just have to come and ruin everything before I can start boasting...
Though I have to wonder - why are the gates in the order AND, OR, NAND, NOR, XOR, NXOR? Switching OR and NAND would make a lot more sense
P.S. Did anyone get familiar with the faulty logic lamps yet?
Yeah, that's the idea, so that when you connect a device (e.g. a door) to the gate, it turns on (opens) when the gate activates and turns off (closes) when it deactivates.I think I've discovered something - the logic gates don't just send a "pulse" when their condition is true - they also send one when it becomes false. Am I right?
I think I've discovered something - the logic gates don't just send a "pulse" when their condition is true - they also send one when it becomes false. Am I right?
There's no "infinite loop detection" or anything, it's just that if a gate has already sent a pulse this tick, it won't sent any more pulses, even if it's toggled more than once. It doesn't necessarily have to be hooked up to itself, and if I'm not mistaken, it doesn't necessarily turn off either - it just switches to the state it's supposed to without sending any signal.Yes, except in the cases of infinite loops created by hooking up the logic gate box back onto one or more of the lamps above it. In such instances the infinite loop is avoided by shutting off the box and the lamp(s), which means that the box fails to send a signal when it shuts off.
I'm not sure yet whether this always works this way, but from testing so far that's what I observed.
That is correct - though the original purpose was to avoid infinite loops.There's no "infinite loop detection" or anything, it's just that if a gate has already sent a pulse this tick, it won't sent any more pulses, even if it's toggled more than once. It doesn't necessarily have to be hooked up to itself, and if I'm not mistaken, it doesn't necessarily turn off either - it just switches to the state it's supposed to without sending any signal.
There's no "infinite loop detection" or anything, it's just that if a gate has already sent a pulse this tick,