Conditional Filtering

  • JacobTDC
    8th Aug 2019 Member 0 Permalink

    Is there a way to make some kind of setup to only allow a BRAY or PHOT through if a certain bit is set?
    For example, if I'm checking if the 3th bit is set (0b100), then it should allow through 0b101, 0b110, etc, but not 0b011. Is it possible to make a setup for this? It also needs to have no delay, as in, I need to be able to use it frame after frame.

    Edited once by JacobTDC. Last: 8th Aug 2019
  • LBPHacker
    8th Aug 2019 Developer 0 Permalink

    FILT with a tmp of 1 and a ctype of 4 (aka 0b100). Read the FILT wiki.

    Edited once by LBPHacker. Last: 8th Aug 2019
  • JacobTDC
    8th Aug 2019 Member 0 Permalink

    @LBPHacker you are actually the exact person I was hoping would answer. I'm working on a 7-segment display for your R216K2A.

    The only problem with that answer is that I need to perserve all the bits in the output. Sorry, I should have specified. It also needs to have no delay (or, at least be able to test a bit every time your computer outputs a signal...).

    Edited 2 times by JacobTDC. Last: 8th Aug 2019
  • LBPHacker
    8th Aug 2019 Developer 0 Permalink

    Then you're going to have to take the result and use it to select between the input and whatever you want the output be when bit 2 is not set (I call it bit 2 because 1 << 2 is 4). Something like in this rather old example save of mine but not exactly:

     

    Edited once by LBPHacker. Last: 8th Aug 2019
  • JacobTDC
    8th Aug 2019 Member 0 Permalink

    K. I'll see what I can do with that, thanks!

    UPDATE:

    @LBPHacker I linked together the "value to check" and "result if equal" and I put a not gate before the "other value to check" and changed the "other value to check" to an and gate, now I'm just working on compacting it. Thanks for your help!

    Edited 5 times by JacobTDC. Last: 8th Aug 2019