def gen_numvec(numb, length):
    """
    Given a number return a vector of 1's and 0's corresponding to that
    number's binary value.
    """
    ovec = []
    for _ in range(0, length):
        ovec.append(numb % 2)
        numb //= 2
    return ovec