nth-bit-from-byte-2

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

No description
nth-bit-from-byte-2
@/nth-bit-from-byte-2
nnumber
Bytebyte
nth-bit-from-byte-2
n
Byte
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);

    }
}