I would like to know how to determine whether two input values are equal using ARAY/FILT.
I have tried to make an XNOR gate, but I don't know how to make it only output a signal when the two are equal. id:2157435
If you could provide any tips/suggestions in the comments, that would be great. I am going to make a simple ROM module using this technique.
I check for equality with a simple XOR FILT whose .ctype is set to the value I need to check for. A BRAY shot through that FILT either dies (because its .ctype is the same as the FILT's and its new .ctype is 0, which kills BRAYs) or doesn't die (in which case its new .ctype is clobbered). Whether it dies or not is easily detectable.
You can even check for partial equality (which means that only some bits have to match, not all of them). Just add an AND FILT before the XOR FILT and set the bits that do matter as its .ctype.
There might be special cases that make checking for equality easier, but right now I can't think of any. There also might be ways to check for equality that are less complicated than what I outlined here, but if there are, well, I've been doing a great job of ignoring them so far.
You don't have to use DTEC for that. You can set the top bit of the input (by adding 0x2000000 to the input's ctype) so that if the result zeroes out, the BRAY isn't dead as the top bit is still set, with an output of 0x20000000. You can then do whatever you want with this output, because you know for sure that if the output is something other than 0x2000000, the two are not equal
If you're doing subframe, you can DRAY (non-overwriting) a solid spark onto it, and use that to activate some powered material.
If you're not doing subframe, you can just put a conductor there. The BRAY will spark the conductor if it did not get annihilated.
Oh no it wouldn't. It's pretty difficult to find something that can't be done in a single frame. Here, I built a demo for you.
The setup there detects the BRAY if it goes through the XOR gate, and another BRAY if the first one doesn't. The two BRAYs have different .ctypes so the DTEC sets different .ctypes on the output depending on whether the two input values match.
Of course there are other ways to detect the BRAY, and every one of them has its unique use case. The one mark2222 suggested is useful when you want to drive something immediately with the data (e.g. a DRAY to copy something). When you want to store the output though, it makes more sense to have it in the form of coloured FILT.
Also, uhm, I still can't tell whether you're using subframe or not. I assumed you did.
I would implement a simpler set of instructions: ((A OR B) AND (A NAND B))