def to_binary(num, bitsNum):
	""" Convert a interger to a binary string
	Args: 
		num: the interger to be converted to binary
		bitsNum: the number of bits of the binary string
	Returns:
		the binary string
	"""
	return format(num, '0>'+bitsNum+'b')