def binary(num, size):
    """
    num: int
    size: int

    Takes in a number and returns it's binary equivalent.
    Adds trailing zeroes at the beginning to make the
    length of binary equivalent equal to size.
    """
    binary_out = ''
    while num > 0:
        binary_out += str(num % 2)
        num //= 2
    binary_out += (size - len(binary_out)) * '0'
    return binary_out[::-1]