def bin_to_gray(bin_list):
    """
    Convert from binary coding to gray coding.

    We assume big endian encoding.

    Examples
    ========

    >>> bin_to_gray('111')
    '100'

    See Also
    ========
    gray_to_bin

    """
    b = [bin_list[0]]
    for i in range(len(bin_list) - 1):
        b += str(int(bin_list[i]) ^ int(b[i - 1]))
    return ''.join(b)