nth-bit-from-byte

nazarijtipusak080/work-with-bit/nth-bit-from-byte

No description
nth-bit-from-byte
@/nth-bit-from-byte
Bytebyte
nbyte
nth-bit-from-byte
Byte
n
nbit
nbitboolean
To use the node in your project you should have the nazarijtipusak080/work-with-bit library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        uint8_t val = getValue<input_Byte>(ctx);
        uint8_t in0 = getValue<input_n>(ctx);
         uint8_t in1 = 1<< in0;
         emitValue<output_nbit>(ctx, in1 & val);

    }
}