def get_index(value, bitindex):
    """
        Returns the bit at position `bitindex` of the integer `value`

        Parameters
        ----------
        value : Integer
            Input value
        bitindex : Integer
            Bitindex selector of `value`
    """
    # bitstring = '{0:32b}'.format(value)
    res = int((value >> bitindex) & 0x1)
    if res >= 1:
        return 1
    else:
        return 0