def int2bool(dec,N=16):
    """Converts an integer to a binary represented as a boolean array"""
    result,dec = [],int(dec)
    for i in range(N):
        result.append(bool(dec % 2))
        dec = dec >> 1
    return result