Table Of Contents

bitset

Version:
    Last Modified: March 15, 2017

    Sets the value of a bit at a particular position in a number. For example, if a = 5 (101), bitset(a,4) = 13 (1101).

    Syntax

    c = bitset(a, b)
    c = bitset(a, b, d)
    c = bitset(a, b, d, e)

    Inputs

    a

    Scalar or array of any dimension of integers. If you use c = bitset(a, b) or c = bitset(a, b, d), a is of type uint64. If you use c = bitset(a, b, d, e), a is of type e.

    b

    Position of the bit whose value you want to set. b is a positive integer.

    d

    Value to which you want to set the bit at position b. d is a real value. If d = 0, bitset sets this bit to 0, otherwise to 1.

    e

    Assumed data type of a. e is a string.

    Name Description
    'uint64'

    uint64

    'uint32'

    uint32

    'uint16'

    uint16

    'uint8'

    uint8

    'int64'

    int64

    'int32'

    int32

    'int16'

    int16

    'int8'

    int8

    Outputs

    c

    a with the bit in position b set to d.

    A = 2340;
    C = bitset(A, 1)

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics