def int_to_binstr(i, bits):
    """Convert integer to a '01' string.
    
    Args:
        bits (int): Number of bits for this integer.
    
    Returns:
        str: binary representation of the integer.
    
    """
    output = ''
    for j in range(0, bits):
        bit = (i & 1 << j) >> j
        output = str(bit) + output
    return output
