def METHOD_NAME(value: int, width: int) -> int:
    """@brief Convert an unsigned int to signed.
    @param value Signed value as an unsigned int.
    @param width Bit width of _value_.
    @return Signed version of _value_.
    """
    signmask = 1 << (width - 1)
    if (value & signmask) == 0:
        # Mask off sign bit.
        return value & (signmask - 1)
    else:
        # Two's complement.
        return -bit_invert(value, width - 1) - 1