def subone(bv):
    """
    Subtract one bit from a bit vector

    >>> print subone(BitVector(bitstring='1111'))
    1110
    >>> print subone(BitVector(bitstring='0010'))
    0001
    >>> print subone(BitVector(bitstring='0000'))
    1111

    @param bv: Bits to add one bit to the right side
    @type bv: BitVector
    @rtype: BitVector
    """
    new = bv
    r = range(1,len(bv)+1)
    for i in r:
        index = len(bv)-i
        if 1==bv[index]:
            new[index]=0
            break
        new[index]=1
    return new